java.lang.Object
org.rrd4j.core.ArcDef

public class ArcDefextends Object
Class to represent single archive definition within the RRD. Archive definition consists of the following four elements:
  • consolidation function
  • X-files factor
  • number of steps
  • number of rows.
For the complete explanation of all archive definition parameters, see the rrdcreate man page
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final ConsolFun
    How raw values are consolidated into this archive.
    private int
    Consolidated values the archive holds.
    private final int
    Raw steps combined into one consolidated value.
    private final double
    Fraction of unknown values still allowed, 0 to 1.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ArcDef(ConsolFun consolFun, double xff, int steps, int rows)
    Creates new archive definition object.
  • Method Summary

    Public Methods
    Modifier and Type
    Method
    Description
    Returns string representing archive definition (RRDTool format).
    boolean
    (package private) boolean
    Check if two archive definitions are exactly equal.
    Returns consolidation function.
    int
    Returns the number of rows (aggregated values) stored in the archive.
    int
    Returns the number of primary RRD steps which complete a single archive step.
    double
    Returns the X-files factor.
    int
     
    (package private) void
    setRows(int rows)
    Set the number of rows.

    Methods inherited from class Object

    clone, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • consolFun

      private final ConsolFun consolFun
      How raw values are consolidated into this archive.
    • xff

      private final double xff
      Fraction of unknown values still allowed, 0 to 1.
    • steps

      private final int steps
      Raw steps combined into one consolidated value.
    • rows

      private int rows
      Consolidated values the archive holds.
  • Constructor Details

    • ArcDef

      public ArcDef(ConsolFun consolFun, double xff, int steps, int rows)
      Creates new archive definition object. This object should be passed as argument to addArchive() method of RrdDb object.

      For the complete explanation of all archive definition parameters, see the rrdcreate man page

      Parameters:
      consolFun - Consolidation function. Allowed values are "AVERAGE", "MIN", "MAX", "LAST" and "TOTAL" (these string constants are conveniently defined in the ConsolFun class).
      xff - X-files factor, between 0 and 1.
      steps - Number of archive steps.
      rows - Number of archive rows.
  • Method Details

    • getConsolFun

      public ConsolFun getConsolFun()
      Returns consolidation function.
      Returns:
      the consolidation function for this archive.
    • getXff

      public double getXff()
      Returns the X-files factor.
      Returns:
      X-files factor value.
    • getSteps

      public int getSteps()
      Returns the number of primary RRD steps which complete a single archive step.
      Returns:
      Number of steps.
    • getRows

      public int getRows()
      Returns the number of rows (aggregated values) stored in the archive.
      Returns:
      Number of rows.
    • dump

      public String dump()
      Returns string representing archive definition (RRDTool format).
      Returns:
      String containing all archive definition parameters.
    • equals

      public boolean equals(Object obj)

      Checks if two archive definitions are equal. Archive definitions are considered equal if they have the same number of steps and the same consolidation function. It is not possible to create RRD with two equal archive definitions.

      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setRows

      void setRows(int rows)
      Set the number of rows.
      Parameters:
      rows - the number of rows
    • exactlyEqual

      boolean exactlyEqual(ArcDef def)
      Check if two archive definitions are exactly equal.
      Parameters:
      def - the definition to compare
      Returns:
      true if equal