java.lang.Object
org.rrd4j.core.ArcState
All Implemented Interfaces:
RrdUpdater<ArcState>

public class ArcStateextends Object implements RrdUpdater<ArcState>
Class to represent internal RRD archive state for a single datasource. Objects of this class are never manipulated directly, it's up to Rrd4j to manage internal archive states.
  • Field Details

    • parentArc

      private final Archive parentArc
      The archive this state belongs to.
    • accumValue

      private final RrdDouble<ArcState> accumValue
      Running total of the consolidated values.
    • nanSteps

      private final RrdLong<ArcState> nanSteps
      Steps that were never updated.
  • Constructor Details

    • ArcState

      ArcState(Archive parentArc, boolean shouldInitialize) throws IOException
      Owning archive.
      Parameters:
      parentArc - the owning archive
      shouldInitialize - whether to initialize accumulator and NaN steps
      Throws:
      IOException - if an I/O error occurs
  • Method Details

    • dump

      String dump() throws IOException
      Dump state as a string.
      Returns:
      dump string
      Throws:
      IOException - if an I/O error occurs
    • setNanSteps

      void setNanSteps(long value) throws IOException
      Set the NaN steps count.
      Parameters:
      value - the value to set
      Throws:
      IOException - if an I/O error occurs
    • getNanSteps

      public long getNanSteps() throws IOException
      Returns the number of currently accumulated NaN steps.
      Returns:
      Number of currently accumulated NaN steps.
      Throws:
      IOException - Thrown in case of I/O error
    • setAccumValue

      void setAccumValue(double value) throws IOException
      Set the accumulated value.
      Parameters:
      value - the value to set
      Throws:
      IOException - if an I/O error occurs
    • getAccumValue

      public double getAccumValue() throws IOException
      Returns the value accumulated so far.
      Returns:
      Accumulated value
      Throws:
      IOException - Thrown in case of I/O error
    • getParent

      public Archive getParent()
      Returns the Archive object to which this ArcState object belongs.
      Returns:
      Parent Archive object.
    • appendXml

      void appendXml(XmlWriter writer) throws IOException
      Append XML representation.
      Parameters:
      writer - the XML writer
      Throws:
      IOException - if an I/O error occurs
    • copyStateTo

      public void copyStateTo(ArcState arcState) throws IOException

      Copies object's internal state to another ArcState object.

      Specified by:
      copyStateTo in interface RrdUpdater<ArcState>
      Parameters:
      arcState - a RrdUpdater object.
      Throws:
      IOException - if the state cannot be read from the backend
    • getRrdBackend

      public RrdBackend getRrdBackend()
      Returns the underlying storage (backend) object which actually performs all I/O operations.
      Specified by:
      getRrdBackend in interface RrdUpdater<ArcState>
      Returns:
      I/O backend object
    • getRrdAllocator

      public RrdAllocator getRrdAllocator()
      Required to implement RrdUpdater interface. You should never call this method directly.
      Specified by:
      getRrdAllocator in interface RrdUpdater<ArcState>
      Returns:
      Allocator object