Package com.tangosol.io.nio
Class DirectBufferManager
java.lang.Object
com.tangosol.util.Base
com.tangosol.io.nio.AbstractBufferManager
com.tangosol.io.nio.DirectBufferManager
- All Implemented Interfaces:
- ByteBufferManager
Deprecated.
Manages a growable direct ByteBuffer.
- Since:
- Coherence 2.2
- Author:
- cp 2002.09.16
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class com.tangosol.util.BaseBase.LoggingWriter
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDeprecated.Use Runtime.runFinalization() to trigger finalization (default).static final intDeprecated.Use Runtime.gc() to trigger finalization.static final intDeprecated.Do not perform any buffer cleanup.protected static final booleanDeprecated.Set to true to use on-heap storage, false to use off-heap.protected static longDeprecated.Total amount of memory that have not been collected yet.
- 
Constructor SummaryConstructorsConstructorDescriptionDirectBufferManager(int cbInitial, int cbMaximum) Deprecated.Construct a DirectBufferManager that supports a buffer of a certain initial and maximum size.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidDeprecated.Allocate a new buffer, copying old data if there is any.protected voidDeprecated.Determines if and how to induce the JVM to run finalizers.static intDeprecated.Return the total number of buffers allocated by the DirectBufferManager.static intDeprecated.Return the method used for buffers cleanup when the threshold is met.static floatDeprecated.Return the value used to calculate the size threshold for the uncollected buffers that triggers a cleanup operation.static longDeprecated.Return the total time spent allocating buffers, copying the previous content and cleaning up uncollected buffers.protected static voidsetCleanupMethod(int nCleanupMethod) Deprecated.Set the method to be used for buffers cleanup when the threshold is met.protected static voidsetCleanupThreshold(float flCleanupThreshold) Deprecated.Determines how often, to run thecleanupBuffers()method.Methods inherited from class com.tangosol.io.nio.AbstractBufferManagercalibrate, getBuffer, getCapacity, getGrowthThreshold, getMaxCapacity, getMaxIncrement, getMinCapacity, getShrinkageThreshold, grow, setBuffer, setCapacity, setGrowthThreshold, setMaxCapacity, setMinCapacity, setShrinkageThreshold, shrinkMethods inherited from class com.tangosol.util.Baseazzert, 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, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, newHashMap, newHashMap, newHashSet, newHashSet, 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
- 
Field Details- 
CLEANUP_NONEpublic static final int CLEANUP_NONEDeprecated.Do not perform any buffer cleanup.- See Also:
 
- 
CLEANUP_FINALIZERSpublic static final int CLEANUP_FINALIZERSDeprecated.Use Runtime.runFinalization() to trigger finalization (default).- See Also:
 
- 
CLEANUP_GCpublic static final int CLEANUP_GCDeprecated.Use Runtime.gc() to trigger finalization.- See Also:
 
- 
MODE_DEBUGprotected static final boolean MODE_DEBUGDeprecated.Set to true to use on-heap storage, false to use off-heap.- See Also:
 
- 
s_cbUncollectedprotected static volatile long s_cbUncollectedDeprecated.Total amount of memory that have not been collected yet.
 
- 
- 
Constructor Details- 
DirectBufferManagerpublic DirectBufferManager(int cbInitial, int cbMaximum) Deprecated.Construct a DirectBufferManager that supports a buffer of a certain initial and maximum size.- Parameters:
- cbInitial- the initial size
- cbMaximum- the maximum size
 
 
- 
- 
Method Details- 
allocateBufferprotected void allocateBuffer()Deprecated.Allocate a new buffer, copying old data if there is any.- Specified by:
- allocateBufferin class- AbstractBufferManager
- See Also:
 
- 
cleanupBuffersprotected void cleanupBuffers()Deprecated.Determines if and how to induce the JVM to run finalizers. This allows to somewhat mitigate a known JDK bug.When the amount of uncollected garbage reaches the threshold indicated by the cleanup thresholdfrequency, induce the GC. In a 64-bit VMs this issue is probably reduced to a minimum.
- 
getTotalAllocationTimepublic static long getTotalAllocationTime()Deprecated.Return the total time spent allocating buffers, copying the previous content and cleaning up uncollected buffers.- Returns:
- the number of milliseconds spent in allocating, copying and cleaning up uncollected buffers
 
- 
getAllocationspublic static int getAllocations()Deprecated.Return the total number of buffers allocated by the DirectBufferManager.- Returns:
- the total number of allocations
 
- 
getCleanupMethodpublic static int getCleanupMethod()Deprecated.Return the method used for buffers cleanup when the threshold is met.The possible return values are: - CLEANUP_FINALIZERS - use Runtime.runFinalization() (default);
- CLEANUP_GC - use Runtime.gc();
- CLEANUP_NONE - do not perform any cleanup.
 - Returns:
- one of the CLEANUP_* constants representing the cleanup method
 
- 
setCleanupMethodprotected static void setCleanupMethod(int nCleanupMethod) Deprecated.Set the method to be used for buffers cleanup when the threshold is met.- Parameters:
- nCleanupMethod- a value representing the cleanup method; valid values are the CLEANUP_* constants
- Throws:
- IllegalArgumentException- if passed value is not a valid CLEANUP_* constant
 
- 
getCleanupThresholdpublic static float getCleanupThreshold()Deprecated.Return the value used to calculate the size threshold for the uncollected buffers that triggers a cleanup operation. Cleanup is performed when the total size of uncollected memory has grown over the product of this value and the maximum Java heap size.- Returns:
- a value between 0.0 and 1.0 used to calculate the cleanup frequency
 
- 
setCleanupThresholdprotected static void setCleanupThreshold(float flCleanupThreshold) Deprecated.Determines how often, to run thecleanupBuffers()method. Cleanup is performed when the uncollected memory has grown over the product of this value and the maximum Java heap size.- Parameters:
- flCleanupThreshold- a value between 0.0 and 1.0 used to calculate the cleanup frequency
- Throws:
- IllegalArgumentException- if the passed value is not valid
 
 
- 
JournalBinaryStoreinstead