kbendick commented on a change in pull request #3801:
URL: https://github.com/apache/iceberg/pull/3801#discussion_r775170448
##########
File path: core/src/main/java/org/apache/iceberg/CachingCatalog.java
##########
@@ -86,16 +79,13 @@ protected CachingCatalog(Catalog catalog, boolean
caseSensitive, long expiration
}
/**
- * CacheWriter class for removing metadata tables when their associated data
table is expired
+ * RemovalListener class for removing metadata tables when their associated
data table is expired
* via cache expiration.
+ *
Review comment:
Nit: Unneeded extra line.
##########
File path: core/src/main/java/org/apache/iceberg/CachingCatalog.java
##########
@@ -105,14 +95,14 @@ public void delete(TableIdentifier tableIdentifier, Table
table, RemovalCause ca
}
private Cache<TableIdentifier, Table> createTableCache(Ticker ticker) {
- Caffeine<TableIdentifier, Table> cacheBuilder = Caffeine
+ Caffeine<Object, Object> cacheBuilder = Caffeine
.newBuilder()
- .softValues()
- .removalListener(identLoggingRemovalListener);
+ .softValues();
if (expirationIntervalMillis > 0) {
return cacheBuilder
- .writer(new CachingCatalog.MetadataTableInvalidatingCacheWriter())
+ .removalListener(new MetadataTableInvalidatingRemovalListener())
+ .executor(Runnable::run)
Review comment:
Can you put a comment inline next to this so we don't forget why we did
this in the future?
```
return cacheBuilder
.removalListener(new MetadataTableInvalidatingRemovalListener())
.executor(Runnable::run) // Makes the callbacks to removal
listener synchronous
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]