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> | rowsNumber of archive rows |
protected RrdInt<Archive> | stepsNumber of archive steps |
protected RrdDouble<Archive> | xffX-files factor |
| Constructor and Description |
|---|
Archive(RrdDb parentDb,
ArcDef arcDef)Create an archive with the given definition. |
Archive(RrdDb parentDb,
DataImporter reader,
int arcIndex)Create an archive by importing from XML data. |
| Modifier and Type | Method and Description |
|---|---|
(package private) void | appendXml(XmlWriter writer)Append the archive data as XML. |
(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)Fetch data from the archive. |
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
parentDb - the parent RRD databasearcDef - archive definition, or null for uninitializedIOException - if an I/O error occursArchive(RrdDb parentDb, DataImporter reader, int arcIndex) throws IOException
parentDb - the parent RRD databasereader - data importer for XML restorearcIndex - archive indexIOException - if an I/O error occursvoid appendXml(XmlWriter writer) throws IOException
writer - the XML writerIOException - if an I/O error occursvoid archive(int dsIndex,
double value,
long numUpdates)
throws IOExceptiondsIndex - 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
request - the fetch requestIOException - if an I/O error occurspublic ArcState getArcState(int dsIndex)
dsIndex - Datasource indexpublic long getArcStep()
throws IOExceptionIOException - Thrown in case of I/O error.public ConsolFun getConsolFun() throws IOException
IOException - Thrown in case of I/O error.public long getEndTime()
throws IOExceptionIOException - 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 IOExceptionIOException - 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 IOExceptionIOException - Thrown in case of I/O error.public int getSteps()
throws IOExceptionIOException - Thrown in case of I/O error.public double getXff()
throws IOExceptionIOException - Thrown in case of I/O error.public void setXff(double xff)
throws IOExceptionxff - New X-files factor value. Must be >= 0 and < 1.IOException - Thrown in case of I/O error