steveloughran commented on a change in pull request #2260:
URL: https://github.com/apache/hadoop/pull/2260#discussion_r483151165



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java
##########
@@ -284,7 +290,15 @@ boolean isInternalDir() {
       return false;
     }
 
-    public T getTargetFileSystem() {
+    public T getTargetFileSystem() throws IOException {

Review comment:
       This is now doing more than get. Needs javadocs. What is the thread 
safety story here? 
   

##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java
##########
@@ -284,7 +290,15 @@ boolean isInternalDir() {
       return false;
     }
 
-    public T getTargetFileSystem() {
+    public T getTargetFileSystem() throws IOException {
+      if (isSingleLink && targetFileSystem == null) {
+        targetFileSystem = initFileSystemFunction.apply(targetDirLinkList[0]);
+
+        if (targetFileSystem == null) {
+          throw new IOException("Could not initialize "
+              + "target File System for URI : " + targetDirLinkList[0]);

Review comment:
       make it a PathIOException with the given path.
   

##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java
##########
@@ -35,6 +35,7 @@
 import java.util.Set;
 
 import com.google.common.base.Preconditions;
+import java.util.function.Function;

Review comment:
       import placement
   

##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java
##########
@@ -30,6 +30,7 @@
 import java.util.Map;
 import java.util.Map.Entry;
 
+import java.util.function.Function;

Review comment:
       move to java import group

##########
File path: 
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsConfig.java
##########
@@ -21,6 +21,7 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 
+import java.util.function.Function;

Review comment:
       import placement




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to