Class NIOSequentialFileFactory
- java.lang.Object
-
- org.apache.activemq.artemis.core.io.AbstractSequentialFileFactory
-
- org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory
-
- All Implemented Interfaces:
SequentialFileFactory
public class NIOSequentialFileFactory extends AbstractSequentialFileFactory
-
-
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
Constructors Constructor Description NIOSequentialFileFactory(java.io.File journalDir, boolean buffered, int maxIO)NIOSequentialFileFactory(java.io.File journalDir, boolean buffered, int bufferSize, int bufferTimeout, int maxIO, boolean logRates)NIOSequentialFileFactory(java.io.File journalDir, boolean buffered, int bufferSize, int bufferTimeout, int maxIO, boolean logRates, IOCriticalErrorListener listener, org.apache.activemq.artemis.utils.critical.CriticalAnalyzer analyzer)NIOSequentialFileFactory(java.io.File journalDir, boolean buffered, IOCriticalErrorListener listener, int maxIO)NIOSequentialFileFactory(java.io.File journalDir, int maxIO)NIOSequentialFileFactory(java.io.File journalDir, IOCriticalErrorListener listener, int maxIO)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBufferallocateDirectBuffer(int size)used for cases where you need direct buffer outside of the journal context.static java.nio.ByteBufferallocateDirectByteBuffer(int size)intcalculateBlockSize(int bytes)voidclearBuffer(java.nio.ByteBuffer buffer)SequentialFilecreateSequentialFile(java.lang.String fileName)voiddisableBufferReuse()voidenableBufferReuse()intgetAlignment()booleanisSupportsCallbacks()java.nio.ByteBuffernewBuffer(int size)Note: You need to release the buffer if is used for reading operations.java.nio.ByteBuffernewBuffer(int size, boolean zeroed)Note: You need to release the buffer if is used for reading operations.voidreleaseBuffer(java.nio.ByteBuffer buffer)voidreleaseDirectBuffer(java.nio.ByteBuffer buffer)used for cases where you need direct buffer outside of the journal context.java.nio.ByteBufferwrapBuffer(byte[] bytes)-
Methods inherited from class org.apache.activemq.artemis.core.io.AbstractSequentialFileFactory
activateBuffer, createDirs, deactivateBuffer, flush, getBufferSize, getCriticalAnalyzer, getDirectory, getMaxIO, isDatasync, listFiles, onIOError, setAlignment, setDatasync, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.core.io.SequentialFileFactory
createSequentialFile
-
-
-
-
Constructor Detail
-
NIOSequentialFileFactory
public NIOSequentialFileFactory(java.io.File journalDir, int maxIO)
-
NIOSequentialFileFactory
public NIOSequentialFileFactory(java.io.File journalDir, IOCriticalErrorListener listener, int maxIO)
-
NIOSequentialFileFactory
public NIOSequentialFileFactory(java.io.File journalDir, boolean buffered, int maxIO)
-
NIOSequentialFileFactory
public NIOSequentialFileFactory(java.io.File journalDir, boolean buffered, IOCriticalErrorListener listener, int maxIO)
-
NIOSequentialFileFactory
public NIOSequentialFileFactory(java.io.File journalDir, boolean buffered, int bufferSize, int bufferTimeout, int maxIO, boolean logRates)
-
NIOSequentialFileFactory
public NIOSequentialFileFactory(java.io.File journalDir, boolean buffered, int bufferSize, int bufferTimeout, int maxIO, boolean logRates, IOCriticalErrorListener listener, org.apache.activemq.artemis.utils.critical.CriticalAnalyzer analyzer)
-
-
Method Detail
-
allocateDirectByteBuffer
public static java.nio.ByteBuffer allocateDirectByteBuffer(int size)
-
enableBufferReuse
public void enableBufferReuse()
-
disableBufferReuse
public void disableBufferReuse()
-
createSequentialFile
public SequentialFile createSequentialFile(java.lang.String fileName)
-
isSupportsCallbacks
public boolean isSupportsCallbacks()
-
allocateDirectBuffer
public java.nio.ByteBuffer allocateDirectBuffer(int size)
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
public void releaseDirectBuffer(java.nio.ByteBuffer buffer)
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
public java.nio.ByteBuffer newBuffer(int size)
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
public java.nio.ByteBuffer newBuffer(int size, boolean zeroed)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
public void releaseBuffer(java.nio.ByteBuffer buffer)
- Specified by:
releaseBufferin interfaceSequentialFileFactory- Overrides:
releaseBufferin classAbstractSequentialFileFactory
-
clearBuffer
public void clearBuffer(java.nio.ByteBuffer buffer)
-
wrapBuffer
public java.nio.ByteBuffer wrapBuffer(byte[] bytes)
-
getAlignment
public int getAlignment()
- Specified by:
getAlignmentin interfaceSequentialFileFactory- Overrides:
getAlignmentin classAbstractSequentialFileFactory
-
calculateBlockSize
public int calculateBlockSize(int bytes)
-
-