public class BinaryMemoryCalculator extends SimpleMemoryCalculator
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.
Base.LoggingWriter, Base.StackFrame
Modifier and Type | Field and Description |
---|---|
static BinaryMemoryCalculator |
INSTANCE
Singleton BinaryMemoryCalculator instance.
|
MAP_FIXED_SIZES, MAP_PRIMITIVE_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 and Description |
---|
BinaryMemoryCalculator() |
Modifier and Type | Method and Description |
---|---|
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.
|
calculateShallowSize, getEntrySize, getName, isInnerClass, padMemorySize, sizeOf, sizeOf
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
public static final BinaryMemoryCalculator INSTANCE
public int calculateUnits(Object oKey, Object oValue)
calculateUnits
in interface ConfigurableCacheMap.UnitCalculator
calculateUnits
in class SimpleMemoryCalculator
oKey
- the keyoValue
- the valuepublic static void main(String[] asArg)
Usage:
java com.tangosol.net.cache.BinaryMemoryCalculator
asArg
- command line arguments