public class

RrdDbPoolOld

extends RrdDbPool
java.lang.Object
   ↳ org.rrd4j.core.RrdDbPool
     ↳ org.rrd4j.core.RrdDbPoolOld

Class Overview

This class should be used to synchronize access to RRD files in a multithreaded environment. This class should be also used to prevent opening of too many RRD files at the same time (thus avoiding operating system limits).

Summary

[Expand]
Inherited Constants
From class org.rrd4j.core.RrdDbPool
Public Methods
synchronized int getCapacity()
Returns the maximum number of simultaneously open RRD files.
synchronized int getOpenCount(RrdDb rrdDb)
Returns the number of usage for a RRD.
int getOpenCount(String path)
Returns the number of usage for a RRD.
synchronized int getOpenFileCount()
Returns the number of open RRD files.
synchronized String[] getOpenFiles()
Returns an array of open file names.
synchronized void release(RrdDb rrdDb)
Releases RrdDb reference previously obtained from the pool.
synchronized RrdDb requestRrdDb(String path)
Requests a RrdDb reference for the given RRD file path.
synchronized RrdDb requestRrdDb(String path, String sourcePath)
Requests a RrdDb reference for the given path.
synchronized RrdDb requestRrdDb(RrdDef rrdDef)
Requests a RrdDb reference for the given RRD file definition object.
synchronized void setCapacity(int capacity)
Sets the maximum number of simultaneously open RRD files.
[Expand]
Inherited Methods
From class org.rrd4j.core.RrdDbPool
From class java.lang.Object

Public Methods

public synchronized int getCapacity ()

Returns the maximum number of simultaneously open RRD files.

Returns
  • maximum number of simultaneously open RRD files

public synchronized int getOpenCount (RrdDb rrdDb)

Returns the number of usage for a RRD.

Parameters
rrdDb RrdDb reference for which informations is needed.
Returns
  • the number of request for this rrd
Throws
IOException

public int getOpenCount (String path)

Returns the number of usage for a RRD.

Parameters
path RRD file for which informations is needed.
Returns
  • the number of request for this file
Throws
IOException

public synchronized int getOpenFileCount ()

Returns the number of open RRD files.

Returns
  • Number of currently open RRD files held in the pool.

public synchronized String[] getOpenFiles ()

Returns an array of open file names.

Returns
  • Array with canonical paths to open RRD files held in the pool.

public synchronized void release (RrdDb rrdDb)

Releases RrdDb reference previously obtained from the pool. When a reference is released, its usage count is decremented by one. If usage count drops to zero, the underlying RRD file will be closed.

Parameters
rrdDb RrdDb reference to be returned to the pool
Throws
IOException

public synchronized RrdDb requestRrdDb (String path)

Requests a RrdDb reference for the given RRD file path.

  • If the file is already open, previously returned RrdDb reference will be returned. Its usage count will be incremented by one.
  • If the file is not already open and the number of already open RRD files is less than INITIAL_CAPACITY, the file will be open and a new RrdDb reference will be returned. If the file is not already open and the number of already open RRD files is equal to INITIAL_CAPACITY, the method blocks until some RRD file is closed.

Parameters
path Path to existing RRD file
Returns
  • reference for the give RRD file
Throws
IOException

public synchronized RrdDb requestRrdDb (String path, String sourcePath)

Requests a RrdDb reference for the given path. The file will be created from external data (from XML dump, RRD file or RRDTool's binary RRD file).

  • If the file with the path specified is already open, the method blocks until the file is closed.
  • If the file is not already open and the number of already open RRD files is less than INITIAL_CAPACITY, a new RRD file will be created and a its RrdDb reference will be returned. If the file is not already open and the number of already open RRD files is equal to INITIAL_CAPACITY, the method blocks until some RRD file is closed.

Parameters
path Path to RRD file which should be created
sourcePath Path to external data which is to be converted to Rrd4j's native RRD file format
Returns
  • Reference to the newly created RRD file
Throws
IOException

public synchronized RrdDb requestRrdDb (RrdDef rrdDef)

Requests a RrdDb reference for the given RRD file definition object.

  • If the file with the path specified in the RrdDef object is already open, the method blocks until the file is closed.
  • If the file is not already open and the number of already open RRD files is less than INITIAL_CAPACITY, a new RRD file will be created and a its RrdDb reference will be returned. If the file is not already open and the number of already open RRD files is equal to INITIAL_CAPACITY, the method blocks until some RRD file is closed.

Parameters
rrdDef Definition of the RRD file to be created
Returns
  • Reference to the newly created RRD file
Throws
IOException

public synchronized void setCapacity (int capacity)

Sets the maximum number of simultaneously open RRD files.

Parameters
capacity Maximum number of simultaneously open RRD files.