public final class AIOSequentialFileFactory 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 |
---|
AIOSequentialFileFactory(String journalDir) |
AIOSequentialFileFactory(String journalDir,
int bufferSize,
int bufferTimeout,
boolean logRates) |
AIOSequentialFileFactory(String journalDir,
int bufferSize,
int bufferTimeout,
boolean logRates,
IOCriticalErrorListener listener) |
AIOSequentialFileFactory(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 position) |
void |
clearBuffer(ByteBuffer directByteBuffer) |
void |
createDirs()
Create the directory if it doesn't exist yet
|
SequentialFile |
createSequentialFile(String fileName,
int maxIO) |
void |
deactivateBuffer() |
protected void |
finalize() |
void |
flush() |
int |
getAlignment() |
String |
getDirectory() |
static boolean |
isSupported() |
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() |
String |
toString() |
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 AIOSequentialFileFactory(String journalDir)
public AIOSequentialFileFactory(String journalDir, IOCriticalErrorListener listener)
public AIOSequentialFileFactory(String journalDir, int bufferSize, int bufferTimeout, boolean logRates)
public AIOSequentialFileFactory(String journalDir, int bufferSize, int bufferTimeout, boolean logRates, IOCriticalErrorListener listener)
public SequentialFile createSequentialFile(String fileName, int maxIO)
public boolean isSupportsCallbacks()
public static boolean isSupported()
public ByteBuffer allocateDirectBuffer(int size)
SequentialFileFactory
public void releaseDirectBuffer(ByteBuffer buffer)
SequentialFileFactory
public ByteBuffer newBuffer(int size)
SequentialFileFactory
public void clearBuffer(ByteBuffer directByteBuffer)
public int getAlignment()
public ByteBuffer wrapBuffer(byte[] bytes)
public int calculateBlockSize(int position)
public void releaseBuffer(ByteBuffer buffer)
releaseBuffer
in interface SequentialFileFactory
public void start()
start
in interface SequentialFileFactory
public void stop()
stop
in interface SequentialFileFactory
public String getDirectory()
getDirectory
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 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 © 2013 JBoss by Red Hat. All Rights Reserved.