Class MappedSequentialFileFactory
java.lang.Object
org.apache.activemq.artemis.core.io.AbstractSequentialFileFactory
org.apache.activemq.artemis.core.io.mapped.MappedSequentialFileFactory
- All Implemented Interfaces:
SequentialFileFactory
-
Field Summary
Fields inherited from class AbstractSequentialFileFactory
alignment, bufferSize, bufferTimeout, critialErrorListener, criticalAnalyzer, dataSync, EXECUTOR_TIMEOUT, journalDir, maxIO, timedBuffer -
Constructor Summary
ConstructorsConstructorDescriptionMappedSequentialFileFactory(File directory, int capacity, boolean buffered, int bufferSize, int bufferTimeout, IOCriticalErrorListener criticalErrorListener) -
Method Summary
Modifier and TypeMethodDescriptionallocateDirectBuffer(int size) used for cases where you need direct buffer outside of the journal context.intcalculateBlockSize(int bytes) intcapacity()capacity(int capacity) voidclearBuffer(ByteBuffer buffer) createSequentialFile(String fileName) createSequentialFile(String fileName, int capacity) intbooleannewBuffer(int size) Note: You need to release the buffer if is used for reading operations.newBuffer(int size, boolean zeroed) Note: You need to release the buffer if is used for reading operations.voidreleaseBuffer(ByteBuffer buffer) voidreleaseDirectBuffer(ByteBuffer buffer) used for cases where you need direct buffer outside of the journal context.setAlignment(int alignment) Deprecated.setDatasync(boolean enabled) voidstart()voidstop()wrapBuffer(byte[] bytes) Methods inherited from class AbstractSequentialFileFactory
activateBuffer, createDirs, deactivateBuffer, deleteFolder, flush, getBufferSize, getCriticalAnalyzer, getCriticalErrorListener, getDirectory, getMaxIO, isDatasync, listFiles, onIOError, setCriticalErrorListenerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SequentialFileFactory
getDirectoryName, isSyncSupported, onIOError, onIOError, supportsIndividualContext
-
Constructor Details
-
MappedSequentialFileFactory
public MappedSequentialFileFactory(File directory, int capacity, boolean buffered, int bufferSize, int bufferTimeout, IOCriticalErrorListener criticalErrorListener)
-
-
Method Details
-
capacity
-
capacity
public int capacity() -
createSequentialFile
-
createSequentialFile
-
isSupportsCallbacks
public boolean isSupportsCallbacks() -
allocateDirectBuffer
Description copied from interface:SequentialFileFactoryused for cases where you need direct buffer outside of the journal context. This is because the native layer has a method that can be reused in certain cases like paging -
releaseDirectBuffer
Description copied from interface:SequentialFileFactoryused for cases where you need direct buffer outside of the journal context. This is because the native layer has a method that can be reused in certain cases like paging -
enableBufferReuse
-
disableBufferReuse
-
newBuffer
Description copied from interface:SequentialFileFactoryNote: You need to release the buffer if is used for reading operations. You don't need to do it if using writing operations (AIO Buffer Lister will take of writing operations)- Returns:
- the allocated ByteBuffer
-
newBuffer
Description copied from interface:SequentialFileFactoryNote: You need to release the buffer if is used for reading operations. You don't need to do it if using writing operations (AIO Buffer Lister will take of writing operations)- Parameters:
zeroed- iftruethe returnedByteBuffermust be zeroed, otherwise it tries to save zeroing it.- Returns:
- the allocated ByteBuffer
-
releaseBuffer
- Specified by:
releaseBufferin interfaceSequentialFileFactory- Overrides:
releaseBufferin classAbstractSequentialFileFactory
-
setDatasync
- Specified by:
setDatasyncin interfaceSequentialFileFactory- Overrides:
setDatasyncin classAbstractSequentialFileFactory
-
wrapBuffer
-
getAlignment
public int getAlignment()- Specified by:
getAlignmentin interfaceSequentialFileFactory- Overrides:
getAlignmentin classAbstractSequentialFileFactory
-
setAlignment
Deprecated.- Specified by:
setAlignmentin interfaceSequentialFileFactory- Overrides:
setAlignmentin classAbstractSequentialFileFactory
-
calculateBlockSize
public int calculateBlockSize(int bytes) -
clearBuffer
-
start
public void start()- Specified by:
startin interfaceSequentialFileFactory- Overrides:
startin classAbstractSequentialFileFactory
-
stop
public void stop()- Specified by:
stopin interfaceSequentialFileFactory- Overrides:
stopin classAbstractSequentialFileFactory
-