Class AIOSequentialFileFactory
java.lang.Object
org.apache.activemq.artemis.core.io.AbstractSequentialFileFactory
org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory
- All Implemented Interfaces:
SequentialFileFactory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThe same callback is used for Runnable executor. -
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
ConstructorsConstructorDescriptionAIOSequentialFileFactory(File journalDir, int maxIO) AIOSequentialFileFactory(File journalDir, int bufferSize, int bufferTimeout, int maxIO, boolean logRates) AIOSequentialFileFactory(File journalDir, int bufferSize, int bufferTimeout, int maxIO, boolean logRates, IOCriticalErrorListener listener, org.apache.activemq.artemis.utils.critical.CriticalAnalyzer analyzer) AIOSequentialFileFactory(File journalDir, IOCriticalErrorListener listener, int maxIO) -
Method Summary
Modifier and TypeMethodDescriptionvoidallocateDirectBuffer(int size) used for cases where you need direct buffer outside of the journal context.voidintcalculateBlockSize(int position) voidclearBuffer(ByteBuffer directByteBuffer) createSequentialFile(String fileName) voidvoidintstatic booleanstatic booleanisSupported(File journalPath) booleanbooleannewBuffer(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.voidstart()voidstop()toString()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, setDatasyncMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.core.io.SequentialFileFactory
createSequentialFile, getDirectoryName, onIOError, onIOError, supportsIndividualContext
-
Constructor Details
-
AIOSequentialFileFactory
-
AIOSequentialFileFactory
-
AIOSequentialFileFactory
public AIOSequentialFileFactory(File journalDir, int bufferSize, int bufferTimeout, int maxIO, boolean logRates) -
AIOSequentialFileFactory
public AIOSequentialFileFactory(File journalDir, int bufferSize, int bufferTimeout, int maxIO, boolean logRates, IOCriticalErrorListener listener, org.apache.activemq.artemis.utils.critical.CriticalAnalyzer analyzer)
-
-
Method Details
-
isSyncSupported
public boolean isSyncSupported() -
beforeClose
public void beforeClose() -
afterClose
public void afterClose() -
getCallback
-
enableBufferReuse
public void enableBufferReuse() -
disableBufferReuse
public void disableBufferReuse() -
createSequentialFile
-
isSupportsCallbacks
public boolean isSupportsCallbacks() -
isSupported
public static boolean isSupported() -
isSupported
-
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
-
clearBuffer
-
getAlignment
public int getAlignment()- Specified by:
getAlignmentin interfaceSequentialFileFactory- Overrides:
getAlignmentin classAbstractSequentialFileFactory
-
wrapBuffer
-
calculateBlockSize
public int calculateBlockSize(int position) -
releaseBuffer
- Specified by:
releaseBufferin interfaceSequentialFileFactory- Overrides:
releaseBufferin classAbstractSequentialFileFactory
-
start
public void start()- Specified by:
startin interfaceSequentialFileFactory- Overrides:
startin classAbstractSequentialFileFactory
-
stop
public void stop()- Specified by:
stopin interfaceSequentialFileFactory- Overrides:
stopin classAbstractSequentialFileFactory
-
toString
-