public abstract class AbstractSequentialFileFactory extends Object implements SequentialFileFactory
Modifier and Type | Field and Description |
---|---|
protected int |
bufferSize |
protected long |
bufferTimeout |
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() |
File |
getDirectory() |
int |
getMaxIO() |
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) |
void |
start() |
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allocateDirectBuffer, calculateBlockSize, clearBuffer, createSequentialFile, getAlignment, isSupportsCallbacks, newBuffer, releaseDirectBuffer, wrapBuffer
protected 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 ExecutorService writeExecutor
protected AbstractSequentialFileFactory(File journalDir, boolean buffered, int bufferSize, int bufferTimeout, int maxIO, boolean logRates, IOCriticalErrorListener criticalErrorListener)
public void stop()
stop
in interface SequentialFileFactory
public File getDirectory()
getDirectory
in interface SequentialFileFactory
public void start()
start
in interface SequentialFileFactory
public int getMaxIO()
getMaxIO
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 by Red Hat. All rights reserved.