|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jrobin.core.RrdBackend
org.jrobin.core.RrdFileBackend
public class RrdFileBackend
JRobin backend which is used to store RRD data to ordinary files on the disk. This was the default factory before 1.4.0 version
This backend is based on the RandomAccessFile class (java.io.* package).
Field Summary | |
---|---|
protected java.nio.channels.FileChannel |
channel
|
protected java.io.RandomAccessFile |
file
|
protected java.nio.channels.FileLock |
fileLock
|
Constructor Summary | |
---|---|
protected |
RrdFileBackend(java.lang.String path,
boolean readOnly,
int lockMode)
|
Method Summary | |
---|---|
void |
close()
Closes the underlying RRD file. |
protected void |
finalize()
Closes the underlying RRD file if not already closed |
java.lang.String |
getCanonicalPath()
Returns canonical path to the file on the disk. |
static java.lang.String |
getCanonicalPath(java.lang.String path)
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 |
Methods inherited from class org.jrobin.core.RrdBackend |
---|
afterCreate, afterFetch, afterUpdate, beforeFetch, beforeUpdate, getPath, readAll, sync |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.RandomAccessFile file
protected java.nio.channels.FileChannel channel
protected java.nio.channels.FileLock fileLock
Constructor Detail |
---|
protected RrdFileBackend(java.lang.String path, boolean readOnly, int lockMode) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void close() throws java.io.IOException
close
in class RrdBackend
java.io.IOException
- Thrown in case of I/O errorprotected void finalize() throws java.io.IOException
finalize
in class java.lang.Object
java.io.IOException
- Thrown in case of I/O errorpublic static java.lang.String getCanonicalPath(java.lang.String path) throws java.io.IOException
path
- File path
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
in class 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
in class 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
in class RrdBackend
java.io.IOException
- Thrown in case of I/O error.protected void setLength(long length) throws java.io.IOException
setLength
in class RrdBackend
length
- Length of the RRD file
java.io.IOException
- Thrown in case of I/O error.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |