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, onIOError
public 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)
SequentialFileFactory
public void releaseDirectBuffer(ByteBuffer buffer)
SequentialFileFactory
public MappedSequentialFileFactory enableBufferReuse()
public MappedSequentialFileFactory disableBufferReuse()
public ByteBuffer newBuffer(int size)
SequentialFileFactory
public void releaseBuffer(ByteBuffer buffer)
releaseBuffer
in interface SequentialFileFactory
releaseBuffer
in class AbstractSequentialFileFactory
public MappedSequentialFileFactory setDatasync(boolean enabled)
setDatasync
in interface SequentialFileFactory
setDatasync
in class AbstractSequentialFileFactory
public ByteBuffer wrapBuffer(byte[] bytes)
public int getAlignment()
getAlignment
in interface SequentialFileFactory
getAlignment
in class AbstractSequentialFileFactory
@Deprecated public MappedSequentialFileFactory setAlignment(int alignment)
setAlignment
in interface SequentialFileFactory
setAlignment
in class AbstractSequentialFileFactory
public int calculateBlockSize(int bytes)
public void clearBuffer(ByteBuffer buffer)
public void start()
start
in interface SequentialFileFactory
start
in class AbstractSequentialFileFactory
public void stop()
stop
in interface SequentialFileFactory
stop
in class AbstractSequentialFileFactory
Copyright © 2019 JBoss by Red Hat. All rights reserved.