|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rrd4j.core.RobinMatrix
public class RobinMatrix
Class to represent archive values for a single datasource. Robin class is the heart of the so-called "round robin database" concept. Basically, each Robin object is a fixed length array of double values. Each double value reperesents consolidated, archived value for the specific timestamp. When the underlying array of double values gets completely filled, new values will replace the oldest ones.
Robin object does not hold values in memory - such object could be quite large. Instead of it, Robin reads them from the backend I/O only when necessary.
Method Summary | |
---|---|
void |
bulkStore(double newValue,
int bulkCount)
|
void |
copyStateTo(org.rrd4j.core.RrdUpdater other)
Copies object's internal state to another Robin object. |
String |
dump()
|
void |
filterValues(double minValue,
double maxValue)
Filters values stored in this archive based on the given boundary. |
Archive |
getParent()
Returns the Archive object to which this Robin object belongs. |
org.rrd4j.core.RrdAllocator |
getRrdAllocator()
Required to implement RrdUpdater interface. |
RrdBackend |
getRrdBackend()
Returns the underlying storage (backend) object which actually performs all I/O operations. |
int |
getSize()
Returns the size of the underlying array of archived values. |
double |
getValue(int index)
Returns the i-th value from the Robin archive. |
double[] |
getValues()
Fetches all archived values. |
double[] |
getValues(int index,
int count)
|
void |
setValue(int index,
double value)
Sets the i-th value in the Robin archive. |
void |
setValues(double... newValues)
Updates archived values in bulk. |
void |
setValues(double newValue)
(Re)sets all values in this archive to the same value. |
void |
store(double newValue)
|
void |
update(double[] newValues)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public double[] getValues() throws IOException
getValues
in interface Robin
IOException
- Thrown in case of I/O specific error.public void store(double newValue) throws IOException
store
in interface Robin
IOException
public void bulkStore(double newValue, int bulkCount) throws IOException
bulkStore
in interface Robin
IOException
public void update(double[] newValues) throws IOException
update
in interface Robin
IOException
public void setValues(double... newValues) throws IOException
setValues
in interface Robin
newValues
- Array of double values to be stored in the archive
IOException
- Thrown in case of I/O error
IllegalArgumentException
- Thrown if the length of the input array is different from the length of
this archivepublic void setValues(double newValue) throws IOException
setValues
in interface Robin
newValue
- New value
IOException
- Thrown in case of I/O errorpublic String dump() throws IOException
dump
in interface Robin
IOException
public double getValue(int index) throws IOException
getValue
in interface Robin
index
- Value index
IOException
- Thrown in case of I/O specific error.public void setValue(int index, double value) throws IOException
setValue
in interface Robin
index
- index in the archive (the oldest value has zero index)value
- value to be stored
IOException
- Thrown in case of I/O specific error.public double[] getValues(int index, int count) throws IOException
getValues
in interface Robin
IOException
public Archive getParent()
getParent
in interface Robin
public int getSize()
getSize
in interface Robin
public void copyStateTo(org.rrd4j.core.RrdUpdater other) throws IOException
copyStateTo
in interface Robin
other
- New Robin object to copy state to
IOException
- Thrown in case of I/O errorpublic void filterValues(double minValue, double maxValue) throws IOException
[minValue, maxValue]
interval (inclusive)
will be silently replaced with NaN
.
filterValues
in interface Robin
minValue
- lower boundarymaxValue
- upper boundary
IOException
- Thrown in case of I/O errorpublic RrdBackend getRrdBackend()
getRrdBackend
in interface Robin
public org.rrd4j.core.RrdAllocator getRrdAllocator()
getRrdAllocator
in interface Robin
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |