public class JDBCSequentialFile extends Object implements SequentialFile
| Constructor and Description |
|---|
JDBCSequentialFile(JDBCSequentialFileFactory fileFactory,
String filename,
Executor executor,
JDBCSequentialFileFactoryDriver driver,
Object writeLock) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMetaData(Object key,
Object value) |
int |
calculateBlockStart(int position) |
SequentialFile |
cloneFile() |
void |
close() |
void |
copyTo(SequentialFile cloneFile) |
void |
delete() |
boolean |
exists() |
void |
fill(int size) |
boolean |
fits(int size) |
int |
getAlignment() |
String |
getExtension() |
String |
getFilename() |
String |
getFileName() |
int |
getId() |
File |
getJavaFile()
Returns a native File of the file underlying this sequential file.
|
Object |
getMetaData(Object key) |
int |
internalWrite(ActiveMQBuffer buffer,
IOCallback callback) |
boolean |
isOpen() |
void |
open() |
void |
open(int maxIO,
boolean useExecutor)
The maximum number of simultaneous writes accepted
|
long |
position() |
void |
position(long pos) |
int |
read(ByteBuffer bytes) |
int |
read(ByteBuffer bytes,
IOCallback callback) |
Object |
removeMetaData(Object key) |
void |
renameTo(String newFileName) |
void |
scheduleWrite(ActiveMQBuffer bytes,
IOCallback callback) |
void |
scheduleWrite(ByteBuffer bytes,
IOCallback callback) |
void |
setId(int id) |
void |
setTimedBuffer(TimedBuffer buffer) |
void |
setWritePosition(int writePosition) |
long |
size() |
void |
sync() |
void |
write(ActiveMQBuffer bytes,
boolean sync) |
void |
write(ActiveMQBuffer bytes,
boolean sync,
IOCallback callback) |
void |
write(EncodingSupport bytes,
boolean sync) |
void |
write(EncodingSupport bytes,
boolean sync,
IOCallback callback) |
void |
writeDirect(ByteBuffer bytes,
boolean sync)
Write directly to the file without using intermediate any buffer
|
void |
writeDirect(ByteBuffer bytes,
boolean sync,
IOCallback callback)
Write directly to the file without using any buffer
|
public JDBCSequentialFile(JDBCSequentialFileFactory fileFactory, String filename, Executor executor, JDBCSequentialFileFactoryDriver driver, Object writeLock) throws SQLException
SQLExceptionpublic void setWritePosition(int writePosition)
public boolean isOpen()
isOpen in interface SequentialFilepublic boolean exists()
exists in interface SequentialFilepublic void open()
throws Exception
open in interface SequentialFileExceptionpublic void open(int maxIO,
boolean useExecutor)
throws Exception
SequentialFileopen in interface SequentialFileExceptionpublic boolean fits(int size)
fits in interface SequentialFilepublic int getAlignment()
throws Exception
getAlignment in interface SequentialFileExceptionpublic int calculateBlockStart(int position)
throws Exception
calculateBlockStart in interface SequentialFileExceptionpublic String getFileName()
getFileName in interface SequentialFilepublic void fill(int size)
throws Exception
fill in interface SequentialFileExceptionpublic void delete()
throws IOException,
InterruptedException,
ActiveMQException
delete in interface SequentialFileIOExceptionInterruptedExceptionActiveMQExceptionpublic int internalWrite(ActiveMQBuffer buffer, IOCallback callback)
public void scheduleWrite(ActiveMQBuffer bytes, IOCallback callback)
public void scheduleWrite(ByteBuffer bytes, IOCallback callback)
public void write(ActiveMQBuffer bytes, boolean sync, IOCallback callback) throws Exception
write in interface SequentialFileExceptionpublic void write(ActiveMQBuffer bytes, boolean sync) throws Exception
write in interface SequentialFileExceptionpublic void write(EncodingSupport bytes, boolean sync, IOCallback callback) throws Exception
write in interface SequentialFileExceptionpublic void write(EncodingSupport bytes, boolean sync) throws Exception
write in interface SequentialFileExceptionpublic void writeDirect(ByteBuffer bytes, boolean sync, IOCallback callback)
SequentialFilewriteDirect in interface SequentialFilebytes - the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
NIO). To be safe, use a buffer from the corresponding
SequentialFileFactory.newBuffer(int).public void writeDirect(ByteBuffer bytes, boolean sync) throws Exception
SequentialFilewriteDirect in interface SequentialFilebytes - the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
NIO). To be safe, use a buffer from the corresponding
SequentialFileFactory.newBuffer(int).Exceptionpublic int read(ByteBuffer bytes, IOCallback callback) throws SQLException
read in interface SequentialFilebytes - the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
NIO). To be safe, use a buffer from the corresponding
SequentialFileFactory.newBuffer(int).SQLExceptionpublic int read(ByteBuffer bytes) throws Exception
read in interface SequentialFilebytes - the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
NIO). To be safe, use a buffer from the corresponding
SequentialFileFactory.newBuffer(int).Exceptionpublic void position(long pos)
throws IOException
position in interface SequentialFileIOExceptionpublic long position()
position in interface SequentialFilepublic void close()
throws Exception
close in interface SequentialFileExceptionpublic void sync()
throws IOException
sync in interface SequentialFileIOExceptionpublic long size()
throws Exception
size in interface SequentialFileExceptionpublic void renameTo(String newFileName) throws Exception
renameTo in interface SequentialFileExceptionpublic SequentialFile cloneFile()
cloneFile in interface SequentialFilepublic void copyTo(SequentialFile cloneFile) throws Exception
copyTo in interface SequentialFileExceptionpublic int getId()
public void setId(int id)
public String getFilename()
public String getExtension()
public void setTimedBuffer(TimedBuffer buffer)
setTimedBuffer in interface SequentialFilepublic File getJavaFile()
SequentialFilegetJavaFile in interface SequentialFileCopyright © 2024 The Apache Software Foundation. All rights reserved.