danny0405 commented on a change in pull request #3719:
URL: https://github.com/apache/hudi/pull/3719#discussion_r718104393



##########
File path: 
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HoodieROTablePathFilter.java
##########
@@ -175,8 +181,12 @@ public boolean accept(Path path) {
             metaClientCache.put(baseDir.toString(), metaClient);
           }
 
-          fsView = 
FileSystemViewManager.createInMemoryFileSystemView(engineContext,
-              metaClient, 
HoodieInputFormatUtils.buildMetadataConfig(getConf()));
+          fsView = hoodieTableFileSystemViewCache.get(baseDir.toString());

Review comment:
       Flink streaming reader does not use this code path.

##########
File path: 
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HoodieROTablePathFilter.java
##########
@@ -175,8 +181,12 @@ public boolean accept(Path path) {
             metaClientCache.put(baseDir.toString(), metaClient);
           }
 
-          fsView = 
FileSystemViewManager.createInMemoryFileSystemView(engineContext,
-              metaClient, 
HoodieInputFormatUtils.buildMetadataConfig(getConf()));
+          fsView = hoodieTableFileSystemViewCache.get(baseDir.toString());
+          if (null == fsView) {
+            fsView = 
FileSystemViewManager.createInMemoryFileSystemView(engineContext, metaClient, 
HoodieInputFormatUtils.buildMetadataConfig(getConf()));
+            hoodieTableFileSystemViewCache.put(baseDir.toString(), fsView);

Review comment:
       Use `computeIfAbsent` to simplify the logic.

##########
File path: 
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HoodieROTablePathFilter.java
##########
@@ -202,10 +212,6 @@ public boolean accept(Path path) {
           }
           nonHoodiePathCache.add(folder.toString());
           return true;
-        } finally {
-          if (fsView != null) {
-            fsView.close();
-          }

Review comment:
       How should the cached views been closed ?




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to