public class RrdDbPool
extends java.lang.Object
修飾子とタイプ | フィールド | 説明 |
---|---|---|
static int |
INITIAL_CAPACITY |
Initial capacity of the pool i.e.
|
修飾子とタイプ | メソッド | 説明 |
---|---|---|
int |
getCapacity() |
Returns the maximum number of simultaneously open RRD files.
|
static RrdDbPool |
getInstance() |
Creates a single instance of the class on the first call, or returns already existing one.
|
int |
getOpenFileCount() |
Returns the number of open RRD files.
|
java.lang.String[] |
getOpenFiles() |
Returns an array of open file names.
|
void |
release(RrdDb rrdDb) |
Releases RrdDb reference previously obtained from the pool.
|
RrdDb |
requestRrdDb(java.lang.String path) |
Requests a RrdDb reference for the given RRD file path.
|
RrdDb |
requestRrdDb(java.lang.String path,
java.lang.String sourcePath) |
Requests a RrdDb reference for the given path.
|
RrdDb |
requestRrdDb(RrdDef rrdDef) |
Requests a RrdDb reference for the given RRD file definition object.
|
void |
setCapacity(int capacity) |
Sets the maximum number of simultaneously open RRD files.
|
public static final int INITIAL_CAPACITY
public static RrdDbPool getInstance() throws RrdException
RrdException
- Thrown if the default RRD backend is not derived from the RrdFileBackendFactory
public RrdDb requestRrdDb(java.lang.String path) throws java.io.IOException, RrdException
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.
path
- Path to existing RRD filejava.io.IOException
- Thrown in case of I/O errorRrdException
- Thrown in case of JRobin specific errorpublic RrdDb requestRrdDb(RrdDef rrdDef) throws java.io.IOException, RrdException
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.
rrdDef
- Definition of the RRD file to be createdjava.io.IOException
- Thrown in case of I/O errorRrdException
- Thrown in case of JRobin specific errorpublic RrdDb requestRrdDb(java.lang.String path, java.lang.String sourcePath) throws java.io.IOException, RrdException, RrdException
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.
path
- Path to RRD file which should be createdsourcePath
- Path to external data which is to be converted to JRobin's native RRD file formatjava.io.IOException
- Thrown in case of I/O errorRrdException
- Thrown in case of JRobin specific errorpublic void release(RrdDb rrdDb) throws java.io.IOException, RrdException
rrdDb
- RrdDb reference to be returned to the pooljava.io.IOException
- Thrown in case of I/O errorRrdException
- Thrown in case of JRobin specific errorpublic int getCapacity()
public void setCapacity(int capacity)
capacity
- Maximum number of simultaneously open RRD files.public java.lang.String[] getOpenFiles()
public int getOpenFileCount()