public class Datasource extends Object implements RrdUpdater<Datasource>
Normally, you don't need to manipulate Datasource objects directly, it's up to Rrd4j framework to do it for you.
| Constructor and Description |
|---|
Datasource(RrdDb parentDb,
DataImporter reader,
int dsIndex) |
Datasource(RrdDb parentDb,
DsDef dsDef) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
appendXml(XmlWriter writer) |
void |
copyStateTo(Datasource datasource)
copyStateTo.
|
(package private) String |
dump()
Returns a string representation of datasource information.
|
double |
getAccumValue()
Returns value this datasource accumulated so far.
|
int |
getDsIndex()
Returns index of this Datasource object in the RRD.
|
long |
getHeartbeat()
Returns datasource heartbeat
|
double |
getLastValue()
Returns last known value of the datasource.
|
double |
getMaxValue()
Returns maximal allowed value for this datasource.
|
double |
getMinValue()
Returns minimal allowed value for this datasource.
|
String |
getName()
Returns datasource name.
|
long |
getNanSeconds()
Returns the number of accumulated NaN seconds.
|
RrdAllocator |
getRrdAllocator()
Required to implement RrdUpdater interface.
|
RrdBackend |
getRrdBackend()
Returns the underlying storage (backend) object which actually performs all I/O operations.
|
DsType |
getType()
Returns datasource type (GAUGE, COUNTER, DERIVE, ABSOLUTE).
|
(package private) void |
process(long newTime,
double newValue) |
void |
setDsName(String newDsName)
Sets datasource name to a new value
|
void |
setDsType(DsType newDsType)
Setter for the field
dsType. |
void |
setHeartbeat(long heartbeat)
Sets datasource heartbeat to a new value.
|
void |
setMaxValue(double maxValue,
boolean filterArchivedValues)
Sets maximum allowed value for this datasource.
|
void |
setMinMaxValue(double minValue,
double maxValue,
boolean filterArchivedValues)
Sets min/max values allowed for this datasource.
|
void |
setMinValue(double minValue,
boolean filterArchivedValues)
Sets minimum allowed value for this datasource.
|
Datasource(RrdDb parentDb, DataImporter reader, int dsIndex) throws IOException
IOExceptionDatasource(RrdDb parentDb, DsDef dsDef) throws IOException
IOExceptionvoid appendXml(XmlWriter writer) throws IOException
IOExceptionpublic void copyStateTo(Datasource datasource) throws IOException
Copies object's internal state to another Datasource object.
copyStateTo in interface RrdUpdater<Datasource>datasource - a RrdUpdater object.IOException - if any.String dump() throws IOException
IOException - if an I/O error occurspublic double getAccumValue()
throws IOException
IOException - Thrown in case of I/O errorpublic int getDsIndex()
throws IOException
IOException - Thrown in case of I/O errorpublic long getHeartbeat()
throws IOException
IOException - Thrown in case of I/O errorpublic double getLastValue()
throws IOException
IOException - Thrown in case of I/O errorpublic double getMaxValue()
throws IOException
IOException - Thrown in case of I/O errorpublic double getMinValue()
throws IOException
IOException - Thrown in case of I/O errorpublic String getName() throws IOException
IOException - Thrown in case of I/O errorpublic long getNanSeconds()
throws IOException
IOException - Thrown in case of I/O errorpublic RrdAllocator getRrdAllocator()
getRrdAllocator in interface RrdUpdater<Datasource>public RrdBackend getRrdBackend()
getRrdBackend in interface RrdUpdater<Datasource>public DsType getType() throws IOException
IOException - Thrown in case of I/O errorfinal void process(long newTime,
double newValue)
throws IOException
IOExceptionpublic void setDsName(String newDsName) throws IOException
newDsName - New datasource nameIOException - Thrown in case of I/O errorpublic void setDsType(DsType newDsType) throws IOException
dsType.newDsType - a DsType object.IOException - if any.public void setHeartbeat(long heartbeat)
throws IOException
heartbeat - New heartbeat valueIOException - Thrown in case of I/O errorIllegalArgumentException - Thrown if invalid (non-positive) heartbeat value
is specified.public void setMaxValue(double maxValue,
boolean filterArchivedValues)
throws IOException
filterArchivedValues argument
is set to true, all archived values greater then maxValue will be fixed to NaN.maxValue - New maximal value. Specify Double.NaN if no max value should be
set.filterArchivedValues - true, if archived datasource values should be fixed; false,
otherwise.IOException - Thrown in case of I/O errorIllegalArgumentException - Thrown if invalid maxValue was supplied (not
greater then minValue)public void setMinMaxValue(double minValue,
double maxValue,
boolean filterArchivedValues)
throws IOException
filterArchivedValues
argument is set to true, all archived values less then minValue or greater then
maxValue will be fixed to NaN.minValue - New minimal value. Specify Double.NaN if no min value should be
set.maxValue - New maximal value. Specify Double.NaN if no max value should be
set.filterArchivedValues - true, if archived datasource values should be fixed; false,
otherwise.IOException - Thrown in case of I/O errorIllegalArgumentException - Thrown if invalid min/max values were suppliedpublic void setMinValue(double minValue,
boolean filterArchivedValues)
throws IOException
filterArchivedValues argument
is set to true, all archived values less then minValue will be fixed to NaN.minValue - New minimal value. Specify Double.NaN if no minimal value should
be setfilterArchivedValues - true, if archived datasource values should be fixed; false,
otherwise.IOException - Thrown in case of I/O errorIllegalArgumentException - Thrown if invalid minValue was supplied (not less
then maxValue)