Record Class WindowAssigner.Natural

java.lang.Object
java.lang.Record
com.inductiveautomation.historian.gateway.api.query.pipeline.WindowAssigner.Natural
Record Components:
suggestedSizeMs - the engine-resolved size in milliseconds
startMs - the alignment epoch, typically the query's start time in epoch milliseconds
All Implemented Interfaces:
WindowAssigner
Enclosing interface:
WindowAssigner

public static record WindowAssigner.Natural(long suggestedSizeMs, long startMs) extends Record implements WindowAssigner
Engine-suggested window size for aggregated queries with no explicit window, for example (endMs - startMs) / returnSize. A non-positive size is treated as a single 1 ms window.
  • Constructor Details

    • Natural

      public Natural(long suggestedSizeMs, long startMs)
      Creates an instance of a Natural record class.
      Parameters:
      suggestedSizeMs - the value for the suggestedSizeMs record component
      startMs - the value for the startMs record component
  • Method Details

    • assignWindow

      public long assignWindow(long timestamp)
      Description copied from interface: WindowAssigner
      Assigns a timestamp to the start of its window.
      Specified by:
      assignWindow in interface WindowAssigner
      Parameters:
      timestamp - the event timestamp in epoch milliseconds
      Returns:
      the window start in epoch milliseconds; WindowAssigner.Raw returns the input
    • windowSize

      public long windowSize()
      Description copied from interface: WindowAssigner
      Returns the window size in milliseconds; 0 means one window per event and only WindowAssigner.Raw returns it.
      Specified by:
      windowSize in interface WindowAssigner
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • suggestedSizeMs

      public long suggestedSizeMs()
      Returns the value of the suggestedSizeMs record component.
      Returns:
      the value of the suggestedSizeMs record component
    • startMs

      public long startMs()
      Returns the value of the startMs record component.
      Returns:
      the value of the startMs record component