Known Direct Subclasses
RrdNioBackend |
Backend which is used to store RRD data to ordinary disk files
using java.nio.* package. |
RrdSafeFileBackend |
Backend which is used to store RRD data to ordinary files on the disk, using locking. |
|
Class Overview
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).
Summary
Protected Constructors |
|
RrdFileBackend(String path, boolean readOnly)
Creates RrdFileBackend object for the given file path, backed by RandomAccessFile object.
|
Protected Methods |
void
|
read(long offset, byte[] b)
Reads a number of bytes from the RRD file on the disk
|
void
|
setLength(long length)
Sets length of the underlying RRD file.
|
void
|
write(long offset, byte[] b)
Writes bytes to the underlying RRD file on the disk
|
[Expand]
Inherited Methods |
From class
org.rrd4j.core.RrdBackend
void
|
close()
Closes the underlying backend.
|
abstract
long
|
getLength()
Returns the number of RRD bytes in the underlying storage.
|
String
|
getPath()
Returns path to the storage.
|
boolean
|
isCachingAllowed()
This method suggests the caching policy to the Rrd4j frontend (high-level) classes.
|
abstract
void
|
read(long offset, byte[] b)
Reads an array of bytes from the underlying storage starting from the given
storage offset.
|
final
byte[]
|
readAll()
Reads all RRD bytes from the underlying storage
|
abstract
void
|
setLength(long length)
Sets the number of bytes in the underlying RRD storage.
|
abstract
void
|
write(long offset, byte[] b)
Writes an array of bytes to the underlying storage starting from the given
storage offset.
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Fields
Random access file handle.
protected
final
boolean
readOnly
Protected Constructors
protected
RrdFileBackend
(String path, boolean readOnly)
Creates RrdFileBackend object for the given file path, backed by RandomAccessFile object.
Parameters
path
| Path to a file |
readOnly
| True, if file should be open in a read-only mode. False otherwise |
Public Methods
public
void
close
()
Closes the underlying RRD file.
public
static
String
getCanonicalPath
(String path)
Returns canonical path to the file on the disk.
public
String
getCanonicalPath
()
Returns canonical path to the file on the disk.
Protected Methods
protected
void
read
(long offset, byte[] b)
Reads a number of bytes from the RRD file on the disk
Parameters
offset
| Starting file offset |
b
| Buffer which receives bytes read from the file. |
protected
void
setLength
(long length)
Sets length of the underlying RRD file. This method is called only once, immediately
after a new RRD file gets created.
Parameters
length
| Length of the RRD file |
protected
void
write
(long offset, byte[] b)
Writes bytes to the underlying RRD file on the disk
Parameters
offset
| Starting file offset |
b
| Bytes to be written. |