Class TemporalPointBatch<P extends TemporalPoint<?,?>>

java.lang.Object
com.inductiveautomation.historian.gateway.api.storage.TemporalPointBatch<P>
Type Parameters:
P - the point type.

public final class TemporalPointBatch<P extends TemporalPoint<?,?>> extends Object
A batch of points of one type, with the future that completes with their storage result.
  • Constructor Details

  • Method Details

    • of

      public static <P extends TemporalPoint<?,?>> TemporalPointBatch<P> of(List<P> points)
      Creates a batch, sorting the points.
      Type Parameters:
      P - the point type.
      Parameters:
      points - the points.
      Returns:
      the new batch.
    • of

      public static <P extends TemporalPoint<?,?>> TemporalPointBatch<P> of(List<P> points, SortHint hint)
      Creates a batch with an explicit ordering hint.
      Type Parameters:
      P - the point type.
      Parameters:
      points - the points, all of one type.
      hint - how to treat the ordering of points.
      Returns:
      the new batch.
    • partition

      public static <P extends TemporalPoint<?,?>> List<TemporalPointBatch<P>> partition(List<P> points, SortHint hint)
      Splits a possibly mixed list into one batch per TemporalPointType, in first-seen order.
      Type Parameters:
      P - the point type.
      Parameters:
      points - the points; may hold more than one type.
      hint - how each batch treats the ordering of its slice.
      Returns:
      one batch per distinct type; empty when points is empty.
    • groupByType

      public static <P extends TemporalPoint<?,?>> SequencedMap<TemporalPointType, List<P>> groupByType(List<P> points)
      Groups points by type, preserving first-seen order.
      Type Parameters:
      P - the point type.
      Parameters:
      points - the points; may hold more than one type.
      Returns:
      a map from point type to the points of that type.
    • combine

      public static <P extends TemporalPoint<?,?>> TemporalPointBatch<P> combine(List<TemporalPointBatch<P>> batches)
      Combines batches into one, always SortHint.UNSORTED; pre-sorted inputs keep their order only if their ranges are disjoint, which is not validated.
      Type Parameters:
      P - the point type.
      Parameters:
      batches - the batches to combine; all must share one TemporalPointType.
      Returns:
      a batch containing every input point.
    • pointType

      public TemporalPointType pointType()
      Returns the type shared by every point in the batch.
      Returns:
      the point type.
    • points

      public List<P> points()
      Returns the points, ordered according to the SortHint the batch was built with.
      Returns:
      the points.
    • result

      public CompletableFuture<StorageResult<P>> result()
      Returns the future that completes with the batch's storage result.
      Returns:
      the result future.
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object