|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.net.cache.SimpleMemoryCalculator
com.tangosol.net.cache.BinaryMemoryCalculator
public class BinaryMemoryCalculator
A UnitCalculator implementation that weighs a cache entry based upon the amount of physical memory (in bytes) required to store the entry.
This implementation can only determine an accurate entry size if both the entry key and value are Binary
objects; otherwise, an exception will be thrown during the unit calculation.
Field Summary | |
---|---|
static BinaryMemoryCalculator |
INSTANCE Singleton BinaryMemoryCalculator instance. |
Fields inherited from class com.tangosol.net.cache.SimpleMemoryCalculator |
---|
MAP_FIXED_SIZES, SIZE_BASIC_OBJECT, SIZE_BIGDECIMAL, SIZE_BIGINTEGER, SIZE_BINARY, SIZE_BOOLEAN, SIZE_BYTE, SIZE_CHARACTER, SIZE_DATE, SIZE_DOUBLE, SIZE_ENTRY, SIZE_FLOAT, SIZE_INTEGER, SIZE_LONG, SIZE_OBJECT, SIZE_OBJECT_REF, SIZE_SHORT, SIZE_STRING, SIZE_TIMESTAMP |
Constructor Summary | |
---|---|
BinaryMemoryCalculator() |
Method Summary | |
---|---|
int |
calculateUnits(java.lang.Object oKey, java.lang.Object oValue) Calculate the approximate number of bytes required to cache the given Binary key and value. |
static void |
main(java.lang.String[] asArg) Unit test. |
Methods inherited from class com.tangosol.net.cache.SimpleMemoryCalculator |
---|
calculateShallowSize, getName, padMemorySize, sizeOf, sizeOf |
Field Detail |
---|
public static final BinaryMemoryCalculator INSTANCE
Constructor Detail |
---|
public BinaryMemoryCalculator()
Method Detail |
---|
public int calculateUnits(java.lang.Object oKey, java.lang.Object oValue)
calculateUnits
in interface ConfigurableCacheMap.UnitCalculator
calculateUnits
in class SimpleMemoryCalculator
oKey
- the keyoValue
- the valuepublic static void main(java.lang.String[] asArg)
Usage:
java com.tangosol.net.cache.BinaryMemoryCalculator
asArg
- command line arguments
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |