Interface SequentialFileFactory
-
- All Known Implementing Classes:
AbstractSequentialFileFactory,AIOSequentialFileFactory,MappedSequentialFileFactory,NIOSequentialFileFactory
public interface SequentialFileFactoryA SequentialFileFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidactivateBuffer(SequentialFile file)java.nio.ByteBufferallocateDirectBuffer(int size)used for cases where you need direct buffer outside of the journal context.intcalculateBlockSize(int bytes)voidclearBuffer(java.nio.ByteBuffer buffer)voidcreateDirs()Creates the directory if it does not exist yet.SequentialFilecreateSequentialFile(java.lang.String fileName)default SequentialFilecreateSequentialFile(java.lang.String fileName, int capacity)voiddeactivateBuffer()voidflush()intgetAlignment()longgetBufferSize()default org.apache.activemq.artemis.utils.critical.CriticalAnalyzergetCriticalAnalyzer()java.io.FilegetDirectory()intgetMaxIO()booleanisDatasync()booleanisSupportsCallbacks()java.util.List<java.lang.String>listFiles(java.lang.String extension)Lists files that end with the given extension.java.nio.ByteBuffernewBuffer(int size)Note: You need to release the buffer if is used for reading operations.default java.nio.ByteBuffernewBuffer(int size, boolean zeroed)Note: You need to release the buffer if is used for reading operations.voidonIOError(java.lang.Exception exception, java.lang.String message, SequentialFile file)The SequentialFile will call this method when a disk IO Error happens during the live phase.voidreleaseBuffer(java.nio.ByteBuffer buffer)voidreleaseDirectBuffer(java.nio.ByteBuffer buffer)used for cases where you need direct buffer outside of the journal context.SequentialFileFactorysetAlignment(int alignment)SequentialFileFactorysetDatasync(boolean enabled)voidstart()voidstop()java.nio.ByteBufferwrapBuffer(byte[] bytes)
-
-
-
Method Detail
-
getCriticalAnalyzer
default org.apache.activemq.artemis.utils.critical.CriticalAnalyzer getCriticalAnalyzer()
-
createSequentialFile
SequentialFile createSequentialFile(java.lang.String fileName)
-
createSequentialFile
default SequentialFile createSequentialFile(java.lang.String fileName, int capacity)
-
getMaxIO
int getMaxIO()
-
listFiles
java.util.List<java.lang.String> listFiles(java.lang.String extension) throws java.lang.ExceptionLists files that end with the given extension.This method inserts a ".' before the extension.
- Parameters:
extension-- Returns:
- Throws:
java.lang.Exception
-
isSupportsCallbacks
boolean isSupportsCallbacks()
-
onIOError
void onIOError(java.lang.Exception exception, java.lang.String message, SequentialFile file)The SequentialFile will call this method when a disk IO Error happens during the live phase.
-
allocateDirectBuffer
java.nio.ByteBuffer allocateDirectBuffer(int size)
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
void releaseDirectBuffer(java.nio.ByteBuffer buffer)
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
java.nio.ByteBuffer newBuffer(int size)
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:
size-- Returns:
- the allocated ByteBuffer
-
newBuffer
default java.nio.ByteBuffer newBuffer(int size, boolean zeroed)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:
size-zeroed- iftruethe returnedByteBuffermust be zeroed, otherwise it tries to save zeroing it.- Returns:
- the allocated ByteBuffer
-
releaseBuffer
void releaseBuffer(java.nio.ByteBuffer buffer)
-
activateBuffer
void activateBuffer(SequentialFile file)
-
deactivateBuffer
void deactivateBuffer()
-
wrapBuffer
java.nio.ByteBuffer wrapBuffer(byte[] bytes)
-
getAlignment
int getAlignment()
-
setAlignment
SequentialFileFactory setAlignment(int alignment)
-
calculateBlockSize
int calculateBlockSize(int bytes)
-
getDirectory
java.io.File getDirectory()
-
clearBuffer
void clearBuffer(java.nio.ByteBuffer buffer)
-
start
void start()
-
stop
void stop()
-
createDirs
void createDirs() throws java.lang.ExceptionCreates the directory if it does not exist yet.- Throws:
java.lang.Exception
-
flush
void flush()
-
setDatasync
SequentialFileFactory setDatasync(boolean enabled)
-
isDatasync
boolean isDatasync()
-
getBufferSize
long getBufferSize()
-
-