public class JDBCSequentialFileFactory extends Object implements SequentialFileFactory, ActiveMQComponent
Constructor and Description |
---|
JDBCSequentialFileFactory(String connectionUrl,
String tableName,
String className,
Executor executor) |
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) |
void |
clearBuffer(ByteBuffer buffer) |
void |
createDirs()
Creates the directory if it does not exist yet.
|
SequentialFile |
createSequentialFile(String fileName) |
void |
deactivateBuffer() |
void |
destroy() |
void |
flush() |
int |
getAlignment() |
File |
getDirectory() |
int |
getMaxIO() |
boolean |
isStarted() |
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() |
ByteBuffer |
wrapBuffer(byte[] bytes) |
public void start()
start
in interface SequentialFileFactory
start
in interface ActiveMQComponent
public void stop()
stop
in interface SequentialFileFactory
stop
in interface ActiveMQComponent
public SequentialFile createSequentialFile(String fileName)
createSequentialFile
in interface SequentialFileFactory
public int getMaxIO()
getMaxIO
in interface SequentialFileFactory
public List<String> listFiles(String extension) throws Exception
SequentialFileFactory
This method inserts a ".' before the extension.
listFiles
in interface SequentialFileFactory
Exception
public boolean isSupportsCallbacks()
isSupportsCallbacks
in interface SequentialFileFactory
public void onIOError(Exception exception, String message, SequentialFile file)
SequentialFileFactory
onIOError
in interface SequentialFileFactory
public ByteBuffer allocateDirectBuffer(int size)
SequentialFileFactory
allocateDirectBuffer
in interface SequentialFileFactory
public void releaseDirectBuffer(ByteBuffer buffer)
SequentialFileFactory
releaseDirectBuffer
in interface SequentialFileFactory
public ByteBuffer newBuffer(int size)
SequentialFileFactory
newBuffer
in interface SequentialFileFactory
public void clearBuffer(ByteBuffer buffer)
clearBuffer
in interface SequentialFileFactory
public ByteBuffer wrapBuffer(byte[] bytes)
wrapBuffer
in interface SequentialFileFactory
public int getAlignment()
getAlignment
in interface SequentialFileFactory
public int calculateBlockSize(int bytes)
calculateBlockSize
in interface SequentialFileFactory
public void deactivateBuffer()
deactivateBuffer
in interface SequentialFileFactory
public void releaseBuffer(ByteBuffer buffer)
releaseBuffer
in interface SequentialFileFactory
public void activateBuffer(SequentialFile file)
activateBuffer
in interface SequentialFileFactory
public File getDirectory()
getDirectory
in interface SequentialFileFactory
public boolean isStarted()
isStarted
in interface ActiveMQComponent
public void createDirs() throws Exception
SequentialFileFactory
createDirs
in interface SequentialFileFactory
Exception
public void flush()
flush
in interface SequentialFileFactory
public void destroy() throws SQLException
SQLException
Copyright © 2016 The Apache Software Foundation. All rights reserved.