|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jrobin.core.RrdToolkit
public class RrdToolkit
Class used to perform various complex operations on RRD files. Use an instance of the RrdToolkit class to:
All these operations can be performed on the copy of the original RRD file, or on the original file itself (with possible backup file creation)
Method Summary | |
---|---|
void |
addArchive(java.lang.String sourcePath,
ArcDef newArchive,
boolean saveBackup)
Adds one more archive to a RRD file. |
void |
addArchive(java.lang.String sourcePath,
java.lang.String destPath,
ArcDef newArchive)
Creates a new RRD file with one more archive in it. |
void |
addDatasource(java.lang.String sourcePath,
DsDef newDatasource,
boolean saveBackup)
Adds one more datasource to a RRD file. |
void |
addDatasource(java.lang.String sourcePath,
java.lang.String destPath,
DsDef newDatasource)
Creates a new RRD file with one more datasource in it. |
static RrdToolkit |
getInstance()
Returns an instance of RrdToolkit. |
void |
removeArchive(java.lang.String sourcePath,
java.lang.String consolFun,
int steps,
boolean saveBackup)
Removes one archive from a RRD file. |
void |
removeArchive(java.lang.String sourcePath,
java.lang.String destPath,
java.lang.String consolFun,
int steps)
Creates a new RRD file with one archive removed. |
void |
removeDatasource(java.lang.String sourcePath,
java.lang.String dsName,
boolean saveBackup)
Removes single datasource from a RRD file. |
void |
removeDatasource(java.lang.String sourcePath,
java.lang.String destPath,
java.lang.String dsName)
Creates a new RRD file with one datasource removed. |
void |
resizeArchive(java.lang.String sourcePath,
java.lang.String consolFun,
int numSteps,
int newRows,
boolean saveBackup)
Modifies existing RRD file, by resizing its chosen archive. |
void |
resizeArchive(java.lang.String sourcePath,
java.lang.String destPath,
java.lang.String consolFun,
int numSteps,
int newRows)
Creates new RRD file based on the existing one, but with a different size (number of rows) for a single archive. |
void |
setArcXff(java.lang.String sourcePath,
java.lang.String consolFun,
int steps,
double newXff)
Sets single archive's X-files factor to a new value. |
void |
setDsHeartbeat(java.lang.String sourcePath,
java.lang.String datasourceName,
long newHeartbeat)
Sets datasource heartbeat to a new value. |
void |
setDsMaxValue(java.lang.String sourcePath,
java.lang.String datasourceName,
double newMaxValue,
boolean filterArchivedValues)
Sets datasource max value to a new value. |
void |
setDsMinMaxValue(java.lang.String sourcePath,
java.lang.String datasourceName,
double newMinValue,
double newMaxValue,
boolean filterArchivedValues)
Updates valid value range for the given datasource. |
void |
setDsMinValue(java.lang.String sourcePath,
java.lang.String datasourceName,
double newMinValue,
boolean filterArchivedValues)
Sets datasource min value to a new value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static RrdToolkit getInstance()
public void addDatasource(java.lang.String sourcePath, java.lang.String destPath, DsDef newDatasource) throws java.io.IOException, RrdException
sourcePath
- path to a RRD file to import data from (will not be modified)destPath
- path to a new RRD file (will be created)newDatasource
- Datasource definition to be added to the new RRD file
java.io.IOException
- Thrown in case of I/O error
RrdException
- Thrown in case of JRobin specific errorpublic void addDatasource(java.lang.String sourcePath, DsDef newDatasource, boolean saveBackup) throws java.io.IOException, RrdException
Adds one more datasource to a RRD file.
WARNING: This method is potentialy dangerous! It will modify your RRD file.
It is highly recommended to preserve the original RRD file (saveBackup
should be set to true
). The backup file will be created in the same
directory as the original one with .bak
extension added to the
original name.
Before applying this method, be sure that the specified RRD file is not in use (not open)
sourcePath
- path to a RRD file to add datasource to.newDatasource
- Datasource definition to be added to the RRD filesaveBackup
- true, if backup of the original file should be created;
false, otherwise
java.io.IOException
- Thrown in case of I/O error
RrdException
- Thrown in case of JRobin specific errorpublic void removeDatasource(java.lang.String sourcePath, java.lang.String destPath, java.lang.String dsName) throws java.io.IOException, RrdException
sourcePath
- path to a RRD file to import data from (will not be modified)destPath
- path to a new RRD file (will be created)dsName
- Name of the Datasource to be removed from the new RRD file
java.io.IOException
- Thrown in case of I/O error
RrdException
- Thrown in case of JRobin specific errorpublic void removeDatasource(java.lang.String sourcePath, java.lang.String dsName, boolean saveBackup) throws java.io.IOException, RrdException
Removes single datasource from a RRD file.
WARNING: This method is potentialy dangerous! It will modify your RRD file.
It is highly recommended to preserve the original RRD file (saveBackup
should be set to true
). The backup file will be created in the same
directory as the original one with .bak
extension added to the
original name.
Before applying this method, be sure that the specified RRD file is not in use (not open)
sourcePath
- path to a RRD file to remove datasource from.dsName
- Name of the Datasource to be removed from the RRD filesaveBackup
- true, if backup of the original file should be created;
false, otherwise
java.io.IOException
- Thrown in case of I/O error
RrdException
- Thrown in case of JRobin specific errorpublic void addArchive(java.lang.String sourcePath, java.lang.String destPath, ArcDef newArchive) throws java.io.IOException, RrdException
sourcePath
- path to a RRD file to import data from (will not be modified)destPath
- path to a new RRD file (will be created)newArchive
- Archive definition to be added to the new RRD file
java.io.IOException
- Thrown in case of I/O error
RrdException
- Thrown in case of JRobin specific errorpublic void addArchive(java.lang.String sourcePath, ArcDef newArchive, boolean saveBackup) throws java.io.IOException, RrdException
Adds one more archive to a RRD file.
WARNING: This method is potentialy dangerous! It will modify your RRD file.
It is highly recommended to preserve the original RRD file (saveBackup
should be set to true
). The backup file will be created in the same
directory as the original one with .bak
extension added to the
original name.
Before applying this method, be sure that the specified RRD file is not in use (not open)
sourcePath
- path to a RRD file to add datasource to.newArchive
- Archive definition to be added to the RRD filesaveBackup
- true, if backup of the original file should be created;
false, otherwise
java.io.IOException
- Thrown in case of I/O error
RrdException
- Thrown in case of JRobin specific errorpublic void removeArchive(java.lang.String sourcePath, java.lang.String destPath, java.lang.String consolFun, int steps) throws java.io.IOException, RrdException
sourcePath
- path to a RRD file to import data from (will not be modified)destPath
- path to a new RRD file (will be created)consolFun
- Consolidation function of Archive which should be removedsteps
- Number of steps for Archive which should be removed
java.io.IOException
- Thrown in case of I/O error
RrdException
- Thrown in case of JRobin specific errorpublic void removeArchive(java.lang.String sourcePath, java.lang.String consolFun, int steps, boolean saveBackup) throws java.io.IOException, RrdException
Removes one archive from a RRD file.
WARNING: This method is potentialy dangerous! It will modify your RRD file.
It is highly recommended to preserve the original RRD file (saveBackup
should be set to true
). The backup file will be created in the same
directory as the original one with .bak
extension added to the
original name.
Before applying this method, be sure that the specified RRD file is not in use (not open)
sourcePath
- path to a RRD file to add datasource to.consolFun
- Consolidation function of Archive which should be removedsteps
- Number of steps for Archive which should be removedsaveBackup
- true, if backup of the original file should be created;
false, otherwise
java.io.IOException
- Thrown in case of I/O error
RrdException
- Thrown in case of JRobin specific errorpublic void setDsHeartbeat(java.lang.String sourcePath, java.lang.String datasourceName, long newHeartbeat) throws RrdException, java.io.IOException
sourcePath
- Path to exisiting RRD file (will be updated)datasourceName
- Name of the datasource in the specified RRD filenewHeartbeat
- New datasource heartbeat
RrdException
- Thrown in case of JRobin specific error
java.io.IOException
- Thrown in case of I/O errorpublic void setDsMinValue(java.lang.String sourcePath, java.lang.String datasourceName, double newMinValue, boolean filterArchivedValues) throws RrdException, java.io.IOException
sourcePath
- Path to exisiting RRD file (will be updated)datasourceName
- Name of the datasource in the specified RRD filenewMinValue
- New min value for the datasourcefilterArchivedValues
- set to true
if archived values less than
newMinValue
should be set to NaN; set to false, otherwise.
RrdException
- Thrown in case of JRobin specific error
java.io.IOException
- Thrown in case of I/O errorpublic void setDsMaxValue(java.lang.String sourcePath, java.lang.String datasourceName, double newMaxValue, boolean filterArchivedValues) throws RrdException, java.io.IOException
sourcePath
- Path to exisiting RRD file (will be updated)datasourceName
- Name of the datasource in the specified RRD filenewMaxValue
- New max value for the datasourcefilterArchivedValues
- set to true
if archived values greater than
newMaxValue
should be set to NaN; set to false, otherwise.
RrdException
- Thrown in case of JRobin specific error
java.io.IOException
- Thrown in case of I/O errorpublic void setDsMinMaxValue(java.lang.String sourcePath, java.lang.String datasourceName, double newMinValue, double newMaxValue, boolean filterArchivedValues) throws RrdException, java.io.IOException
sourcePath
- Path to exisiting RRD file (will be updated)datasourceName
- Name of the datasource in the specified RRD filenewMinValue
- New min value for the datasourcenewMaxValue
- New max value for the datasourcefilterArchivedValues
- set to true
if archived values outside
of the specified min/max range should be replaced with NaNs.
RrdException
- Thrown in case of JRobin specific error
java.io.IOException
- Thrown in case of I/O errorpublic void setArcXff(java.lang.String sourcePath, java.lang.String consolFun, int steps, double newXff) throws RrdException, java.io.IOException
sourcePath
- Path to existing RRD file (will be updated)consolFun
- Consolidation function of the target archivesteps
- Number of sptes of the target archivenewXff
- New X-files factor for the target archive
RrdException
- Thrown in case of JRobin specific error
java.io.IOException
- Thrown in case of I/O errorpublic void resizeArchive(java.lang.String sourcePath, java.lang.String destPath, java.lang.String consolFun, int numSteps, int newRows) throws java.io.IOException, RrdException
sourcePath
- Path to the source RRD file (will not be modified)destPath
- Path to the new RRD file (will be created)consolFun
- Consolidation function of the archive to be resizednumSteps
- Number of steps of the archive to be resizednewRows
- New archive size (number of archive rows)
java.io.IOException
- Thrown in case of I/O error
RrdException
- Thrown in case of JRobin specific errorpublic void resizeArchive(java.lang.String sourcePath, java.lang.String consolFun, int numSteps, int newRows, boolean saveBackup) throws java.io.IOException, RrdException
sourcePath
- Path to the RRD file (will be modified)consolFun
- Consolidation function of the archive to be resizednumSteps
- Number of steps of the archive to be resizednewRows
- New archive size (number of archive rows)saveBackup
- true, if backup of the original file should be created;
false, otherwise
java.io.IOException
- Thrown in case of I/O error
RrdException
- Thrown in case of JRobin specific error
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |