Class Overview
Backend which is used to store RRD data to ordinary disk files
using java.nio.* package. This is the default backend engine.
Summary
Public Methods |
synchronized
void
|
close()
Closes the underlying RRD file.
|
Protected Methods |
synchronized
void
|
read(long offset, byte[] b)
Reads a number of bytes from the RRD file on the disk
|
synchronized
void
|
setLength(long newLength)
Sets length of the underlying RRD file.
|
synchronized
void
|
sync()
This method forces all data cached in memory but not yet stored in the file,
to be stored in it.
|
synchronized
void
|
write(long offset, byte[] b)
Writes bytes to the underlying RRD file on the disk
|
[Expand]
Inherited Methods |
From class
org.rrd4j.core.RrdFileBackend
void
|
close()
Closes the underlying RRD file.
|
static
String
|
getCanonicalPath(String path)
Returns canonical path to the file on the disk.
|
String
|
getCanonicalPath()
Returns canonical path to the file on the disk.
|
long
|
getLength()
Returns RRD file length.
|
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
|
|
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)
|
|
Protected Constructors
protected
RrdNioBackend
(String path, boolean readOnly, ScheduledExecutorService syncExecutor, int syncPeriod)
Creates RrdFileBackend object for the given file path, backed by java.nio.* classes.
Parameters
path
| Path to a file |
readOnly
| True, if file should be open in a read-only mode. False otherwise |
syncPeriod
| See setSyncPeriod(int) for explanation |
Public Methods
public
synchronized
void
close
()
Closes the underlying RRD file.
Protected Methods
protected
synchronized
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
synchronized
void
setLength
(long newLength)
Sets length of the underlying RRD file. This method is called only once, immediately
after a new RRD file gets created.
Parameters
newLength
| Length of the RRD file |
protected
synchronized
void
sync
()
This method forces all data cached in memory but not yet stored in the file,
to be stored in it.
protected
synchronized
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.
|