public class Archive extends Object implements RrdUpdater<Archive>
Each archive object consists of three parts: archive definition, archive state objects (one state object for each datasource) and round robin archives (one round robin for each datasource). API (read-only) is provided to access each of these parts.
| Modifier and Type | Field and Description |
|---|---|
protected RrdInt<Archive> |
rows |
protected RrdInt<Archive> |
steps |
protected RrdDouble<Archive> |
xff |
| Constructor and Description |
|---|
Archive(RrdDb parentDb,
ArcDef arcDef) |
Archive(RrdDb parentDb,
DataImporter reader,
int arcIndex) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
appendXml(XmlWriter writer) |
(package private) void |
archive(int dsIndex,
double value,
long numUpdates)
Archives a value for the specified datasource.
|
void |
copyStateTo(Archive arc)
copyStateTo.
|
(package private) String |
dump()
Returns a string representation of the archive information.
|
(package private) FetchData |
fetchData(FetchRequest request) |
ArcState |
getArcState(int dsIndex)
Returns the underlying archive state object.
|
long |
getArcStep()
Returns archive time step in seconds.
|
ConsolFun |
getConsolFun()
Returns archive consolidation function ("AVERAGE", "MIN", "MAX", "FIRST", "LAST" or "TOTAL").
|
long |
getEndTime()
Returns current ending timestamp.
|
(package private) RrdDb |
getParentDb()
Returns the parent RRD database.
|
Robin |
getRobin(int dsIndex)
Returns the underlying round robin archive.
|
int |
getRows()
Returns the number of archive rows.
|
RrdAllocator |
getRrdAllocator()
Required to implement RrdUpdater interface.
|
RrdBackend |
getRrdBackend()
Returns the underlying storage (backend) object which actually performs all I/O operations.
|
long |
getStartTime()
Returns current starting timestamp.
|
int |
getSteps()
Returns the number of archive steps.
|
double |
getXff()
Returns archive X-files factor.
|
void |
setXff(double xff)
Sets X-files factor to a new value.
|
Archive(RrdDb parentDb, ArcDef arcDef) throws IOException
IOExceptionArchive(RrdDb parentDb, DataImporter reader, int arcIndex) throws IOException
IOExceptionvoid appendXml(XmlWriter writer) throws IOException
IOExceptionvoid archive(int dsIndex,
double value,
long numUpdates)
throws IOException
dsIndex - index of the datasourcevalue - value to archivenumUpdates - number of updates to performIOException - if an I/O error occurspublic void copyStateTo(Archive arc) throws IOException
Copies object's internal state to another Archive object.
copyStateTo in interface RrdUpdater<Archive>arc - a RrdUpdater object.IOException - if any.String dump() throws IOException
IOException - if an I/O error occursFetchData fetchData(FetchRequest request) throws IOException
IOExceptionpublic ArcState getArcState(int dsIndex)
dsIndex - Datasource indexpublic long getArcStep()
throws IOException
IOException - Thrown in case of I/O error.public ConsolFun getConsolFun() throws IOException
IOException - Thrown in case of I/O error.public long getEndTime()
throws IOException
IOException - Thrown in case of I/O error.RrdDb getParentDb()
public Robin getRobin(int dsIndex)
dsIndex - Index of the datasource in the RRD.public int getRows()
throws IOException
IOException - Thrown in case of I/O error.public RrdAllocator getRrdAllocator()
getRrdAllocator in interface RrdUpdater<Archive>public RrdBackend getRrdBackend()
getRrdBackend in interface RrdUpdater<Archive>public long getStartTime()
throws IOException
IOException - Thrown in case of I/O error.public int getSteps()
throws IOException
IOException - Thrown in case of I/O error.public double getXff()
throws IOException
IOException - Thrown in case of I/O error.public void setXff(double xff)
throws IOException
xff - New X-files factor value. Must be >= 0 and < 1.IOException - Thrown in case of I/O error