rishabhdaim commented on code in PR #2844:
URL: https://github.com/apache/jackrabbit-oak/pull/2844#discussion_r3072499788


##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java:
##########
@@ -1160,13 +1161,23 @@ public void evicted(K key, V value, RemovalCause cause) 
{
                     @Override
                     public void onRemoval(RemovalNotification<K, V> 
notification) {
                         for (EvictionListener<K, V> l : listeners) {
-                            l.evicted(notification.getKey(), 
notification.getValue(), notification.getCause());
+                            l.evicted(notification.getKey(), 
notification.getValue(), toEvictionCause(notification.getCause()));
                         }
                     }
                 }).
                 build();
     }
 
+    private static EvictionCause toEvictionCause(RemovalCause cause) {
+        return switch (cause) {
+            case EXPLICIT  -> EvictionCause.EXPLICIT;
+            case REPLACED  -> EvictionCause.REPLACED;
+            case SIZE      -> EvictionCause.SIZE;
+            case EXPIRED   -> EvictionCause.EXPIRED;
+            case COLLECTED -> EvictionCause.COLLECTED;
+        };
+    }

Review Comment:
   to convert to the OAK removal standard from the guava ones.



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