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) |
void |
copyStateTo(Archive arc)
copyStateTo.
|
(package private) String |
dump() |
(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() |
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
IOException
Archive(RrdDb parentDb, DataImporter reader, int arcIndex) throws IOException
IOException
public long getArcStep() throws IOException
IOException
- Thrown in case of I/O error.String dump() throws IOException
IOException
RrdDb getParentDb()
void archive(int dsIndex, double value, long numUpdates) throws IOException
IOException
public ConsolFun getConsolFun() throws IOException
IOException
- Thrown in case of I/O error.public double getXff() throws IOException
IOException
- Thrown in case of I/O error.public int getSteps() throws IOException
IOException
- Thrown in case of I/O error.public int getRows() throws IOException
IOException
- Thrown in case of I/O error.public long getStartTime() throws IOException
IOException
- Thrown in case of I/O error.public long getEndTime() throws IOException
IOException
- Thrown in case of I/O error.public ArcState getArcState(int dsIndex)
dsIndex
- Datasource indexpublic Robin getRobin(int dsIndex)
dsIndex
- Index of the datasource in the RRD.FetchData fetchData(FetchRequest request) throws IOException
IOException
void appendXml(XmlWriter writer) throws IOException
IOException
public void copyStateTo(Archive arc) throws IOException
copyStateTo.
Copies object's internal state to another Archive object.copyStateTo
in interface RrdUpdater<Archive>
arc
- a RrdUpdater
object.IOException
- if any.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 errorpublic RrdBackend getRrdBackend()
getRrdBackend
in interface RrdUpdater<Archive>
public RrdAllocator getRrdAllocator()
getRrdAllocator
in interface RrdUpdater<Archive>