Class TemporalPointBatch<P extends TemporalPoint<?,?>>
java.lang.Object
com.inductiveautomation.historian.gateway.api.storage.TemporalPointBatch<P>
- Type Parameters:
P- the point type.
A batch of points of one type, with the future that completes with their storage result.
-
Constructor Summary
ConstructorsConstructorDescriptionTemporalPointBatch(List<P> points, CompletableFuture<StorageResult<P>> result, SortHint hint) Creates a batch. -
Method Summary
Modifier and TypeMethodDescriptionstatic <P extends TemporalPoint<?,?>>
TemporalPointBatch<P> combine(List<TemporalPointBatch<P>> batches) Combines batches into one, alwaysSortHint.UNSORTED; pre-sorted inputs keep their order only if their ranges are disjoint, which is not validated.static <P extends TemporalPoint<?,?>>
SequencedMap<TemporalPointType, List<P>> groupByType(List<P> points) Groups points by type, preserving first-seen order.inthashCode()static <P extends TemporalPoint<?,?>>
TemporalPointBatch<P> Creates a batch, sorting the points.static <P extends TemporalPoint<?,?>>
TemporalPointBatch<P> Creates a batch with an explicit ordering hint.static <P extends TemporalPoint<?,?>>
List<TemporalPointBatch<P>> Splits a possibly mixed list into one batch perTemporalPointType, in first-seen order.points()Returns the points, ordered according to theSortHintthe batch was built with.Returns the type shared by every point in the batch.result()Returns the future that completes with the batch's storage result.toString()
-
Constructor Details
-
TemporalPointBatch
public TemporalPointBatch(List<P> points, CompletableFuture<StorageResult<P>> result, SortHint hint) Creates a batch.- Parameters:
points- the points, all of one type.hintdecides ordering:SortHint.UNSORTEDsorts them,SortHint.PRESORTEDtrusts the caller, andSortHint.VERIFYchecks whether they are sorted and sorts only if not.result- the future for the batch's storage result.hint- how to treat the ordering ofpoints.
-
-
Method Details
-
of
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 ofpoints.- 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 perTemporalPointType, 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
pointsis 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, alwaysSortHint.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 oneTemporalPointType.- Returns:
- a batch containing every input point.
-
pointType
Returns the type shared by every point in the batch.- Returns:
- the point type.
-
points
-
result
Returns the future that completes with the batch's storage result.- Returns:
- the result future.
-
hashCode
-
toString
-