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


##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/FilesetMetadataCache.java:
##########
@@ -84,6 +88,23 @@ public Fileset getFileset(NameIdentifier filesetIdent) {
                 NameIdentifier.of(filesetIdent.namespace().level(2), 
filesetIdent.name())));
   }
 
+  /**
+   * Gets the schema by the given schema identifier.
+   *
+   * @param schemaIdent the schema identifier.
+   * @return the schema.
+   */
+  public Schema getSchema(NameIdentifier schemaIdent) {
+    NameIdentifier catalogIdent =
+        NameIdentifier.of(schemaIdent.namespace().level(0), 
schemaIdent.namespace().level(1));
+    return schemaCache.get(
+        schemaIdent,
+        ident -> {
+          Catalog c = client.loadCatalog(catalogIdent.name());

Review Comment:
   you can call `getFilesetCatalog(NameIdentifier catalogIdent)` method in this 
class to reuse the catalog cache



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