public abstract class AbstractSequentialFileFactory extends Object implements SequentialFileFactory
| Modifier and Type | Field and Description |
|---|---|
protected int |
alignment |
protected int |
bufferSize |
protected long |
bufferTimeout |
protected boolean |
dataSync |
protected static int |
EXECUTOR_TIMEOUT |
protected File |
journalDir |
protected int |
maxIO |
protected TimedBuffer |
timedBuffer |
protected ExecutorService |
writeExecutor
Asynchronous writes need to be done at another executor.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSequentialFileFactory(File journalDir,
boolean buffered,
int bufferSize,
int bufferTimeout,
int maxIO,
boolean logRates,
IOCriticalErrorListener criticalErrorListener) |
| Modifier and Type | Method and Description |
|---|---|
void |
activateBuffer(SequentialFile file) |
void |
createDirs()
Create the directory if it doesn't exist yet
|
void |
deactivateBuffer() |
void |
flush() |
int |
getAlignment() |
File |
getDirectory() |
int |
getMaxIO() |
boolean |
isDatasync() |
List<String> |
listFiles(String extension)
Lists files that end with the given extension.
|
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) |
AbstractSequentialFileFactory |
setAlignment(int alignment) |
SequentialFileFactory |
setDatasync(boolean enabled) |
void |
start() |
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitallocateDirectBuffer, calculateBlockSize, clearBuffer, createSequentialFile, isSupportsCallbacks, newBuffer, releaseDirectBuffer, wrapBufferprotected static final int EXECUTOR_TIMEOUT
protected final File journalDir
protected final TimedBuffer timedBuffer
protected final int bufferSize
protected final long bufferTimeout
protected final int maxIO
protected boolean dataSync
protected volatile int alignment
protected ExecutorService writeExecutor
protected AbstractSequentialFileFactory(File journalDir, boolean buffered, int bufferSize, int bufferTimeout, int maxIO, boolean logRates, IOCriticalErrorListener criticalErrorListener)
public int getAlignment()
getAlignment in interface SequentialFileFactorypublic AbstractSequentialFileFactory setAlignment(int alignment)
setAlignment in interface SequentialFileFactorypublic SequentialFileFactory setDatasync(boolean enabled)
setDatasync in interface SequentialFileFactorypublic boolean isDatasync()
isDatasync in interface SequentialFileFactorypublic void stop()
stop in interface SequentialFileFactorypublic File getDirectory()
getDirectory in interface SequentialFileFactorypublic void start()
start in interface SequentialFileFactorypublic int getMaxIO()
getMaxIO 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 releaseBuffer(ByteBuffer buffer)
releaseBuffer 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 © 2018 JBoss by Red Hat. All rights reserved.