shvachko commented on a change in pull request #2260: URL: https://github.com/apache/hadoop/pull/2260#discussion_r644393901
########## File path: hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java ########## @@ -37,6 +37,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.UnsupportedFileSystemException; +import org.apache.hadoop.fs.impl.FunctionsRaisingIOE.FunctionRaisingIOE; Review comment: It looks like @steveloughran deprecated this class later after his comment. Don't know what prompted the refactoring, but `import org.apache.hadoop.fs.impl.FunctionsRaisingIOE.FunctionRaisingIOE` should be now `org.apache.hadoop.util.functional.FunctionRaisingIOE` ########## File path: hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFileSystemBaseTest.java ########## @@ -1428,4 +1430,45 @@ public void testGetContentSummaryWithFileInLocalFS() throws Exception { summaryAfter.getLength()); } } + + @Test + public void testTargetFileSystemLazyInitialization() throws Exception { + final String clusterName = "cluster" + new Random().nextInt(); + Configuration config = new Configuration(conf); + config.setBoolean(CONFIG_VIEWFS_ENABLE_INNER_CACHE, false); + config.setClass("fs.mockfs.impl", + TestChRootedFileSystem.MockFileSystem.class, FileSystem.class); + ConfigUtil.addLink(config, clusterName, "/user", + URI.create("mockfs://mockauth1/mockpath")); + ConfigUtil.addLink(config, clusterName, + "/mock", URI.create("mockfs://mockauth/mockpath")); + + final int cacheSize = TestFileUtil.getCacheSize(); Review comment: You can call `closeAll()` here, which clears the cache completely. And the you can compare with 0 in the assert. -- 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