dimas-b commented on code in PR #2022:
URL: https://github.com/apache/polaris/pull/2022#discussion_r2198537121


##########
polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCache.java:
##########
@@ -50,13 +50,10 @@ public class StorageCredentialCache {
   private static final long CACHE_MAX_NUMBER_OF_ENTRIES = 10_000L;
 
   private final LoadingCache<StorageCredentialCacheKey, 
StorageCredentialCacheEntry> cache;
-  private final RealmContext realmContext;
   private final PolarisConfigurationStore configurationStore;
 
   /** Initialize the creds cache */
-  public StorageCredentialCache(
-      RealmContext realmContext, PolarisConfigurationStore configurationStore) 
{
-    this.realmContext = realmContext;
+  public StorageCredentialCache(PolarisConfigurationStore configurationStore) {
     this.configurationStore = configurationStore;
     cache =
         Caffeine.newBuilder()

Review Comment:
   Would you mind making the max cache size (by entries) configurable? Now that 
the caches is shared across realms, configuring its side is more important to 
users, I guess.
   
   I suppose the cache size has to be a global configuration (maybe a 
constructor parameter injected via CDI producers + Quarkus config).



##########
polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheKey.java:
##########
@@ -95,16 +88,13 @@ public Set<String> getAllowedWriteLocations() {
     return allowedWriteLocations;
   }
 
-  public @Nullable PolarisCallContext getCallContext() {
-    return callContext;
-  }
-
   @Override
   public boolean equals(Object o) {
     if (this == o) return true;
     if (o == null || getClass() != o.getClass()) return false;
     StorageCredentialCacheKey cacheKey = (StorageCredentialCacheKey) o;
-    return catalogId == cacheKey.getCatalogId()
+    return Objects.equals(realmId, cacheKey.getRealmId())

Review Comment:
   nit: maybe just convert this class to `@PolarisImmutable`?
   
   Cf. `StsDestination`



-- 
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: issues-unsubscr...@polaris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to