Package org.cache2k.core.eviction
Class EvictionFactory
- java.lang.Object
-
- org.cache2k.core.eviction.EvictionFactory
-
public class EvictionFactory extends Object
- Author:
- Jens Wilke
-
-
Constructor Summary
Constructors Constructor Description EvictionFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EvictionconstructEviction(InternalCacheBuildContext customizationContext, HeapCacheForEviction hc, InternalEvictionListener l, org.cache2k.config.Cache2kConfig config, int availableProcessors)Construct segmented or queued eviction.static longdetermineMaxSize(long entryCapacity, int segmentCount)static longdetermineMaxWeight(long maximumWeight, int segmentCount)static intdetermineSegmentCount(boolean strictEviction, int availableProcessors, boolean boostConcurrency, long entryCapacity, long maxWeight, int segmentCountOverride)Determine number of segments based on the the available processors.
-
-
-
Method Detail
-
constructEviction
public Eviction constructEviction(InternalCacheBuildContext customizationContext, HeapCacheForEviction hc, InternalEvictionListener l, org.cache2k.config.Cache2kConfig config, int availableProcessors)
Construct segmented or queued eviction. For the moment hard coded. If capacity is at least 1000 we use 2 segments if 2 or more CPUs are available. Segmenting the eviction only improves for lots of concurrent inserts or evictions, there is no effect on read performance.
-
determineMaxSize
public static long determineMaxSize(long entryCapacity, int segmentCount)
-
determineMaxWeight
public static long determineMaxWeight(long maximumWeight, int segmentCount)
-
determineSegmentCount
public static int determineSegmentCount(boolean strictEviction, int availableProcessors, boolean boostConcurrency, long entryCapacity, long maxWeight, int segmentCountOverride)Determine number of segments based on the the available processors. For small cache sizes, no segmentation happens at all.
-
-