|
||||||||||
| 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 RandomAccessFile |
file
radnom access file handle |
protected boolean |
readOnly
read/write file status |
| Constructor Summary | |
|---|---|
protected |
RrdFileBackend(String path,
boolean readOnly)
Creates RrdFileBackend object for the given file path, backed by RandomAccessFile object. |
| Method Summary | |
|---|---|
void |
close()
Closes the underlying RRD file. |
String |
getCanonicalPath()
Returns canonical path to the file on the disk. |
static String |
getCanonicalPath(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 |
|---|
getPath, isCachingAllowed, readAll |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean readOnly
protected RandomAccessFile file
| Constructor Detail |
|---|
protected RrdFileBackend(String path,
boolean readOnly)
throws IOException
path - Path to a filereadOnly - True, if file should be open in a read-only mode. False otherwise
IOException - Thrown in case of I/O error| Method Detail |
|---|
public void close()
throws IOException
close in class RrdBackendIOException - Thrown in case of I/O error
public static String getCanonicalPath(String path)
throws IOException
path - File path
IOException - Thrown in case of I/O error
public String getCanonicalPath()
throws IOException
IOException - Thrown in case of I/O error
protected 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 error
protected 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 file
IOException - Thrown in case of I/O error.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||