@Override public void delete(@Nonnull Integer key, @Nullable ProfileBuilder value, @Nonnull RemovalCause cause) { if(cause.wasEvicted()) { // the expired profile was NOT flushed in time LOG.warn("Expired profile NOT flushed before removal, some state lost; profile={}, entity={}, cause={}", value.getDefinition().getProfile(), value.getEntity(), cause); } else { // the expired profile was flushed successfully LOG.debug("Expired profile successfully flushed; profile={}, entity={}, cause={}", value.getDefinition().getProfile(), value.getEntity(), cause); } } }
@Override public void delete(@Nonnull Integer key, @Nullable ProfileBuilder value, @Nonnull RemovalCause cause) { if(cause.wasEvicted()) { // add the profile to the expired cache expiredCache.put(key, value); LOG.debug("Profile expired from active cache due to inactivity; profile={}, entity={}, cause={}", value.getDefinition().getProfile(), value.getEntity(), cause); } else { LOG.error("Profile removed from cache unexpectedly. File a bug report; profile={}, entity={}, cause={}", value.getDefinition().getProfile(), value.getEntity(), cause); } } }