[ 
https://issues.apache.org/jira/browse/HADOOP-20065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18144777#comment-18144777
 ] 

ASF GitHub Bot commented on HADOOP-20065:
-----------------------------------------

LuciferYang commented on code in PR #8929:
URL: https://github.com/apache/hadoop/pull/8929#discussion_r4572866693


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFileSystem.java:
##########
@@ -1301,14 +1301,4 @@ public short getDefaultReplication() {
   public short getDefaultReplication(Path f) {
     return fs.getDefaultReplication(f);

Review Comment:
   Fixed. `getDefaultReplication(Path)` and `getDefaultBlockSize(Path)` now 
pass the path inside the archive to the underlying file system, so creating the 
builders on a `har://` path over ViewFS no longer fails with `Wrong FS` and 
`build()` fails with the HAR `IOException`. Added 
`testNegativeHarFsBuildersWithQualifiedHarPath`, which runs the builders over 
local FS and over ViewFS.





> HarFileSystem#createFile and #appendFile return builders of the underlying 
> file system and bypass its read-only checks
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-20065
>                 URL: https://issues.apache.org/jira/browse/HADOOP-20065
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>            Reporter: Yang Jie
>            Priority: Minor
>              Labels: pull-request-available
>
> HarFileSystem is read-only: create(), append() and the other write operations 
> throw "Har: ... not allowed". createFile(Path) and appendFile(Path), however, 
> return {{fs.createFile(path)}} and {{fs.appendFile(path)}}, builders of the 
> underlying file system, so build() writes there. For a path without a scheme, 
> which HAR treats as a path inside the archive, {{harFs.createFile(new 
> Path("/user/foo/a.har/x")).build()}} creates or truncates /user/foo/a.har/x 
> on the underlying file system, and appendFile appends to an existing file 
> there. A har:// path fails with an unchecked "Wrong FS" 
> IllegalArgumentException instead of an IOException.
> The two overrides were copied from FilterFileSystem in HDFS-11170. The fix 
> removes them, so the FileSystem defaults build through HarFileSystem and fail 
> with an IOException, and adds both methods to MustNotImplement in 
> TestHarFileSystem. HADOOP-16107 fixed the same problem in ChecksumFileSystem.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to