yuqi1129 commented on code in PR #8254:
URL: https://github.com/apache/gravitino/pull/8254#discussion_r2299520579
##########
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:
This is not a big problem; it depends on you. I remember when I used the
same code, jerry just suggested me remove it as `NoSuchFilesetException` will
occur. For me both are okay.
--
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]