public class EvictionCheckerImpl extends Object implements EvictionChecker
MaxSizeConfig.MaxSizePolicy
to start eviction process.EvictorImpl.evictionChecker
Modifier and Type | Field and Description |
---|---|
protected static int |
EVICTION_START_THRESHOLD_PERCENTAGE |
protected MapServiceContext |
mapServiceContext |
protected MemoryInfoAccessor |
memoryInfoAccessor |
protected static int |
ONE_HUNDRED_PERCENT |
protected static int |
ONE_KILOBYTE |
protected static int |
ONE_MEGABYTE |
Constructor and Description |
---|
EvictionCheckerImpl(MapServiceContext mapServiceContext) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkEvictionPossible(RecordStore recordStore)
Check whether the supplied record-store needs eviction.
|
protected boolean |
checkFreeHeapPercentageEviction(MaxSizeConfig maxSizeConfig) |
protected boolean |
checkFreeHeapSizeEviction(MaxSizeConfig maxSizeConfig) |
protected boolean |
checkHeapPercentageEviction(String mapName,
MaxSizeConfig maxSizeConfig) |
protected boolean |
checkHeapSizeEviction(String mapName,
MaxSizeConfig maxSizeConfig) |
protected boolean |
checkPerNodeEviction(String mapName,
MaxSizeConfig maxSizeConfig) |
protected boolean |
checkPerPartitionEviction(String mapName,
MaxSizeConfig maxSizeConfig,
int partitionId) |
protected List<Integer> |
findPartitionIds() |
protected static double |
getApproximateMaxSize(int maxSizeFromConfig)
used when deciding evictable or not.
|
static double |
getApproximateMaxSize(MaxSizeConfig maxSizeConfig,
MaxSizeConfig.MaxSizePolicy policy)
Get max size setting form config for given policy
|
protected long |
getAvailableMemory() |
protected long |
getFreeMemory() |
protected long |
getMaxMemory() |
protected long |
getRecordStoreHeapCost(String mapName,
PartitionContainer partitionContainer) |
protected int |
getRecordStoreSize(String mapName,
PartitionContainer partitionContainer) |
protected long |
getTotalMemory() |
protected long |
getUsedHeapSize(String mapName) |
protected boolean |
isOwnerOrBackup(int partitionId) |
void |
setMemoryInfoAccessor(MemoryInfoAccessor memoryInfoAccessor) |
protected static final int ONE_HUNDRED_PERCENT
protected static final int EVICTION_START_THRESHOLD_PERCENTAGE
protected static final int ONE_KILOBYTE
protected static final int ONE_MEGABYTE
protected final MapServiceContext mapServiceContext
protected MemoryInfoAccessor memoryInfoAccessor
public EvictionCheckerImpl(MapServiceContext mapServiceContext)
public boolean checkEvictionPossible(RecordStore recordStore)
EvictionChecker
checkEvictionPossible
in interface EvictionChecker
recordStore
- the recordStoretrue
if eviction is required, false
otherwise.protected boolean checkPerNodeEviction(String mapName, MaxSizeConfig maxSizeConfig)
protected boolean checkPerPartitionEviction(String mapName, MaxSizeConfig maxSizeConfig, int partitionId)
protected boolean checkHeapSizeEviction(String mapName, MaxSizeConfig maxSizeConfig)
protected boolean checkFreeHeapSizeEviction(MaxSizeConfig maxSizeConfig)
protected boolean checkHeapPercentageEviction(String mapName, MaxSizeConfig maxSizeConfig)
protected boolean checkFreeHeapPercentageEviction(MaxSizeConfig maxSizeConfig)
protected long getTotalMemory()
protected long getFreeMemory()
protected long getMaxMemory()
protected long getAvailableMemory()
protected long getUsedHeapSize(String mapName)
protected int getRecordStoreSize(String mapName, PartitionContainer partitionContainer)
protected long getRecordStoreHeapCost(String mapName, PartitionContainer partitionContainer)
protected static double getApproximateMaxSize(int maxSizeFromConfig)
public static double getApproximateMaxSize(MaxSizeConfig maxSizeConfig, MaxSizeConfig.MaxSizePolicy policy)
protected boolean isOwnerOrBackup(int partitionId)
public void setMemoryInfoAccessor(MemoryInfoAccessor memoryInfoAccessor)
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.