DsTypes
, RrdUpdater
public class Datasource extends java.lang.Object implements RrdUpdater, DsTypes
Normally, you don't need to manipluate Datasource objects directly, it's up to JRobin framework to do it for you.
DT_ABSOLUTE, DT_COUNTER, DT_DERIVE, DT_GAUGE
コンストラクタ | 説明 |
---|---|
Datasource(RrdDb parentDb,
DataImporter reader,
int dsIndex) |
|
Datasource(RrdDb parentDb,
DsDef dsDef) |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
(package private) void |
appendXml(XmlWriter writer) |
|
void |
copyStateTo(RrdUpdater other) |
Copies object's internal state to another Datasource object.
|
(package private) java.lang.String |
dump() |
|
double |
getAccumValue() |
Returns value this datasource accumulated so far.
|
int |
getDsIndex() |
Returns index of this Datasource object in the RRD.
|
java.lang.String |
getDsName() |
Returns datasource name.
|
java.lang.String |
getDsType() |
Returns datasource type (GAUGE, COUNTER, DERIVE, ABSOLUTE).
|
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 mimimal allowed value for this datasource.
|
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.
|
(package private) void |
process(long newTime,
double newValue) |
|
void |
setDsName(java.lang.String newDsName) |
Sets datasource name to a new value
|
void |
setDsType(java.lang.String newDsType) |
|
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.
|
java.lang.String |
toString() |
Datasource(RrdDb parentDb, DsDef dsDef) throws java.io.IOException
java.io.IOException
Datasource(RrdDb parentDb, DataImporter reader, int dsIndex) throws java.io.IOException, RrdException
java.io.IOException
RrdException
java.lang.String dump() throws java.io.IOException
java.io.IOException
public java.lang.String getDsName() throws java.io.IOException
java.io.IOException
- Thrown in case of I/O errorpublic java.lang.String getDsType() throws java.io.IOException
java.io.IOException
- Thrown in case of I/O errorpublic long getHeartbeat() throws java.io.IOException
java.io.IOException
- Thrown in case of I/O errorpublic double getMinValue() throws java.io.IOException
java.io.IOException
- Thrown in case of I/O errorpublic double getMaxValue() throws java.io.IOException
java.io.IOException
- Thrown in case of I/O errorpublic double getLastValue() throws java.io.IOException
java.io.IOException
- Thrown in case of I/O errorpublic double getAccumValue() throws java.io.IOException
java.io.IOException
- Thrown in case of I/O errorpublic long getNanSeconds() throws java.io.IOException
java.io.IOException
- Thrown in case of I/O errorvoid process(long newTime, double newValue) throws java.io.IOException, RrdException
java.io.IOException
RrdException
void appendXml(XmlWriter writer) throws java.io.IOException
java.io.IOException
public void copyStateTo(RrdUpdater other) throws java.io.IOException, RrdException
copyStateTo
インタフェース内 RrdUpdater
other
- New Datasource object to copy state tojava.io.IOException
- Thrown in case of I/O errorRrdException
- Thrown if supplied argument is not a Datasource objectpublic int getDsIndex() throws java.io.IOException
java.io.IOException
- Thrown in case of I/O errorpublic void setHeartbeat(long heartbeat) throws RrdException, java.io.IOException
heartbeat
- New heartbeat valuejava.io.IOException
- Thrown in case of I/O errorRrdException
- Thrown if invalid (non-positive) heartbeat value is specified.public void setDsName(java.lang.String newDsName) throws RrdException, java.io.IOException
newDsName
- New datasource nameRrdException
- Thrown if invalid data source name is specified (name too long, or
name already defined in the RRDjava.io.IOException
- Thrown in case of I/O errorpublic void setDsType(java.lang.String newDsType) throws RrdException, java.io.IOException
RrdException
java.io.IOException
public void setMinValue(double minValue, boolean filterArchivedValues) throws java.io.IOException, RrdException
filterArchivedValues
argment 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.java.io.IOException
- Thrown in case of I/O errorRrdException
- Thrown if invalid minValue was supplied (not less then maxValue)public void setMaxValue(double maxValue, boolean filterArchivedValues) throws java.io.IOException, RrdException
filterArchivedValues
argment 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.java.io.IOException
- Thrown in case of I/O errorRrdException
- Thrown if invalid maxValue was supplied (not greater then minValue)public void setMinMaxValue(double minValue, double maxValue, boolean filterArchivedValues) throws java.io.IOException, RrdException
filterArchivedValues
argment 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.java.io.IOException
- Thrown in case of I/O errorRrdException
- Thrown if invalid min/max values were suppliedpublic RrdBackend getRrdBackend()
getRrdBackend
インタフェース内 RrdUpdater
public RrdAllocator getRrdAllocator()
getRrdAllocator
インタフェース内 RrdUpdater
public java.lang.String toString()
toString
クラス内 java.lang.Object