Package org.rrd4j.core
Class RobinArray
java.lang.Object
org.rrd4j.core.RobinArray
- All Implemented Interfaces:
 Robin,RrdUpdater<Robin>
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 represents 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.
- Author:
 - Sasa Markovic
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidbulkStore(double newValue, int bulkCount) bulkStore.voidcopyStateTo(Robin robin) copyStateTo.dump()dump.voidfilterValues(double minValue, double maxValue) Filters values stored in this archive based on the given boundary.getParent.getRrdAllocator.getRrdBackend.intgetSize()getSize.doublegetValue(int index) Returns the i-th value from the Robin archive.double[]Getter for the fieldvalues.double[]getValues(int index, int count) getValues.voidsetValue(int index, double value) Sets the i-th value in the Robin archive.voidsetValues(double newValue) (Re)sets all values in this archive to the same value.voidsetValues(double... newValues) Updates archived values in bulk.voidstore(double newValue) store.voidupdate(double[] newValues) update. 
- 
Constructor Details
- 
RobinArray
RobinArray(Archive parentArc, int rows, boolean shouldInitialize) throws IOException - Throws:
 IOException
 
 - 
 - 
Method Details
- 
getValues
Getter for the field
values.- Specified by:
 getValuesin interfaceRobin- Returns:
 - an array of double.
 - Throws:
 IOException- if any.
 - 
store
store.
- Specified by:
 storein interfaceRobin- Parameters:
 newValue- a double.- Throws:
 IOException- if any.
 - 
bulkStore
bulkStore.
- Specified by:
 bulkStorein interfaceRobin- Parameters:
 newValue- a double.bulkCount- a int.- Throws:
 IOException- if any.
 - 
update
update.
- Specified by:
 updatein interfaceRobin- Parameters:
 newValues- an array of double.- Throws:
 IOException- if any.
 - 
setValues
Updates archived values in bulk.- Specified by:
 setValuesin interfaceRobin- Parameters:
 newValues- Array of double values to be stored in the archive- Throws:
 IOException- Thrown in case of I/O error
 - 
setValues
(Re)sets all values in this archive to the same value.- Specified by:
 setValuesin interfaceRobin- Parameters:
 newValue- New value- Throws:
 IOException- Thrown in case of I/O error
 - 
dump
dump.
- Specified by:
 dumpin interfaceRobin- Returns:
 - a 
Stringobject. - Throws:
 IOException- if any.
 - 
getValue
Returns the i-th value from the Robin archive.- Specified by:
 getValuein interfaceRobin- Parameters:
 index- Value index- Returns:
 - Value stored in the i-th position (the oldest value has zero index)
 - Throws:
 IOException- Thrown in case of I/O specific error.
 - 
setValue
Sets the i-th value in the Robin archive.- Specified by:
 setValuein interfaceRobin- Parameters:
 index- index in the archive (the oldest value has zero index)value- value to be stored- Throws:
 IOException- Thrown in case of I/O specific error.
 - 
getValues
getValues.
- Specified by:
 getValuesin interfaceRobin- Parameters:
 index- a int.count- a int.- Returns:
 - an array of double.
 - Throws:
 IOException- if any.
 - 
getParent
getParent.
 - 
getSize
public int getSize()getSize.
 - 
copyStateTo
copyStateTo.
Copies object's internal state to another Robin object.- Specified by:
 copyStateToin interfaceRobin- Specified by:
 copyStateToin interfaceRrdUpdater<Robin>- Parameters:
 robin- aRrdUpdaterobject.- Throws:
 IOException- if any.
 - 
filterValues
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 withNaN.- Specified by:
 filterValuesin interfaceRobin- Parameters:
 minValue- lower boundarymaxValue- upper boundary- Throws:
 IOException- Thrown in case of I/O error
 - 
getRrdBackend
getRrdBackend.
- Specified by:
 getRrdBackendin interfaceRobin- Specified by:
 getRrdBackendin interfaceRrdUpdater<Robin>- Returns:
 - a 
RrdBackendobject. 
 - 
getRrdAllocator
getRrdAllocator.
- Specified by:
 getRrdAllocatorin interfaceRobin- Specified by:
 getRrdAllocatorin interfaceRrdUpdater<Robin>- Returns:
 - a 
RrdAllocatorobject. 
 
 -