eric-maynard commented on code in PR #433:
URL: https://github.com/apache/polaris/pull/433#discussion_r2093632379


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -881,11 +859,57 @@ public Map<String, String> getCredentialConfig(
         getCredentialVendor(),
         callContext.getPolarisCallContext().getConfigurationStore(),
         tableIdentifier,
-        getLocationsAllowedToBeAccessed(tableMetadata),
+        locationsAllowedToBeAccessed,
         storageActions,
         storageInfo.get());
   }
 
+  public MetadataJson loadTableMetadataJson(TableIdentifier identifier) {
+    return loadTableMetadataJson(identifier, SNAPSHOTS_ALL);
+  }
+
+  boolean shouldFilterSnapshots(String snapshots) {
+    if (snapshots == null || snapshots.equalsIgnoreCase(SNAPSHOTS_ALL)) {
+      return false;
+    }
+    return callContext
+        .getPolarisCallContext()
+        .getConfigurationStore()
+        .getConfiguration(
+            callContext.getPolarisCallContext(), 
FeatureConfiguration.ALWAYS_FILTER_SNAPSHOTS);
+  }
+
+  public MetadataJson loadTableMetadataJson(TableIdentifier identifier, String 
snapshots) {
+    int maxMetadataCacheBytes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getPolarisCallContext(), 
FeatureConfiguration.METADATA_CACHE_MAX_BYTES);
+    Supplier<TableMetadata> fallback =

Review Comment:
   I used `Supplier` to make testing easier as you noted, but also to capture 
the fact that we really may not always be loading from a catalog. For example, 
in the future if we directly stream metadata.json content from object storage 
to the client, we'd need a different kind of fallback implementation. Is the 
concern about the performance overhead of the lambda?



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