|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rrd4j.core.RrdBackend org.rrd4j.core.RrdFileBackend org.rrd4j.core.RrdRandomAccessFileBackend
public class RrdRandomAccessFileBackend
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 |
rafile
Random access file handle. |
Fields inherited from class org.rrd4j.core.RrdFileBackend |
---|
file, readOnly |
Constructor Summary | |
---|---|
protected |
RrdRandomAccessFileBackend(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. |
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.rrd4j.core.RrdFileBackend |
---|
getCanonicalPath, getCanonicalPath, getLength |
Methods inherited from class org.rrd4j.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 final RandomAccessFile rafile
Constructor Detail |
---|
protected RrdRandomAccessFileBackend(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 errorMethod Detail |
---|
public void close() throws IOException
close
in class RrdFileBackend
IOException
- Thrown in case of I/O errorprotected void write(long offset, byte[] b) throws IOException
write
in class RrdBackend
offset
- 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 RrdBackend
offset
- Starting file offsetb
- Buffer which receives bytes read from the file.
IOException
- Thrown in case of I/O error.protected void setLength(long length) throws IOException
setLength
in class RrdBackend
length
- 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 |