org.terracotta.cache.evictor
Interface Evictable<K>

Type Parameters:
K - The Evictable item type, usually the key type of a Map
All Known Implementing Classes:
LocalCache, TerracottaDistributedCache

public interface Evictable<K>

The Evictor works against this interface to trigger local and orphan eviction. The Evictable implementation is most commonly a Map where the parameter here is the key type. It could theoretically also work on a partial List or array where K is the item type.


Method Summary
 void evictExpiredLocalElements()
          Trigger to walk through the local elements, look for expired elements, and evict them.
 void evictOrphanElements(ClusterInfo clusterInfo)
          Trigger to walk through the specified set of orphaned elements, check whether they have expired, and evict them from the store.
 EvictionStatistics getStatistics()
          Retrieve the statistics for the current JVM.
 boolean isStatisticsEnabled()
          Returns whether statistics are enabled.
 void setStatisticsEnabled(boolean enabled)
          Toggle statistics being enabled or not.
 

Method Detail

evictExpiredLocalElements

void evictExpiredLocalElements()
Trigger to walk through the local elements, look for expired elements, and evict them.


evictOrphanElements

void evictOrphanElements(ClusterInfo clusterInfo)
Trigger to walk through the specified set of orphaned elements, check whether they have expired, and evict them from the store.

Parameters:
clusterInfo - The Terracotta cluster info which can be used to obtain the orphaned element list

setStatisticsEnabled

void setStatisticsEnabled(boolean enabled)
Toggle statistics being enabled or not. When statistics are disabled, the already accumulated data will be reset.

Parameters:
enabled - true to enable statistics; and false to disable them

isStatisticsEnabled

boolean isStatisticsEnabled()
Returns whether statistics are enabled.

Returns:
true when statistics are enabled; and false otherwise

getStatistics

EvictionStatistics getStatistics()
Retrieve the statistics for the current JVM.

Returns:
the statistics instance for the current JVM, statistics aren't shared across the cluster


Copyright © 2015 Terracotta, Inc.. All Rights Reserved.