Class NIOSequentialFileFactory
java.lang.Object
org.apache.activemq.artemis.core.io.AbstractSequentialFileFactory
org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory
- All Implemented Interfaces:
SequentialFileFactory
-
Field Summary
Fields inherited from class org.apache.activemq.artemis.core.io.AbstractSequentialFileFactory
alignment, bufferSize, bufferTimeout, critialErrorListener, criticalAnalyzer, dataSync, EXECUTOR_TIMEOUT, journalDir, maxIO, timedBuffer, writeExecutor -
Constructor Summary
ConstructorsConstructorDescriptionNIOSequentialFileFactory(File journalDir, boolean buffered, int maxIO) NIOSequentialFileFactory(File journalDir, boolean buffered, int bufferSize, int bufferTimeout, int maxIO, boolean logRates) NIOSequentialFileFactory(File journalDir, boolean buffered, int bufferSize, int bufferTimeout, int maxIO, boolean logRates, IOCriticalErrorListener listener, org.apache.activemq.artemis.utils.critical.CriticalAnalyzer analyzer) NIOSequentialFileFactory(File journalDir, boolean buffered, IOCriticalErrorListener listener, int maxIO) NIOSequentialFileFactory(File journalDir, int maxIO) NIOSequentialFileFactory(File journalDir, IOCriticalErrorListener listener, int maxIO) -
Method Summary
Modifier and TypeMethodDescriptionallocateDirectBuffer(int size) used for cases where you need direct buffer outside of the journal context.static ByteBufferallocateDirectByteBuffer(int size) intcalculateBlockSize(int bytes) voidclearBuffer(ByteBuffer buffer) createSequentialFile(String fileName) voidvoidintbooleannewBuffer(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.wrapBuffer(byte[] bytes) Methods inherited from class org.apache.activemq.artemis.core.io.AbstractSequentialFileFactory
activateBuffer, createDirs, deactivateBuffer, flush, getBufferSize, getCriticalAnalyzer, getCriticalErrorListener, getDirectory, getMaxIO, isDatasync, listFiles, onIOError, setAlignment, setCriticalErrorListener, setDatasync, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.core.io.SequentialFileFactory
createSequentialFile, getDirectoryName, isSyncSupported, onIOError, onIOError, supportsIndividualContext
-
Constructor Details
-
NIOSequentialFileFactory
-
NIOSequentialFileFactory
-
NIOSequentialFileFactory
-
NIOSequentialFileFactory
public NIOSequentialFileFactory(File journalDir, boolean buffered, IOCriticalErrorListener listener, int maxIO) -
NIOSequentialFileFactory
public NIOSequentialFileFactory(File journalDir, boolean buffered, int bufferSize, int bufferTimeout, int maxIO, boolean logRates) -
NIOSequentialFileFactory
public NIOSequentialFileFactory(File journalDir, boolean buffered, int bufferSize, int bufferTimeout, int maxIO, boolean logRates, IOCriticalErrorListener listener, org.apache.activemq.artemis.utils.critical.CriticalAnalyzer analyzer)
-
-
Method Details
-
allocateDirectByteBuffer
-
enableBufferReuse
public void enableBufferReuse() -
disableBufferReuse
public void disableBufferReuse() -
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 -
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)zeroed- iftruethe returnedByteBuffermust be zeroed, otherwise it tries to save zeroing it.- Returns:
- the allocated ByteBuffer
-
releaseBuffer
- Specified by:
releaseBufferin interfaceSequentialFileFactory- Overrides:
releaseBufferin classAbstractSequentialFileFactory
-
clearBuffer
-
wrapBuffer
-
getAlignment
public int getAlignment()- Specified by:
getAlignmentin interfaceSequentialFileFactory- Overrides:
getAlignmentin classAbstractSequentialFileFactory
-
calculateBlockSize
public int calculateBlockSize(int bytes)
-