public final class MappedSequentialFileFactory extends AbstractSequentialFileFactory
alignment, bufferSize, bufferTimeout, critialErrorListener, criticalAnalyzer, dataSync, EXECUTOR_TIMEOUT, journalDir, maxIO, timedBuffer, writeExecutor| Constructor and Description |
|---|
MappedSequentialFileFactory(File directory,
int capacity,
boolean buffered,
int bufferSize,
int bufferTimeout,
IOCriticalErrorListener criticalErrorListener) |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
allocateDirectBuffer(int size)
used for cases where you need direct buffer outside of the journal context.
|
int |
calculateBlockSize(int bytes) |
int |
capacity() |
MappedSequentialFileFactory |
capacity(int capacity) |
void |
clearBuffer(ByteBuffer buffer) |
SequentialFile |
createSequentialFile(String fileName) |
MappedSequentialFileFactory |
disableBufferReuse() |
MappedSequentialFileFactory |
enableBufferReuse() |
int |
getAlignment() |
boolean |
isSupportsCallbacks() |
ByteBuffer |
newBuffer(int size)
Note: You need to release the buffer if is used for reading operations.
|
void |
releaseBuffer(ByteBuffer buffer) |
void |
releaseDirectBuffer(ByteBuffer buffer)
used for cases where you need direct buffer outside of the journal context.
|
MappedSequentialFileFactory |
setAlignment(int alignment)
Deprecated.
|
MappedSequentialFileFactory |
setDatasync(boolean enabled) |
void |
start() |
void |
stop() |
ByteBuffer |
wrapBuffer(byte[] bytes) |
activateBuffer, createDirs, deactivateBuffer, flush, getBufferSize, getCriticalAnalyzer, getDirectory, getMaxIO, isDatasync, listFiles, onIOErrorpublic MappedSequentialFileFactory(File directory, int capacity, boolean buffered, int bufferSize, int bufferTimeout, IOCriticalErrorListener criticalErrorListener)
public MappedSequentialFileFactory capacity(int capacity)
public int capacity()
public SequentialFile createSequentialFile(String fileName)
public boolean isSupportsCallbacks()
public ByteBuffer allocateDirectBuffer(int size)
SequentialFileFactorypublic void releaseDirectBuffer(ByteBuffer buffer)
SequentialFileFactorypublic MappedSequentialFileFactory enableBufferReuse()
public MappedSequentialFileFactory disableBufferReuse()
public ByteBuffer newBuffer(int size)
SequentialFileFactorypublic void releaseBuffer(ByteBuffer buffer)
releaseBuffer in interface SequentialFileFactoryreleaseBuffer in class AbstractSequentialFileFactorypublic MappedSequentialFileFactory setDatasync(boolean enabled)
setDatasync in interface SequentialFileFactorysetDatasync in class AbstractSequentialFileFactorypublic ByteBuffer wrapBuffer(byte[] bytes)
public int getAlignment()
getAlignment in interface SequentialFileFactorygetAlignment in class AbstractSequentialFileFactory@Deprecated public MappedSequentialFileFactory setAlignment(int alignment)
setAlignment in interface SequentialFileFactorysetAlignment in class AbstractSequentialFileFactorypublic int calculateBlockSize(int bytes)
public void clearBuffer(ByteBuffer buffer)
public void start()
start in interface SequentialFileFactorystart in class AbstractSequentialFileFactorypublic void stop()
stop in interface SequentialFileFactorystop in class AbstractSequentialFileFactoryCopyright © 2018 The Apache Software Foundation. All Rights Reserved.