public class RrdJRobin14FileBackend extends RrdBackend
This backend is based on the RandomAccessFile class (java.io.* package).
修飾子とタイプ | クラス | 説明 |
---|---|---|
static class |
RrdJRobin14FileBackend.LockMode |
修飾子とタイプ | フィールド | 説明 |
---|---|---|
protected java.io.RandomAccessFile |
m_file |
random access file handle
|
protected java.nio.channels.FileLock |
m_fileLock |
file lock
|
protected RrdJRobin14FileBackend.LockMode |
m_lockMode |
locking mode
|
修飾子 | コンストラクタ | 説明 |
---|---|---|
protected |
RrdJRobin14FileBackend(java.lang.String path,
boolean readOnly,
RrdJRobin14FileBackend.LockMode lockMode) |
Creates RrdFileBackend object for the given file path, backed by RandomAccessFile object.
|
修飾子とタイプ | メソッド | 説明 |
---|---|---|
void |
close() |
Closes the underlying RRD file.
|
java.lang.String |
getCanonicalPath() |
Returns canonical path to the file on the disk.
|
long |
getLength() |
Returns RRD file length.
|
protected void |
read(long offset,
byte[] b) |
Reads a number of bytes from the RRD file on the disk
|
protected void |
setLength(long length) |
Sets length of the underlying RRD file.
|
protected void |
write(long offset,
byte[] b) |
Writes bytes to the underlying RRD file on the disk
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPath, isCachingAllowed, isInstanceCreated, isReadOnly, readAll, readDouble, readDouble, readInt, readLong, readString, writeDouble, writeDouble, writeDouble, writeInt, writeLong, writeString
protected RrdJRobin14FileBackend.LockMode m_lockMode
protected java.io.RandomAccessFile m_file
protected java.nio.channels.FileLock m_fileLock
protected RrdJRobin14FileBackend(java.lang.String path, boolean readOnly, RrdJRobin14FileBackend.LockMode lockMode) throws java.io.IOException
path
- Path to a filereadOnly
- True, if file should be open in a read-only mode. False otherwiselockMode
- Locking mode: Exception if locked, Wait if locked, or no locks.java.io.IOException
- Thrown in case of I/O errorpublic void close() throws java.io.IOException
close
クラス内 RrdBackend
java.io.IOException
- Thrown in case of I/O errorpublic java.lang.String getCanonicalPath() throws java.io.IOException
java.io.IOException
- Thrown in case of I/O errorprotected void write(long offset, byte[] b) throws java.io.IOException
write
クラス内 RrdBackend
offset
- Starting file offsetb
- Bytes to be written.java.io.IOException
- Thrown in case of I/O errorprotected void read(long offset, byte[] b) throws java.io.IOException
read
クラス内 RrdBackend
offset
- Starting file offsetb
- Buffer which receives bytes read from the file.java.io.IOException
- Thrown in case of I/O error.public long getLength() throws java.io.IOException
getLength
クラス内 RrdBackend
java.io.IOException
- Thrown in case of I/O error.protected void setLength(long length) throws java.io.IOException
setLength
クラス内 RrdBackend
length
- Length of the RRD filejava.io.IOException
- Thrown in case of I/O error.