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


##########
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:
   It shouldn't, unless a bug is introduced.



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