Package org.rrd4j.core
Interface DataHolder
-
- All Known Implementing Classes:
DataProcessor
,RrdGraphDef
public interface DataHolder
- Since:
- 3;7
- Author:
- Fabrice Bacchella
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_POOL_USAGE_POLICY
Constant that defines the defaultRrdDbPool
usage policy.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
datasource(String name, String rpnExpression)
Create a new virtual datasource by evaluating a mathematical expression, specified in Reverse Polish Notation (RPN).void
datasource(String name, String rrdPath, String dsName, ConsolFun consolFun)
Defines virtual datasource.void
datasource(String name, String rrdPath, String dsName, ConsolFun consolFun, RrdBackendFactory backend)
Defines virtual datasource.void
datasource(String name, String dsName, FetchData fetchData)
Creates a new 'fetched' datasource.void
datasource(String name, String defName, Variable var)
Creates a datasource that performs a variable calculation on an another named datasource to yield a single combined timestamp/value.void
datasource(String name, URI rrdUri, String dsName, ConsolFun consolFun)
Defines virtual datasource.void
datasource(String name, URI rrdUri, String dsName, ConsolFun consolFun, RrdBackendFactory backend)
Defines virtual datasource.void
datasource(String name, FetchData fetchData)
Creates a new 'fetched' datasource.void
datasource(String name, IPlottable plottable)
Creates a new (plottable) datasource.long
getEndTime()
Returns ending timestamp.RrdDbPool
getPool()
long
getStartTime()
Returns starting timestamp.long
getStep()
Returns the time step used for timestamp interval.TimeZone
getTimeZone()
boolean
isPoolUsed()
Returns boolean value representingRrdDbPool
usage policy.void
setEndTime(long time)
Sets the time when the graph should end.void
setPool(RrdDbPool pool)
Defines theRrdDbPool
to use.void
setPoolUsed(boolean poolUsed)
Sets theRrdDbPool
usage policy.void
setStartTime(long time)
Sets the time when the graph should start.void
setStep(long step)
Set the step for timestamp interval.void
setTimeSpan(long startTime, long endTime)
Sets starting and ending time for the for the graph.void
setTimeZone(TimeZone tz)
Set the time zone used for the legend.
-
-
-
Field Detail
-
DEFAULT_POOL_USAGE_POLICY
static final boolean DEFAULT_POOL_USAGE_POLICY
Constant that defines the defaultRrdDbPool
usage policy. Defaults tofalse
(i.e. the pool will not be used to fetch data from RRD files)- See Also:
- Constant Field Values
-
-
Method Detail
-
isPoolUsed
boolean isPoolUsed()
Returns boolean value representingRrdDbPool
usage policy.- Returns:
- true, if the pool will be used internally to fetch data from RRD files, false otherwise.
-
setPoolUsed
void setPoolUsed(boolean poolUsed)
Sets theRrdDbPool
usage policy.- Parameters:
poolUsed
- true, if the pool will be used to fetch data from RRD files, false otherwise.
-
getPool
RrdDbPool getPool()
-
setPool
void setPool(RrdDbPool pool)
Defines theRrdDbPool
to use. If not defined, but {setPoolUsed(boolean)
set to true, the defaultRrdDbPool.getInstance()
will be used.- Parameters:
pool
- an optional pool to use.
-
setTimeZone
void setTimeZone(TimeZone tz)
Set the time zone used for the legend.- Parameters:
tz
- the time zone to set
-
getTimeZone
TimeZone getTimeZone()
-
setEndTime
void setEndTime(long time)
Sets the time when the graph should end. Time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time.- Parameters:
time
- Ending time for the graph in seconds since epoch
-
getEndTime
long getEndTime()
Returns ending timestamp.- Returns:
- Ending timestamp in seconds
-
setStartTime
void setStartTime(long time)
Sets the time when the graph should start. Time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time.- Parameters:
time
- Starting time for the graph in seconds since epoch
-
getStartTime
long getStartTime()
Returns starting timestamp.- Returns:
- Starting timestamp in seconds
-
setTimeSpan
void setTimeSpan(long startTime, long endTime)
Sets starting and ending time for the for the graph. Timestamps in seconds since epoch are required. Negative numbers are relative to the current time.- Parameters:
startTime
- Starting time in seconds since epochendTime
- Ending time in seconds since epoch
-
setStep
void setStep(long step)
Set the step for timestamp interval.
-
getStep
long getStep()
Returns the time step used for timestamp interval.- Returns:
- Step used for data processing.
-
datasource
void datasource(String name, String rrdPath, String dsName, ConsolFun consolFun)
Defines virtual datasource. This datasource can then be used in other methods likedatasource(String, String)
.- Parameters:
name
- Source namerrdPath
- Path to RRD filedsName
- Datasource name in the specified RRD fileconsolFun
- Consolidation function (AVERAGE, MIN, MAX, LAST)
-
datasource
void datasource(String name, URI rrdUri, String dsName, ConsolFun consolFun)
Defines virtual datasource. This datasource can then be used in other methods likedatasource(String, String)
.- Parameters:
name
- Source namerrdUri
- rrdUri to RRD filedsName
- Datasource name in the specified RRD fileconsolFun
- Consolidation function (AVERAGE, MIN, MAX, LAST)
-
datasource
void datasource(String name, String rrdPath, String dsName, ConsolFun consolFun, RrdBackendFactory backend)
Defines virtual datasource. This datasource can then be used in other methods likedatasource(String, String)
.- Parameters:
name
- Source namerrdPath
- Path to RRD filedsName
- Datasource name in the specified RRD fileconsolFun
- Consolidation function (AVERAGE, MIN, MAX, LAST)backend
- Backend to be used while fetching data from a RRD file.
-
datasource
void datasource(String name, URI rrdUri, String dsName, ConsolFun consolFun, RrdBackendFactory backend)
Defines virtual datasource. This datasource can then be used in other methods likedatasource(String, String)
.- Parameters:
name
- Source namerrdUri
- URI to RRD filedsName
- Datasource name in the specified RRD fileconsolFun
- Consolidation function (AVERAGE, MIN, MAX, LAST)backend
- Backend to be used while fetching data from a RRD file.
-
datasource
void datasource(String name, String rpnExpression)
Create a new virtual datasource by evaluating a mathematical expression, specified in Reverse Polish Notation (RPN).- Parameters:
name
- Source namerpnExpression
- RPN expression.
-
datasource
void datasource(String name, String defName, Variable var)
Creates a datasource that performs a variable calculation on an another named datasource to yield a single combined timestamp/value. Requires that the other datasource has already been defined; otherwise, it'll end up with no data- Parameters:
name
- - the new virtual datasource namedefName
- - the datasource from which to extract the percentile. Must be a previously defined virtual datasourcevar
- - a new instance of a Variable used to do the calculation
-
datasource
void datasource(String name, IPlottable plottable)
Creates a new (plottable) datasource. Datasource values are obtained from the given plottable object.- Parameters:
name
- Source name.plottable
- IPlottable object.
-
datasource
void datasource(String name, FetchData fetchData)
Creates a new 'fetched' datasource. Datasource values are obtained from the givenFetchData
object.- Parameters:
name
- Source name.fetchData
- FetchData object.
-
datasource
void datasource(String name, String dsName, FetchData fetchData)
Creates a new 'fetched' datasource. Datasource values are obtained from the givenFetchData
object. Values will be extracted from the datasource dsName in the fetchData- Parameters:
name
- Source name.dsName
- Source name in fetchData.fetchData
- FetchData object.
-
-