class RobinMatrix extends Object implements Robin
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.
Constructor and Description |
---|
RobinMatrix(Archive parentArc,
RrdDoubleMatrix<Archive> values,
RrdInt<Archive> pointer,
int column) |
Modifier and Type | Method and Description |
---|---|
void |
bulkStore(double newValue,
int bulkCount)
bulkStore.
|
void |
copyStateTo(Robin robin)
copyStateTo.
|
String |
dump()
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.
|
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)
getValues.
|
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)
store.
|
void |
update(double[] newValues)
update.
|
RobinMatrix(Archive parentArc, RrdDoubleMatrix<Archive> values, RrdInt<Archive> pointer, int column) throws IOException
IOException
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.
store
in interface Robin
newValue
- a double.IOException
- if any.public void bulkStore(double newValue, int bulkCount) throws IOException
bulkStore.
bulkStore
in interface Robin
newValue
- a double.bulkCount
- a int.IOException
- if any.public void update(double[] newValues) throws IOException
update.
update
in interface Robin
newValues
- an array of double.IOException
- if any.public void setValues(double... newValues) throws IOException
setValues
in interface Robin
newValues
- Array of double values to be stored in the archiveIOException
- Thrown in case of I/O errorpublic void setValues(double newValue) throws IOException
setValues
in interface Robin
newValue
- New valueIOException
- Thrown in case of I/O errorpublic String dump() throws IOException
dump.
dump
in interface Robin
String
object.IOException
- if any.public double getValue(int index) throws IOException
getValue
in interface Robin
index
- Value indexIOException
- 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 storedIOException
- Thrown in case of I/O specific error.public double[] getValues(int index, int count) throws IOException
getValues.
getValues
in interface Robin
index
- a int.count
- a int.IOException
- if any.public Archive getParent()
public int getSize()
public void copyStateTo(Robin robin) throws IOException
copyStateTo.
Copies object's internal state to another Robin object. Copies object's internal state to another Robin object.copyStateTo
in interface Robin
copyStateTo
in interface RrdUpdater<Robin>
robin
- a RrdUpdater
object.IOException
- if any.public void filterValues(double minValue, double maxValue) throws IOException
[minValue, maxValue]
interval (inclusive)
will be silently replaced with NaN
.
Filters values stored in this archive based on the given boundary.
Archived values found to be outside of [minValue, maxValue]
interval (inclusive)
will be silently replaced with NaN
.filterValues
in interface Robin
minValue
- lower boundarymaxValue
- upper boundaryIOException
- Thrown in case of I/O errorpublic RrdBackend getRrdBackend()
getRrdBackend
in interface Robin
getRrdBackend
in interface RrdUpdater<Robin>
public RrdAllocator getRrdAllocator()
getRrdAllocator
in interface Robin
getRrdAllocator
in interface RrdUpdater<Robin>