public class RrdJRobin14FileBackend extends RrdBackend
This backend is based on the RandomAccessFile class (java.io.* package).
| Modifier and Type | Class | Description |
|---|---|---|
static class |
RrdJRobin14FileBackend.LockMode |
| Modifier and Type | Field | Description |
|---|---|---|
protected RandomAccessFile |
m_file |
random access file handle
|
protected FileLock |
m_fileLock |
file lock
|
protected RrdJRobin14FileBackend.LockMode |
m_lockMode |
locking mode
|
| Modifier | Constructor | Description |
|---|---|---|
protected |
RrdJRobin14FileBackend(String path,
boolean readOnly,
RrdJRobin14FileBackend.LockMode lockMode) |
Creates RrdFileBackend object for the given file path, backed by RandomAccessFile object.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Closes the underlying RRD file.
|
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, waitgetPath, isCachingAllowed, isInstanceCreated, isReadOnly, readAll, readDouble, readDouble, readInt, readLong, readString, writeDouble, writeDouble, writeDouble, writeInt, writeLong, writeStringprotected RrdJRobin14FileBackend.LockMode m_lockMode
protected RandomAccessFile m_file
protected FileLock m_fileLock
protected RrdJRobin14FileBackend(String path, boolean readOnly, RrdJRobin14FileBackend.LockMode lockMode) throws 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.IOException - Thrown in case of I/O errorpublic void close()
throws IOException
close in class RrdBackendIOException - Thrown in case of I/O errorpublic String getCanonicalPath() throws IOException
IOException - Thrown in case of I/O errorprotected void write(long offset,
byte[] b)
throws IOException
write in class RrdBackendoffset - Starting file offsetb - Bytes to be written.IOException - Thrown in case of I/O errorprotected void read(long offset,
byte[] b)
throws IOException
read in class RrdBackendoffset - Starting file offsetb - Buffer which receives bytes read from the file.IOException - Thrown in case of I/O error.public long getLength()
throws IOException
getLength in class RrdBackendIOException - Thrown in case of I/O error.protected void setLength(long length)
throws IOException
setLength in class RrdBackendlength - Length of the RRD fileIOException - Thrown in case of I/O error.