Package org.opennms.netmgt.rrd.model
Class AbstractRRD
- java.lang.Object
-
- org.opennms.netmgt.rrd.model.AbstractRRD
-
-
Constructor Summary
Constructors Constructor Description AbstractRRD()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
addDataSource(AbstractDS ds)
Adds the data source.abstract void
addRRA(AbstractRRA rra)
Adds the RRA.protected abstract AbstractRRD
createRRD()
Creates the RRD.Row
findRowByTimestamp(AbstractRRA rra, java.lang.Long timestamp)
Gets the row that corresponds to a specific time stamp (expressed in seconds since 1970-01-01 UTC).java.lang.Long
findTimestampByRow(AbstractRRA rra, Row row)
Finds the row time stamp, expressed in seconds since 1970-01-01 UTC.boolean
formatEquals(AbstractRRD rrd)
Format equals.abstract AbstractDS
getDataSource(int index)
Gets the data source.abstract java.util.List<? extends AbstractDS>
getDataSources()
Gets the data sources.java.lang.Long
getEndTimestamp(AbstractRRA rra)
Gets the end time stamp, expressed in seconds since 1970-01-01 UTC.protected int
getIndex(java.lang.String dsName)
Gets the index.java.lang.Long
getLastUpdate()
Gets the last update.AbstractRRA
getMergeableRRA(AbstractRRA rraSrc)
Gets the mergeable RRA.abstract java.util.List<? extends AbstractRRA>
getRras()
Gets the RRAs.java.lang.Long
getStartTimestamp(AbstractRRA rra)
Gets the start time stamp, expressed in seconds since 1970-01-01 UTC.java.lang.Long
getStep()
Gets the step (interval) expressed in seconds.java.lang.String
getVersion()
Gets the version of the RRD Dump.boolean
hasEqualsRras(AbstractRRD rrd)
Checks for equals RRAs.boolean
hasMergeableRRAs(AbstractRRD rrdSrc)
Checks for mergeable RRAs.void
merge(java.util.List<? extends AbstractRRD> rrdList)
Merge.void
merge(AbstractRRD rrdSrc)
Merge.void
reset()
Resets the row values for all the RRAs.void
setLastUpdate(java.lang.Long lastUpdate)
Sets the last update.void
setStep(java.lang.Long step)
Sets the step.void
setVersion(java.lang.String version)
Sets the version.java.util.List<AbstractRRD>
split()
Split.
-
-
-
Method Detail
-
createRRD
protected abstract AbstractRRD createRRD()
Creates the RRD.- Returns:
- the abstract RRD
-
getDataSources
public abstract java.util.List<? extends AbstractDS> getDataSources()
Gets the data sources.- Returns:
- the data sources
-
getRras
public abstract java.util.List<? extends AbstractRRA> getRras()
Gets the RRAs.- Returns:
- the RRAs
-
addRRA
public abstract void addRRA(AbstractRRA rra)
Adds the RRA.- Parameters:
rra
- the RRA
-
addDataSource
public abstract void addDataSource(AbstractDS ds)
Adds the data source.- Parameters:
ds
- the DS
-
getDataSource
public abstract AbstractDS getDataSource(int index)
Gets the data source.- Parameters:
index
- the index- Returns:
- the data source
-
getVersion
public java.lang.String getVersion()
Gets the version of the RRD Dump.- Returns:
- the version
-
setVersion
public void setVersion(java.lang.String version)
Sets the version.- Parameters:
version
- the new version
-
getStep
public java.lang.Long getStep()
Gets the step (interval) expressed in seconds.- Returns:
- the step
-
setStep
public void setStep(java.lang.Long step)
Sets the step.- Parameters:
step
- the new step
-
getLastUpdate
public java.lang.Long getLastUpdate()
Gets the last update.- Returns:
- the last update
-
setLastUpdate
public void setLastUpdate(java.lang.Long lastUpdate)
Sets the last update.- Parameters:
lastUpdate
- the new last update
-
getStartTimestamp
public java.lang.Long getStartTimestamp(AbstractRRA rra)
Gets the start time stamp, expressed in seconds since 1970-01-01 UTC.- Parameters:
rra
- the RRA- Returns:
- the start time stamp (in seconds)
-
getEndTimestamp
public java.lang.Long getEndTimestamp(AbstractRRA rra)
Gets the end time stamp, expressed in seconds since 1970-01-01 UTC.- Parameters:
rra
- the RRA- Returns:
- the end time stamp (in seconds)
-
findTimestampByRow
public java.lang.Long findTimestampByRow(AbstractRRA rra, Row row)
Finds the row time stamp, expressed in seconds since 1970-01-01 UTC.- Parameters:
rra
- the RRA objectrow
- the Row object- Returns:
- the long
-
findRowByTimestamp
public Row findRowByTimestamp(AbstractRRA rra, java.lang.Long timestamp)
Gets the row that corresponds to a specific time stamp (expressed in seconds since 1970-01-01 UTC).- Parameters:
rra
- the RRAtimestamp
- the row time stamp- Returns:
- the row object
-
merge
public void merge(AbstractRRD rrdSrc) throws java.lang.IllegalArgumentException
Merge.Merge the content of rrdSrc into this RRD.
The format must be equal in order to perform the merge operation.
- Parameters:
rrdSrc
- the RRD source- Throws:
java.lang.IllegalArgumentException
- the illegal argument exception
-
hasMergeableRRAs
public boolean hasMergeableRRAs(AbstractRRD rrdSrc)
Checks for mergeable RRAs.- Parameters:
rrdSrc
- the RRD source- Returns:
- true, if there are mergeable RRAs
-
getMergeableRRA
public AbstractRRA getMergeableRRA(AbstractRRA rraSrc)
Gets the mergeable RRA.- Parameters:
rraSrc
- the source RRA- Returns:
- the local RRA mergeable with rraSrc
-
merge
public void merge(java.util.List<? extends AbstractRRD> rrdList) throws java.lang.IllegalArgumentException
Merge.- Parameters:
rrdList
- the RRD list- Throws:
java.lang.IllegalArgumentException
- the illegal argument exception
-
split
public java.util.List<AbstractRRD> split() throws java.lang.IllegalArgumentException
Split.If the RRD contain several data sources, it will return one RRD per DS. Otherwise, it will throw an exception.
- Returns:
- the RRD list
- Throws:
java.lang.IllegalArgumentException
- the illegal argument exception
-
formatEquals
public boolean formatEquals(AbstractRRD rrd)
Format equals.- Parameters:
rrd
- the RRD object- Returns:
- true, if successful
-
hasEqualsRras
public boolean hasEqualsRras(AbstractRRD rrd)
Checks for equals RRAs.- Parameters:
rrd
- the RRD object- Returns:
- true, if successful
-
reset
public void reset()
Resets the row values for all the RRAs.Double.NaN will be stored on each slot
-
getIndex
protected int getIndex(java.lang.String dsName)
Gets the index.- Parameters:
dsName
- the DS name- Returns:
- the index
-
-