smaheshwar-pltr commented on code in PR #1142:
URL: https://github.com/apache/polaris/pull/1142#discussion_r1987301528


##########
polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCache.java:
##########
@@ -51,39 +51,16 @@ public StorageCredentialCache() {
         Caffeine.newBuilder()
             .maximumSize(CACHE_MAX_NUMBER_OF_ENTRIES)
             .expireAfter(
-                new Expiry<StorageCredentialCacheKey, 
StorageCredentialCacheEntry>() {
-                  @Override
-                  public long expireAfterCreate(
-                      StorageCredentialCacheKey key,
-                      StorageCredentialCacheEntry entry,
-                      long currentTime) {
-                    long expireAfterMillis =
-                        Math.max(
-                            0,
-                            Math.min(
-                                (entry.getExpirationTime() - 
System.currentTimeMillis()) / 2,
-                                maxCacheDurationMs()));
-                    return TimeUnit.MILLISECONDS.toNanos(expireAfterMillis);
-                  }
-
-                  @Override
-                  public long expireAfterUpdate(
-                      StorageCredentialCacheKey key,
-                      StorageCredentialCacheEntry entry,
-                      long currentTime,
-                      long currentDuration) {
-                    return currentDuration;
-                  }
-
-                  @Override
-                  public long expireAfterRead(
-                      StorageCredentialCacheKey key,
-                      StorageCredentialCacheEntry entry,
-                      long currentTime,
-                      long currentDuration) {
-                    return currentDuration;
-                  }
-                })
+                Expiry.writing(

Review Comment:
   Note: `Expiry.creating` sticks exactly to what this had previously with only 
`expireAfterCreate` being overriden. I think that both `creating` and `writing` 
work.



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