kbendick commented on a change in pull request #3801:
URL: https://github.com/apache/iceberg/pull/3801#discussion_r774852961



##########
File path: core/src/main/java/org/apache/iceberg/CachingCatalog.java
##########
@@ -86,16 +85,15 @@ 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.
+   *
+   * @see com.github.benmanes.caffeine.cache.RemovalListener
    */
-  class MetadataTableInvalidatingCacheWriter implements 
CacheWriter<TableIdentifier, Table> {
+  class MetadataTableInvalidatingRemovalListener implements 
RemovalListener<TableIdentifier, Table> {
     @Override
-    public void write(TableIdentifier tableIdentifier, Table table) {
-    }
-
-    @Override
-    public void delete(TableIdentifier tableIdentifier, Table table, 
RemovalCause cause) {
+    public void onRemoval(TableIdentifier tableIdentifier, Table table, 
RemovalCause cause) {
+      identLoggingRemovalListener.onRemoval(tableIdentifier, table, cause);

Review comment:
       Nit: Instead of relying on `identLoggingRemovalListener`, since we're 
already inside of an `onRemoval` function, would it make sense to cut out the 
overhead and just add the log statement here if need be?
   
   The double `onRemoval` call looks strange on first glance, and is added 
overhead for the reader or, if Caffeine changes, a potential source of issue 
(Caffeine is much more complex than I had pictured).




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

Reply via email to