Package com.tangosol.io.nio
Class MappedBufferManager
- java.lang.Object
-
- com.tangosol.util.Base
-
- com.tangosol.io.nio.AbstractBufferManager
-
- com.tangosol.io.nio.MappedBufferManager
-
- All Implemented Interfaces:
ByteBufferManager
public class MappedBufferManager extends AbstractBufferManager
Manages a ByteBuffer on a file.- Since:
- Coherence 2.2
- Author:
- cp 2002.09.18
- See Also:
ByteBuffer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_SIZE
Default maximum size for a memory mapped file.static int
DEFAULT_MIN_SIZE
Default minimum size for a memory mapped file.
-
Constructor Summary
Constructors Constructor Description MappedBufferManager()
Construct a MappedBufferManager using defaults.MappedBufferManager(int cbInitial, int cbMaximum, File file)
Construct a MappedBufferManager that supports a buffer of a certain initial and maximum size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
allocateBuffer()
Allocate a new buffer, copying old data if there is any.void
close()
Close the underlying resources.protected void
configureFile(File file)
Configure the buffer manager based on the passed file, which may be null to imply a default temp file, a directory to imply that a file be created in that directory, or it may be the temp file itself.protected void
finalize()
Perform cleanup during garbage collection.protected RandomAccessFile
getFile()
Obtain the RandomAccessFile that the buffer is constructed on.protected void
setFile(RandomAccessFile file)
Specify the RandomAccessFile that the buffer will be constructed on.-
Methods inherited from class com.tangosol.io.nio.AbstractBufferManager
calibrate, getBuffer, getCapacity, getGrowthThreshold, getMaxCapacity, getMaxIncrement, getMinCapacity, getShrinkageThreshold, grow, setBuffer, setCapacity, setGrowthThreshold, setMaxCapacity, setMinCapacity, setShrinkageThreshold, shrink
-
Methods inherited from class com.tangosol.util.Base
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, 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, 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 Detail
-
DEFAULT_MIN_SIZE
public static final int DEFAULT_MIN_SIZE
Default minimum size for a memory mapped file.- See Also:
- Constant Field Values
-
DEFAULT_MAX_SIZE
public static final int DEFAULT_MAX_SIZE
Default maximum size for a memory mapped file.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MappedBufferManager
public MappedBufferManager()
Construct a MappedBufferManager using defaults.
-
MappedBufferManager
public MappedBufferManager(int cbInitial, int cbMaximum, File file)
Construct a MappedBufferManager that supports a buffer of a certain initial and maximum size.- Parameters:
cbInitial
- the initial sizecbMaximum
- the maximum sizefile
- the file to use, or the directory to use, or null to generate a temporary file in the default location
-
-
Method Detail
-
configureFile
protected void configureFile(File file)
Configure the buffer manager based on the passed file, which may be null to imply a default temp file, a directory to imply that a file be created in that directory, or it may be the temp file itself.- Parameters:
file
- the file to use, or the directory to use, or null to generate a temporary file in the default location
-
getFile
protected RandomAccessFile getFile()
Obtain the RandomAccessFile that the buffer is constructed on.- Returns:
- the RandomAccessFile object
-
setFile
protected void setFile(RandomAccessFile file)
Specify the RandomAccessFile that the buffer will be constructed on.- Parameters:
file
- the RandomAccessFile object
-
allocateBuffer
protected void allocateBuffer()
Allocate a new buffer, copying old data if there is any.- Specified by:
allocateBuffer
in classAbstractBufferManager
- See Also:
FileChannel.map()
-
close
public void close()
Close the underlying resources.
-
-