Code example for RemovalNotification

Methods: getValuewasEvicted

0
        totalMetric.inc(sizeInBytes); 
    } 
 
    @Override 
    public void onRemoval(RemovalNotification<WeightedFilterCache.FilterCacheKey, DocIdSet> removalNotification) { 
        if (removalNotification.wasEvicted()) { 
            evictionsMetric.inc(); 
        } 
        if (removalNotification.getValue() != null) { 
            totalMetric.dec(DocIdSets.sizeInBytes(removalNotification.getValue())); 
        } 
    } 
}