org.hornetq.core.journal.impl
public class NIOSequentialFileFactory extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
bufferSize |
protected long |
bufferTimeout |
protected static int |
EXECUTOR_TIMEOUT |
protected String |
journalDir |
protected TimedBuffer |
timedBuffer |
protected ExecutorService |
writeExecutor
Asynchronous writes need to be done at another executor.
|
Constructor and Description |
---|
NIOSequentialFileFactory(String journalDir) |
NIOSequentialFileFactory(String journalDir,
boolean buffered) |
NIOSequentialFileFactory(String journalDir,
boolean buffered,
int bufferSize,
int bufferTimeout,
boolean logRates) |
NIOSequentialFileFactory(String journalDir,
boolean buffered,
int bufferSize,
int bufferTimeout,
boolean logRates,
IOCriticalErrorListener listener) |
NIOSequentialFileFactory(String journalDir,
boolean buffered,
IOCriticalErrorListener listener) |
NIOSequentialFileFactory(String journalDir,
IOCriticalErrorListener listener) |
Modifier and Type | Method and Description |
---|---|
void |
activateBuffer(SequentialFile file) |
ByteBuffer |
allocateDirectBuffer(int size)
used for cases where you need direct buffer outside of the journal context.
|
int |
calculateBlockSize(int bytes) |
void |
clearBuffer(ByteBuffer buffer) |
void |
createDirs()
Create the directory if it doesn't exist yet
|
SequentialFile |
createSequentialFile(String fileName,
int maxIO) |
void |
deactivateBuffer() |
void |
flush() |
int |
getAlignment() |
String |
getDirectory() |
boolean |
isSupportsCallbacks() |
List<String> |
listFiles(String extension)
Lists files that end with the given extension.
|
ByteBuffer |
newBuffer(int size)
Note: You need to release the buffer if is used for reading operations.
|
void |
onIOError(Exception exception,
String message,
SequentialFile file)
The SequentialFile will call this method when a disk IO Error happens during the live phase.
|
void |
releaseBuffer(ByteBuffer buffer) |
void |
releaseDirectBuffer(ByteBuffer buffer)
used for cases where you need direct buffer outside of the journal context.
|
void |
start() |
void |
stop() |
ByteBuffer |
wrapBuffer(byte[] bytes) |
protected static final int EXECUTOR_TIMEOUT
protected final String journalDir
protected final TimedBuffer timedBuffer
protected final int bufferSize
protected final long bufferTimeout
protected ExecutorService writeExecutor
public NIOSequentialFileFactory(String journalDir)
public NIOSequentialFileFactory(String journalDir, IOCriticalErrorListener listener)
public NIOSequentialFileFactory(String journalDir, boolean buffered)
public NIOSequentialFileFactory(String journalDir, boolean buffered, IOCriticalErrorListener listener)
public NIOSequentialFileFactory(String journalDir, boolean buffered, int bufferSize, int bufferTimeout, boolean logRates)
public NIOSequentialFileFactory(String journalDir, boolean buffered, int bufferSize, int bufferTimeout, boolean logRates, IOCriticalErrorListener listener)
public SequentialFile createSequentialFile(String fileName, int maxIO)
public boolean isSupportsCallbacks()
public ByteBuffer allocateDirectBuffer(int size)
SequentialFileFactory
public void releaseDirectBuffer(ByteBuffer buffer)
SequentialFileFactory
public ByteBuffer newBuffer(int size)
SequentialFileFactory
public void clearBuffer(ByteBuffer buffer)
public ByteBuffer wrapBuffer(byte[] bytes)
public int getAlignment()
public int calculateBlockSize(int bytes)
public void stop()
stop
in interface SequentialFileFactory
public String getDirectory()
getDirectory
in interface SequentialFileFactory
public void start()
start
in interface SequentialFileFactory
public void onIOError(Exception exception, String message, SequentialFile file)
SequentialFileFactory
onIOError
in interface SequentialFileFactory
public void activateBuffer(SequentialFile file)
activateBuffer
in interface SequentialFileFactory
public void flush()
flush
in interface SequentialFileFactory
public void deactivateBuffer()
deactivateBuffer
in interface SequentialFileFactory
public void releaseBuffer(ByteBuffer buffer)
releaseBuffer
in interface SequentialFileFactory
public void createDirs() throws Exception
createDirs
in interface SequentialFileFactory
Exception
public List<String> listFiles(String extension) throws Exception
SequentialFileFactory
This method inserts a ".' before the extension.
listFiles
in interface SequentialFileFactory
Exception
Copyright © 2016 JBoss, a division of Red Hat. All Rights Reserved.