[ 
https://issues.apache.org/jira/browse/HADOOP-17028?focusedWorklogId=478721&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-478721
 ]

ASF GitHub Bot logged work on HADOOP-17028:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Sep/20 17:51
            Start Date: 03/Sep/20 17:51
    Worklog Time Spent: 10m 
      Work Description: 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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 478721)
    Time Spent: 1h  (was: 50m)

> ViewFS should initialize target filesystems lazily
> --------------------------------------------------
>
>                 Key: HADOOP-17028
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17028
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: client-mounts, fs, viewfs
>    Affects Versions: 3.2.1
>            Reporter: Uma Maheswara Rao G
>            Assignee: Abhishek Das
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Currently viewFS initialize all configured target filesystems when 
> viewfs#init itself.
> Some target file system initialization involve creating heavy objects and 
> proxy connections. Ex: DistributedFileSystem#initialize will create DFSClient 
> object which will create proxy connections to NN etc.
> For example: if ViewFS configured with 10 target fs with hdfs uri and 2 
> targets with s3a.
> If one of the client only work with s3a target, But ViewFS will initialize 
> all targets irrespective of what clients interested to work with. That means, 
> here client will create 10 DFS initializations and 2 s3a initializations. Its 
> unnecessary to have DFS initialization here. So, it will be a good idea to 
> initialize the target fs only when first time usage call come to particular 
> target fs scheme. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
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