Package com.tangosol.net.cache
Class LocalCache.InternalUnitCalculator
java.lang.Object
com.tangosol.net.cache.LocalCache.InternalUnitCalculator
- All Implemented Interfaces:
ConfigurableCacheMap.UnitCalculator
- Enclosing class:
LocalCache
public static class LocalCache.InternalUnitCalculator
extends Object
implements ConfigurableCacheMap.UnitCalculator
The InternalUnitCalculator represents a pluggable UnitCalculator for
the non-pluggable built-in (internal) UnitCalculator implementation
provided by this cache implementation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LocalCache.InternalUnitCalculatorSingleton instance. -
Method Summary
Modifier and TypeMethodDescriptionintcalculateUnits(Object oKey, Object oValue) Calculate a cache cost for the specified cache entry key and value.getName()Obtain the name of the unit calculator.
-
Field Details
-
INSTANCE
Singleton instance.
-
-
Method Details
-
calculateUnits
Description copied from interface:ConfigurableCacheMap.UnitCalculatorCalculate a cache cost for the specified cache entry key and value.- Specified by:
calculateUnitsin interfaceConfigurableCacheMap.UnitCalculator- Parameters:
oKey- the cache key to evaluate for unit costoValue- the cache value to evaluate for unit cost- Returns:
- an integer value 0 or greater, with a larger value signifying a higher cost
-
getName
Description copied from interface:ConfigurableCacheMap.UnitCalculatorObtain the name of the unit calculator. This is intended to be human readable for use in a monitoring tool; examples include "SimpleMemoryCalculator" and "BinaryMemoryCalculator".- Specified by:
getNamein interfaceConfigurableCacheMap.UnitCalculator- Returns:
- the name of the unit calculator
-