public final class MappedSequentialFileFactory extends Object implements SequentialFileFactory
| Constructor and Description |
|---|
MappedSequentialFileFactory(File directory) |
MappedSequentialFileFactory(File directory,
IOCriticalErrorListener criticalErrorListener) |
| 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) |
long |
chunkBytes() |
MappedSequentialFileFactory |
chunkBytes(long chunkBytes) |
void |
clearBuffer(ByteBuffer buffer) |
void |
createDirs()
Creates the directory if it does not exist yet.
|
SequentialFile |
createSequentialFile(String fileName) |
void |
deactivateBuffer() |
void |
flush() |
int |
getAlignment() |
File |
getDirectory() |
int |
getMaxIO() |
boolean |
isDatasync() |
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.
|
long |
overlapBytes() |
MappedSequentialFileFactory |
overlapBytes(long overlapBytes) |
void |
releaseBuffer(ByteBuffer buffer) |
void |
releaseDirectBuffer(ByteBuffer buffer)
used for cases where you need direct buffer outside of the journal context.
|
SequentialFileFactory |
setAlignment(int alignment) |
SequentialFileFactory |
setDatasync(boolean enabled) |
void |
start() |
void |
stop() |
ByteBuffer |
wrapBuffer(byte[] bytes) |
public MappedSequentialFileFactory(File directory, IOCriticalErrorListener criticalErrorListener)
public MappedSequentialFileFactory(File directory)
public long chunkBytes()
public MappedSequentialFileFactory chunkBytes(long chunkBytes)
public long overlapBytes()
public MappedSequentialFileFactory overlapBytes(long overlapBytes)
public SequentialFile createSequentialFile(String fileName)
createSequentialFile in interface SequentialFileFactorypublic SequentialFileFactory setDatasync(boolean enabled)
setDatasync in interface SequentialFileFactorypublic boolean isDatasync()
isDatasync in interface SequentialFileFactorypublic int getMaxIO()
getMaxIO in interface SequentialFileFactorypublic List<String> listFiles(String extension) throws Exception
SequentialFileFactoryThis method inserts a ".' before the extension.
listFiles in interface SequentialFileFactoryExceptionpublic boolean isSupportsCallbacks()
isSupportsCallbacks in interface SequentialFileFactorypublic void onIOError(Exception exception, String message, SequentialFile file)
SequentialFileFactoryonIOError in interface SequentialFileFactorypublic ByteBuffer allocateDirectBuffer(int size)
SequentialFileFactoryallocateDirectBuffer in interface SequentialFileFactorypublic void releaseDirectBuffer(ByteBuffer buffer)
SequentialFileFactoryreleaseDirectBuffer in interface SequentialFileFactorypublic ByteBuffer newBuffer(int size)
SequentialFileFactorynewBuffer in interface SequentialFileFactorypublic void releaseBuffer(ByteBuffer buffer)
releaseBuffer in interface SequentialFileFactorypublic void activateBuffer(SequentialFile file)
activateBuffer in interface SequentialFileFactorypublic void deactivateBuffer()
deactivateBuffer in interface SequentialFileFactorypublic ByteBuffer wrapBuffer(byte[] bytes)
wrapBuffer in interface SequentialFileFactorypublic int getAlignment()
getAlignment in interface SequentialFileFactorypublic SequentialFileFactory setAlignment(int alignment)
setAlignment in interface SequentialFileFactorypublic int calculateBlockSize(int bytes)
calculateBlockSize in interface SequentialFileFactorypublic File getDirectory()
getDirectory in interface SequentialFileFactorypublic void clearBuffer(ByteBuffer buffer)
clearBuffer in interface SequentialFileFactorypublic void start()
start in interface SequentialFileFactorypublic void stop()
stop in interface SequentialFileFactorypublic void createDirs()
throws Exception
SequentialFileFactorycreateDirs in interface SequentialFileFactoryExceptionpublic void flush()
flush in interface SequentialFileFactoryCopyright © 2018 JBoss by Red Hat. All rights reserved.