public class

RrdNioBackend

extends RrdFileBackend
java.lang.Object
   ↳ org.rrd4j.core.RrdBackend
     ↳ org.rrd4j.core.RrdFileBackend
       ↳ org.rrd4j.core.RrdNioBackend

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

[Expand]
Inherited Fields
From class org.rrd4j.core.RrdFileBackend
Protected Constructors
RrdNioBackend(String path, boolean readOnly, ScheduledExecutorService syncExecutor, int syncPeriod)
Creates RrdFileBackend object for the given file path, backed by java.nio.* classes.
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
From class org.rrd4j.core.RrdBackend
From class java.lang.Object

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
Throws
IOException Thrown in case of I/O error

Public Methods

public synchronized void close ()

Closes the underlying RRD file.

Throws
IOException Thrown in case of I/O error

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.
Throws
IOException

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
Throws
IOException Thrown in case of I/O error.

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.
Throws
IOException