|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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_BINARY, SIZE_BOOLEAN, SIZE_BYTE, SIZE_CHARACTER, SIZE_DOUBLE, SIZE_ENTRY, SIZE_FLOAT, SIZE_INTEGER, SIZE_LONG, SIZE_OBJECT, SIZE_OBJECT_REF, SIZE_SHORT, SIZE_STRING |
Constructor Summary | |
---|---|
BinaryMemoryCalculator()
|
Method Summary | |
---|---|
int |
calculateUnits(Object oKey,
Object oValue)
Calculate the approximate number of bytes required to cache the given Binary key and value. |
static void |
main(String[] asArg)
Unit test. |
Methods inherited from class com.tangosol.net.cache.SimpleMemoryCalculator |
---|
calculateShallowSize, padMemorySize, sizeOf, sizeOf |
Field Detail |
---|
public static final BinaryMemoryCalculator INSTANCE
Constructor Detail |
---|
public BinaryMemoryCalculator()
Method Detail |
---|
public int calculateUnits(Object oKey, Object oValue)
calculateUnits
in interface OldCache.UnitCalculator
calculateUnits
in class SimpleMemoryCalculator
oKey
- the keyoValue
- the value
public static void main(String[] asArg)
Usage:
java com.tangosol.net.cache.BinaryMemoryCalculator
asArg
- command line arguments
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |