java.lang.Object
org.rrd4j.core.jrrd.DataSource
Instances of this class model a data source in an RRD file.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static enumThe jrrd parameter index of each data source field.Field Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleLargest valid value, NaN if there is none.private final doubleSmallest valid value, NaN if there is none.private final intLongest allowed interval between updates.private final StringThe name of the data source.private final longOffset of this data source in the buffer.private PDPStatusBlockStatus block of the current primary data point, initialized during database construction.private final longSize of this data source in the buffer.private final DataSourceTypeThe type of the data source.Constructor Summary
ConstructorsConstructorDescriptionDataSource(RRDFile file) Reads one datasource record from the RRD header: the fixed-width name, the type string, and the ten-value parameter block carrying the minimum heartbeat and the value bounds.Method Summary
Public MethodsModifier and TypeMethodDescriptiondoubleReturns the maximum value input to this data source can have.doubleReturns the minimum value input to this data source can have.intReturns the minimum required heartbeat for this data source.getName()Returns the name of this data source.Returns the primary data point status block for this data source.getType()Returns the type this data source is.(package private) voidloadPDPStatusBlock(RRDFile file) Load PDP status block(package private) voidprintInfo(PrintStream s, NumberFormat numberFormat) Print infotoString()Returns a summary the contents of this data source.(package private) voidtoXml(PrintStream s) Output XML
Field Details
offset
private final long offsetOffset of this data source in the buffer.size
private final long sizeSize of this data source in the buffer.name
The name of the data source.type
The type of the data source.minimumHeartbeat
private final int minimumHeartbeatLongest allowed interval between updates.minimum
private final double minimumSmallest valid value, NaN if there is none.maximum
private final double maximumLargest valid value, NaN if there is none.pdpStatusBlock
Status block of the current primary data point, initialized during database construction.
Constructor Details
DataSource
DataSource(RRDFile file) Reads one datasource record from the RRD header: the fixed-width name, the type string, and the ten-value parameter block carrying the minimum heartbeat and the value bounds. The record's byte length is retained so the file pointer can be stepped over it afterwards.- Parameters:
file- the RRD file positioned at the start of a datasource record
Method Details
loadPDPStatusBlock
Load PDP status block- Parameters:
file- the RRD file to read the primary data point status block from
getPDPStatusBlock
Returns the primary data point status block for this data source.- Returns:
- the primary data point status block for this data source.
getMinimumHeartbeat
public int getMinimumHeartbeat()Returns the minimum required heartbeat for this data source.- Returns:
- the minimum required heartbeat for this data source.
getMinimum
public double getMinimum()Returns the minimum value input to this data source can have.- Returns:
- the minimum value input to this data source can have.
getType
Returns the type this data source is.- Returns:
- the type this data source is.
- See Also:
getMaximum
public double getMaximum()Returns the maximum value input to this data source can have.- Returns:
- the maximum value input to this data source can have.
getName
printInfo
Print info- Parameters:
s- the stream the ds[...] properties are written tonumberFormat- the formatter used for the min and max values
toXml
Output XML- Parameters:
s- the stream the XML form of this data source is written to
toString