yuqi1129 commented on code in PR #8254:
URL: https://github.com/apache/gravitino/pull/8254#discussion_r2297979933


##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/FilesetCatalogCache.java:
##########
@@ -70,6 +76,27 @@ public FilesetCatalog getFilesetCatalog(NameIdentifier 
catalogIdent) {
     return filesetCatalog;
   }
 
+  /**
+   * Gets the fileset by the given fileset identifier.
+   *
+   * @param filesetIdent the fileset identifier.
+   * @return the fileset.
+   */
+  public Fileset getFileset(NameIdentifier filesetIdent) {
+    NameIdentifier catalogIdent =
+        NameIdentifier.of(filesetIdent.namespace().level(0), 
filesetIdent.namespace().level(1));
+    FilesetCatalog filesetCatalog = getFilesetCatalog(catalogIdent);
+    Fileset fileset =
+        filesetCache.get(
+            filesetIdent,
+            ident ->
+                filesetCatalog.loadFileset(
+                    NameIdentifier.of(filesetIdent.namespace().level(2), 
filesetIdent.name())));
+    Preconditions.checkArgument(
+        fileset != null, String.format("Loaded fileset: %s is null.", 
filesetIdent));

Review Comment:
   When will the fileset become null?



##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/FilesetCatalogCache.java:
##########
@@ -80,6 +107,14 @@ private Cache<NameIdentifier, FilesetCatalog> 
newCatalogCache(
         .build();
   }
 
+  private Cache<NameIdentifier, Fileset> newFilesetCache(
+      ScheduledThreadPoolExecutor filesetCleanScheduler) {
+    return Caffeine.newBuilder()
+        .maximumSize(100)

Review Comment:
   Why is the size so small? Is there any other consideration that I am not 
aware of?



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