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

public class DataSourceextends Object
Instances of this class model a data source in an RRD file.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static enum 
    The jrrd parameter index of each data source field.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final double
    Largest valid value, NaN if there is none.
    private final double
    Smallest valid value, NaN if there is none.
    private final int
    Longest allowed interval between updates.
    private final String
    The name of the data source.
    private final long
    Offset of this data source in the buffer.
    Status block of the current primary data point, initialized during database construction.
    private final long
    Size of this data source in the buffer.
    private final DataSourceType
    The type of the data source.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Reads one datasource record from the RRD header: the fixed-width name, the type string, and the ten-value parameter block carrying the minimum heartbeat and the value bounds.
  • Method Summary

    Public Methods
    Modifier and Type
    Method
    Description
    double
    Returns the maximum value input to this data source can have.
    double
    Returns the minimum value input to this data source can have.
    int
    Returns the minimum required heartbeat for this data source.
    Returns the name of this data source.
    Returns the primary data point status block for this data source.
    Returns the type this data source is.
    (package private) void
    Load PDP status block
    (package private) void
    Print info
    Returns a summary the contents of this data source.
    (package private) void
    Output XML

    Methods inherited from class Object

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

    • offset

      private final long offset
      Offset of this data source in the buffer.
    • size

      private final long size
      Size of this data source in the buffer.
    • name

      private final String name
      The name of the data source.
    • type

      private final DataSourceType type
      The type of the data source.
    • minimumHeartbeat

      private final int minimumHeartbeat
      Longest allowed interval between updates.
    • minimum

      private final double minimum
      Smallest valid value, NaN if there is none.
    • maximum

      private final double maximum
      Largest valid value, NaN if there is none.
    • pdpStatusBlock

      private PDPStatusBlock pdpStatusBlock
      Status block of the current primary data point, initialized during database construction.
  • Constructor Details

    • DataSource

      DataSource(RRDFile file)
      Reads one datasource record from the RRD header: the fixed-width name, the type string, and the ten-value parameter block carrying the minimum heartbeat and the value bounds. The record's byte length is retained so the file pointer can be stepped over it afterwards.
      Parameters:
      file - the RRD file positioned at the start of a datasource record
  • Method Details

    • loadPDPStatusBlock

      void loadPDPStatusBlock(RRDFile file)
      Load PDP status block
      Parameters:
      file - the RRD file to read the primary data point status block from
    • getPDPStatusBlock

      public PDPStatusBlock getPDPStatusBlock()
      Returns the primary data point status block for this data source.
      Returns:
      the primary data point status block for this data source.
    • getMinimumHeartbeat

      public int getMinimumHeartbeat()
      Returns the minimum required heartbeat for this data source.
      Returns:
      the minimum required heartbeat for this data source.
    • getMinimum

      public double getMinimum()
      Returns the minimum value input to this data source can have.
      Returns:
      the minimum value input to this data source can have.
    • getType

      public DataSourceType getType()
      Returns the type this data source is.
      Returns:
      the type this data source is.
      See Also:
    • getMaximum

      public double getMaximum()
      Returns the maximum value input to this data source can have.
      Returns:
      the maximum value input to this data source can have.
    • getName

      public String getName()
      Returns the name of this data source.
      Returns:
      the name of this data source.
    • printInfo

      void printInfo(PrintStream s, NumberFormat numberFormat)
      Print info
      Parameters:
      s - the stream the ds[...] properties are written to
      numberFormat - the formatter used for the min and max values
    • toXml

      void toXml(PrintStream s)
      Output XML
      Parameters:
      s - the stream the XML form of this data source is written to
    • toString

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