Interface SequentialFileFactory
- All Known Implementing Classes:
AbstractSequentialFileFactory, AIOSequentialFileFactory, MappedSequentialFileFactory, NIOSequentialFileFactory
public interface SequentialFileFactory
A SequentialFileFactory
-
Method Summary
Modifier and TypeMethodDescriptionvoidactivateBuffer(SequentialFile file) allocateDirectBuffer(int size) used for cases where you need direct buffer outside of the journal context.intcalculateBlockSize(int bytes) voidclearBuffer(ByteBuffer buffer) voidCreates the directory if it does not exist yet.createSequentialFile(String fileName) default SequentialFilecreateSequentialFile(String fileName, int capacity) voiddefault booleanvoidflush()intlongdefault org.apache.activemq.artemis.utils.critical.CriticalAnalyzerdefault IOCriticalErrorListenerdefault StringintgetMaxIO()booleanbooleandefault booleanLists files that end with the given extension.newBuffer(int size) Note: You need to release the buffer if is used for reading operations.default ByteBuffernewBuffer(int size, boolean zeroed) Note: You need to release the buffer if is used for reading operations.default voidvoidThe SequentialFile will call this method when a disk IO Error happens during the live phase.default voidonIOError(Throwable exception, String message, SequentialFile file) voidreleaseBuffer(ByteBuffer buffer) voidreleaseDirectBuffer(ByteBuffer buffer) used for cases where you need direct buffer outside of the journal context.setAlignment(int alignment) default voidsetDatasync(boolean enabled) voidstart()voidstop()default booleanOnly JDBC supports individual context.wrapBuffer(byte[] bytes)
-
Method Details
-
getCriticalErrorListener
-
setCriticalErrorListener
-
getCriticalAnalyzer
default org.apache.activemq.artemis.utils.critical.CriticalAnalyzer getCriticalAnalyzer() -
createSequentialFile
-
createSequentialFile
-
getMaxIO
int getMaxIO() -
isSyncSupported
default boolean isSyncSupported() -
listFiles
-
isSupportsCallbacks
boolean isSupportsCallbacks() -
onIOError
-
onIOError
-
onIOError
-
allocateDirectBuffer
used 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
used 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
Note: 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
Note: 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
-
activateBuffer
-
deactivateBuffer
void deactivateBuffer() -
wrapBuffer
-
getAlignment
int getAlignment() -
setAlignment
-
calculateBlockSize
int calculateBlockSize(int bytes) -
getDirectory
File getDirectory() -
getDirectoryName
-
clearBuffer
-
start
void start() -
stop
void stop() -
deleteFolder
default boolean deleteFolder() -
createDirs
-
flush
void flush() -
setDatasync
-
isDatasync
boolean isDatasync() -
getBufferSize
long getBufferSize() -
supportsIndividualContext
default boolean supportsIndividualContext()Only JDBC supports individual context. Meaning for Files we need to use the Sync scheduler. for JDBC we need to use a callback from the JDBC completion thread to complete the IOContexts.
-