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)
SequentialFileFactorypublic void releaseDirectBuffer(ByteBuffer buffer)
SequentialFileFactorypublic ByteBuffer newBuffer(int size)
SequentialFileFactorypublic 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 SequentialFileFactorypublic void start()
start in interface SequentialFileFactorypublic void stop()
stop in interface SequentialFileFactorypublic String getDirectory()
getDirectory in interface SequentialFileFactorypublic void onIOError(Exception exception, String message, SequentialFile file)
SequentialFileFactoryonIOError in interface SequentialFileFactorypublic void activateBuffer(SequentialFile file)
activateBuffer in interface SequentialFileFactorypublic void flush()
flush in interface SequentialFileFactorypublic void deactivateBuffer()
deactivateBuffer in interface SequentialFileFactorypublic void createDirs()
throws Exception
createDirs in interface SequentialFileFactoryExceptionpublic List<String> listFiles(String extension) throws Exception
SequentialFileFactoryThis method inserts a ".' before the extension.
listFiles in interface SequentialFileFactoryExceptionCopyright © 2013 JBoss, a division of Red Hat. All rights reserved.