java.lang.Object
org.rrd4j.core.jrrd.Archive

public class Archiveextends Object
Instances of this class model an archive section of an RRD file.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) List<CDPStatusBlock>
    Consolidation data points status blocks.
    (package private) int
    Row for last modification time of database.
    (package private) long
    Data offset within file in bytes.
    (package private) final RRDatabase
    The parent RRD database.
    (package private) final long
    Header offset within file in bytes.
    (package private) final int
    Number of primary data points per consolidated data point.
    (package private) final int
    Data row count.
    (package private) final double
    X-Files factor for this archive.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create an Archive from an RRD file.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    getCDPStatusBlock(int index)
    Returns the CDPStatusBlock at the specified position in this archive.
    Returns an iterator over the CDP status blocks in this archive in proper sequence.
    int
    Returns the number of primary data points required for a consolidated data point in this archive.
    int
    Returns the number of entries in this archive.
    Returns the type of function used to calculate the consolidated data point.
    double[][]
    Getter for the field values.
    double
    Returns the X-Files Factor for this archive.
    (package private) void
    loadCDPStatusBlocks(RRDFile file, int numBlocks)
    Loads CDP status blocks from the RRD file.
    (package private) void
    Loads the current row index from the RRD file.
    (package private) void
    Loads archive data from a data chunk.
    (package private) void
    loadData(RRDFile file, int dsCount)
    Loads archive data from the RRD file, skipping to the next archive.
    (package private) void
    printInfo(PrintStream s, NumberFormat numberFormat, int index)
    Prints information about this archive to the specified print stream.
    Returns a summary the contents of this archive.
    (package private) void
    Writes XML representation of this archive to the specified print stream.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • db

      final RRDatabase db
      The parent RRD database.
    • headerOffset

      final long headerOffset
      Header offset within file in bytes.
    • dataOffset

      long dataOffset
      Data offset within file in bytes.
    • rowCount

      final int rowCount
      Data row count.
    • pdpCount

      final int pdpCount
      Number of primary data points per consolidated data point.
    • xff

      final double xff
      X-Files factor for this archive.
    • cdpStatusBlocks

      List<CDPStatusBlock> cdpStatusBlocks
      Consolidation data points status blocks.
    • currentRow

      int currentRow
      Row for last modification time of database.
  • Constructor Details

    • Archive

      Archive(RRDatabase db)
      Create an Archive from an RRD file.
      Parameters:
      db - the RRD database
  • Method Details

    • getType

      public ConsolidationFunctionType getType()
      Returns the type of function used to calculate the consolidated data point.
      Returns:
      the type of function used to calculate the consolidated data point.
    • loadCDPStatusBlocks

      void loadCDPStatusBlocks(RRDFile file, int numBlocks)
      Loads CDP status blocks from the RRD file.
      Parameters:
      file - The RRD file to read from.
      numBlocks - The number of CDP status blocks to load.
    • getCDPStatusBlock

      public CDPStatusBlock getCDPStatusBlock(int index)
      Returns the CDPStatusBlock at the specified position in this archive.
      Parameters:
      index - index of CDPStatusBlock to return.
      Returns:
      the CDPStatusBlock at the specified position in this archive.
    • getCDPStatusBlocks

      public Iterator<CDPStatusBlock> getCDPStatusBlocks()
      Returns an iterator over the CDP status blocks in this archive in proper sequence.
      Returns:
      an iterator over the CDP status blocks in this archive in proper sequence.
      See Also:
    • loadCurrentRow

      void loadCurrentRow(RRDFile file)
      Loads the current row index from the RRD file.
      Parameters:
      file - The RRD file to read from.
    • loadData

      void loadData(RRDFile file, int dsCount)
      Loads archive data from the RRD file, skipping to the next archive.
      Parameters:
      file - The RRD file to read from.
      dsCount - Number of data sources in the database.
    • loadData

      void loadData(DataChunk chunk)
      Loads archive data from a data chunk.
      Parameters:
      chunk - The data chunk containing archive data.
    • printInfo

      void printInfo(PrintStream s, NumberFormat numberFormat, int index)
      Prints information about this archive to the specified print stream.
      Parameters:
      s - Print stream to write to.
      numberFormat - Number format for displaying values.
      index - Archive index in the database.
    • toXml

      void toXml(PrintStream s)
      Writes XML representation of this archive to the specified print stream.
      Parameters:
      s - Print stream to write to.
    • getValues

      public double[][] getValues()
      Getter for the field values.
      Returns:
      an array of double.
    • getPdpCount

      public int getPdpCount()
      Returns the number of primary data points required for a consolidated data point in this archive.
      Returns:
      the number of primary data points required for a consolidated data point in this archive.
    • getRowCount

      public int getRowCount()
      Returns the number of entries in this archive.
      Returns:
      the number of entries in this archive.
    • getXff

      public double getXff()
      Returns the X-Files Factor for this archive.
      Returns:
      the X-Files Factor for this archive.
    • toString

      public String toString()
      Returns a summary the contents of this archive.
      Overrides:
      toString in class Object
      Returns:
      a summary of the information contained in this archive.