public class JDBCSequentialFile extends Object implements SequentialFile
Modifier and Type | Method and Description |
---|---|
void |
addMetaData(Object key,
Object value) |
void |
blockingWriteDirect(ByteBuffer bytes,
boolean sync,
boolean releaseBuffer)
Write directly to the file without using any intermediate buffer and wait completion.
If releaseBuffer is true the provided bytes should be released
through SequentialFileFactory.releaseBuffer(ByteBuffer) , if supported. |
int |
calculateBlockStart(int position) |
SequentialFile |
cloneFile() |
void |
close() |
void |
close(boolean waitOnSync,
boolean block)
When closing a file from a finalize block, you cant wait on syncs or anything like that.
|
void |
copyTo(SequentialFile cloneFile) |
void |
delete() |
boolean |
exists() |
void |
fill(int size) |
boolean |
fits(int size) |
String |
getExtension() |
String |
getFilename() |
String |
getFileName() |
long |
getId() |
File |
getJavaFile()
Returns a native File of the file underlying this sequential file.
|
Object |
getMetaData(Object key) |
int |
internalWrite(ActiveMQBuffer buffer,
IOCallback callback) |
int |
internalWrite(ActiveMQBuffer buffer,
IOCallback callback,
boolean append) |
boolean |
isOpen() |
ByteBuffer |
map(int position,
long size) |
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) |
void |
renameTo(String newFileName) |
void |
setId(long id) |
void |
setTimedBuffer(TimedBuffer buffer) |
long |
size() |
void |
sync() |
void |
write(ActiveMQBuffer bytes,
boolean sync) |
void |
write(ActiveMQBuffer bytes,
boolean sync,
IOCallback callback) |
void |
write(ActiveMQBuffer bytes,
boolean sync,
IOCallback callback,
boolean append) |
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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterComplete, appendTo, isPending, waitNotPending
public boolean isOpen()
isOpen
in interface SequentialFile
public boolean exists()
exists
in interface SequentialFile
public void open() throws Exception
open
in interface SequentialFile
Exception
public void open(int maxIO, boolean useExecutor) throws Exception
SequentialFile
open
in interface SequentialFile
Exception
public boolean fits(int size)
fits
in interface SequentialFile
public int calculateBlockStart(int position) throws Exception
calculateBlockStart
in interface SequentialFile
Exception
public String getFileName()
getFileName
in interface SequentialFile
public void fill(int size) throws Exception
fill
in interface SequentialFile
Exception
public ByteBuffer map(int position, long size) throws IOException
map
in interface SequentialFile
IOException
public void delete() throws IOException, InterruptedException, ActiveMQException
delete
in interface SequentialFile
IOException
InterruptedException
ActiveMQException
public int internalWrite(ActiveMQBuffer buffer, IOCallback callback)
public int internalWrite(ActiveMQBuffer buffer, IOCallback callback, boolean append)
public void write(ActiveMQBuffer bytes, boolean sync, IOCallback callback, boolean append) throws Exception
Exception
public void write(ActiveMQBuffer bytes, boolean sync, IOCallback callback) throws Exception
write
in interface SequentialFile
Exception
public void write(ActiveMQBuffer bytes, boolean sync) throws Exception
write
in interface SequentialFile
Exception
public void write(EncodingSupport bytes, boolean sync, IOCallback callback) throws Exception
write
in interface SequentialFile
Exception
public void write(EncodingSupport bytes, boolean sync) throws Exception
write
in interface SequentialFile
Exception
public void writeDirect(ByteBuffer bytes, boolean sync, IOCallback callback)
SequentialFile
writeDirect
in interface SequentialFile
bytes
- 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 blockingWriteDirect(ByteBuffer bytes, boolean sync, boolean releaseBuffer)
SequentialFile
releaseBuffer
is true
the provided bytes
should be released
through SequentialFileFactory.releaseBuffer(ByteBuffer)
, if supported.blockingWriteDirect
in interface SequentialFile
bytes
- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
NIO). If releaseBuffer
is true
use a buffer from
SequentialFileFactory.newBuffer(int)
, SequentialFileFactory.allocateDirectBuffer(int)
otherwise.sync
- if true
will durable flush the written data on the file, false
otherwisereleaseBuffer
- if true
will release the buffer, false
otherwisepublic void writeDirect(ByteBuffer bytes, boolean sync) throws Exception
SequentialFile
writeDirect
in interface SequentialFile
bytes
- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
NIO). To be safe, use a buffer from the corresponding
SequentialFileFactory.newBuffer(int)
.Exception
public int read(ByteBuffer bytes, IOCallback callback) throws SQLException
read
in interface SequentialFile
bytes
- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
NIO). To be safe, use a buffer from the corresponding
SequentialFileFactory.newBuffer(int)
.SQLException
public int read(ByteBuffer bytes) throws Exception
read
in interface SequentialFile
bytes
- the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
NIO). To be safe, use a buffer from the corresponding
SequentialFileFactory.newBuffer(int)
.Exception
public void position(long pos) throws IOException
position
in interface SequentialFile
IOException
public long position()
position
in interface SequentialFile
public void close() throws Exception
close
in interface SequentialFile
Exception
public void close(boolean waitOnSync, boolean block) throws Exception
SequentialFile
close
in interface SequentialFile
Exception
public void sync() throws IOException
sync
in interface SequentialFile
IOException
public long size() throws Exception
size
in interface SequentialFile
Exception
public void renameTo(String newFileName) throws Exception
renameTo
in interface SequentialFile
Exception
public SequentialFile cloneFile()
cloneFile
in interface SequentialFile
public void copyTo(SequentialFile cloneFile) throws Exception
copyTo
in interface SequentialFile
Exception
public long getId()
public void setId(long id)
public String getFilename()
public String getExtension()
public void setTimedBuffer(TimedBuffer buffer)
setTimedBuffer
in interface SequentialFile
public File getJavaFile()
SequentialFile
getJavaFile
in interface SequentialFile
Copyright © 2021 JBoss by Red Hat. All rights reserved.