java.lang.Object | |
↳ | org.rrd4j.core.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)
IMPORTANT: NEVER use methods found in this class on 'live' RRD files (files which are currently in use).
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new RRD file with one more archive in it.
| |||||||||||
Adds one more archive to a RRD file. | |||||||||||
Creates a new RRD file with one more datasource in it.
| |||||||||||
Adds one more datasource to a RRD file. | |||||||||||
Updates single or all datasource names in the specified RRD file
by appending '!' (if not already present).
| |||||||||||
Returns list of canonical file names with the specified extension in the given directory.
| |||||||||||
Creates a new RRD file with one archive removed.
| |||||||||||
Removes one archive from a RRD file. | |||||||||||
Creates a new RRD file with one datasource removed.
| |||||||||||
Removes single datasource from a RRD file. | |||||||||||
Renames single datasource in the given RRD file.
| |||||||||||
Modifies existing RRD file, by resizing its chosen archive.
| |||||||||||
Creates new RRD file based on the existing one, but with a different
size (number of rows) for a single archive.
| |||||||||||
Sets single archive's X-files factor to a new value.
| |||||||||||
Sets datasource heartbeat to a new value.
| |||||||||||
Sets datasource heartbeat to a new value.
| |||||||||||
Sets datasource max value to a new value.
| |||||||||||
Updates valid value range for the given datasource.
| |||||||||||
Sets datasource min value to a new value
| |||||||||||
Splits single RRD file with several datasources into a number of smaller RRD files
with a single datasource in it.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Creates a new RRD file with one more archive in it. RRD file is created based on the existing one (the original RRD file is not modified at all). All data from the original RRD file is copied to the new one.
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 |
IOException | Thrown in case of I/O error |
---|
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 file |
saveBackup | true, if backup of the original file should be created; false, otherwise |
IOException | Thrown in case of I/O error |
---|
Creates a new RRD file with one more datasource in it. RRD file is created based on the existing one (the original RRD file is not modified at all). All data from the original RRD file is copied to the new one.
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 |
IOException | Thrown in case of I/O error |
---|
Adds one more datasource to a RRD file.
WARNING: This method is potentially 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 file |
saveBackup | true, if backup of the original file should be created; false, otherwise |
IOException | Thrown in case of I/O error |
---|
Updates single or all datasource names in the specified RRD file by appending '!' (if not already present). Datasources with names ending with '!' will never store NaNs in RRA archives (zero value will be used instead). Might be useful from time to time
sourcePath | Path to a RRD file |
---|---|
dsName | Datasource name or null if you want to rename all datasources |
IOException | Thrown in case of I/O error |
---|
Returns list of canonical file names with the specified extension in the given directory. This method is not RRD related, but might come handy to create a quick list of all RRD files in the given directory.
directory | Source directory |
---|---|
extension | File extension (like ".rrd", ".jrb", ".rrd.jrb") |
resursive | true if all subdirectories should be traversed for the same extension, false otherwise |
IOException | Thrown in case of I/O error |
---|
Creates a new RRD file with one archive removed. RRD file is created based on the existing one (the original RRD file is not modified at all). All relevant data from the original RRD file is copied to the new one.
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 removed |
steps | Number of steps for Archive which should be removed |
IOException | Thrown in case of I/O error |
---|
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 removed |
steps | Number of steps for Archive which should be removed |
saveBackup | true, if backup of the original file should be created; false, otherwise |
IOException | Thrown in case of I/O error |
---|
Creates a new RRD file with one datasource removed. RRD file is created based on the existing one (the original RRD file is not modified at all). All remaining data from the original RRD file is copied to the new one.
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 |
IOException | Thrown in case of I/O error |
---|
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 file |
saveBackup | true, if backup of the original file should be created; false, otherwise |
IOException | Thrown in case of I/O error |
---|
Renames single datasource in the given RRD file.
sourcePath | Path to a RRD file |
---|---|
oldDsName | Old datasource name |
newDsName | New datasource name |
IOException | Thrown in case of I/O error |
---|
Modifies existing RRD file, by resizing its chosen archive. The archive to be resized is identified by its consolidation function and the number of steps.
sourcePath | Path to the RRD file (will be modified) |
---|---|
consolFun | Consolidation function of the archive to be resized |
numSteps | Number of steps of the archive to be resized |
newRows | New archive size (number of archive rows) |
saveBackup | true, if backup of the original file should be created; false, otherwise |
IOException | Thrown in case of I/O error |
---|
Creates new RRD file based on the existing one, but with a different size (number of rows) for a single archive. The archive to be resized is identified by its consolidation function and the number of steps.
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 resized |
numSteps | Number of steps of the archive to be resized |
newRows | New archive size (number of archive rows) |
IOException | Thrown in case of I/O error |
---|
Sets single archive's X-files factor to a new value.
sourcePath | Path to existing RRD file (will be updated) |
---|---|
consolFun | Consolidation function of the target archive |
steps | Number of sptes of the target archive |
newXff | New X-files factor for the target archive |
IOException | Thrown in case of I/O error |
---|
Sets datasource heartbeat to a new value.
sourcePath | Path to exisiting RRD file (will be updated) |
---|---|
datasourceName | Name of the datasource in the specified RRD file |
newHeartbeat | New datasource heartbeat |
IOException | Thrown in case of I/O error |
---|
Sets datasource heartbeat to a new value.
sourcePath | Path to exisiting RRD file (will be updated) |
---|---|
dsIndex | Index of the datasource in the specified RRD file |
newHeartbeat | New datasource heartbeat |
IOException | Thrown in case of I/O error |
---|
Sets datasource max value to a new value.
sourcePath | Path to exisiting RRD file (will be updated) |
---|---|
datasourceName | Name of the datasource in the specified RRD file |
newMaxValue | New max value for the datasource |
filterArchivedValues | set to true if archived values greater than
newMaxValue should be set to NaN; set to false, otherwise. |
IOException | Thrown in case of I/O error |
---|
Updates valid value range for the given datasource.
sourcePath | Path to exisiting RRD file (will be updated) |
---|---|
datasourceName | Name of the datasource in the specified RRD file |
newMinValue | New min value for the datasource |
newMaxValue | New max value for the datasource |
filterArchivedValues | set to true if archived values outside
of the specified min/max range should be replaced with NaNs. |
IOException | Thrown in case of I/O error |
---|
Sets datasource min value to a new value
sourcePath | Path to exisiting RRD file (will be updated) |
---|---|
datasourceName | Name of the datasource in the specified RRD file |
newMinValue | New min value for the datasource |
filterArchivedValues | set to true if archived values less than
newMinValue should be set to NaN; set to false, otherwise. |
IOException | Thrown in case of I/O error |
---|
Splits single RRD file with several datasources into a number of smaller RRD files with a single datasource in it. All archived values are preserved. If you have a RRD file named 'traffic.rrd' with two datasources, 'in' and 'out', this method will create two files (with a single datasource, in the same directory) named 'in-traffic.rrd' and 'out-traffic.rrd'.
sourcePath | Path to a RRD file with multiple datasources defined |
---|
IOException | Thrown in case of I/O error |
---|