Class TDigestPercentileOperator
java.lang.Object
io.deephaven.engine.table.impl.by.TDigestPercentileOperator
- All Implemented Interfaces:
IterativeChunkedAggregationOperator
public class TDigestPercentileOperator
extends Object
implements IterativeChunkedAggregationOperator
Iterative T-Digest and percentile operator.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.table.impl.by.IterativeChunkedAggregationOperator
IterativeChunkedAggregationOperator.BucketedContext, IterativeChunkedAggregationOperator.SingletonContext
-
Field Summary
Fields inherited from interface io.deephaven.engine.table.impl.by.IterativeChunkedAggregationOperator
ZERO_LENGTH_ITERATIVE_CHUNKED_AGGREGATION_OPERATOR_ARRAY
-
Constructor Summary
ConstructorDescriptionTDigestPercentileOperator
(@NotNull Class<?> type, double compression, double percentile, @NotNull String name) TDigestPercentileOperator
(@NotNull Class<?> type, double compression, String digestColumnName, @org.jetbrains.annotations.NotNull double[] percentiles, @NotNull String[] resultNames) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChunk
(IterativeChunkedAggregationOperator.BucketedContext bucketedContext, Chunk<? extends Values> values, LongChunk<? extends RowKeys> inputRowKeys, IntChunk<RowKeys> destinations, IntChunk<ChunkPositions> startPositions, IntChunk<ChunkLengths> length, WritableBooleanChunk<Values> stateModified) Aggregate a chunk of data into the result columns.boolean
addChunk
(IterativeChunkedAggregationOperator.SingletonContext singletonContext, int chunkSize, Chunk<? extends Values> values, LongChunk<? extends RowKeys> inputRowKeys, long destination) Aggregate a chunk of data into the result columns.double
void
ensureCapacity
(long tableSize) Ensure that this operator can handle destinations up to tableSize - 1.Map<String,
? extends ColumnSource<?>> Return a map of result columns produced by this operator.makeBucketedContext
(int size) Make aIterativeChunkedAggregationOperator.BucketedContext
suitable for this operator if necessary.makeSecondaryOperator
(double percentile, @NotNull String resultName) makeSingletonContext
(int size) Make aIterativeChunkedAggregationOperator.SingletonContext
suitable for this operator if necessary.void
modifyChunk
(IterativeChunkedAggregationOperator.BucketedContext bucketedContext, Chunk<? extends Values> preValues, Chunk<? extends Values> postValues, LongChunk<? extends RowKeys> postShiftRowKeys, IntChunk<RowKeys> destinations, IntChunk<ChunkPositions> startPositions, IntChunk<ChunkLengths> length, WritableBooleanChunk<Values> stateModified) Modify a chunk of data previously aggregated into the result columns using a parallel chunk of new values.boolean
modifyChunk
(IterativeChunkedAggregationOperator.SingletonContext context, int chunkSize, Chunk<? extends Values> previousValues, Chunk<? extends Values> newValues, LongChunk<? extends RowKeys> postShiftRowKeys, long destination) Modify a chunk of data previously aggregated into the result columns using a parallel chunk of new values.void
propagateInitialState
(@NotNull QueryTable resultTable, int startingDestinationsCount) Perform any internal state keeping needed for destinations that were added during initialization.void
propagateUpdates
(@NotNull TableUpdate downstream, @NotNull RowSet newDestinations) Perform any internal state keeping needed for destinations that were added (went from 0 keys to > 0), removed (went from > 0 keys to 0), or modified (keys added or removed, or keys modified) by this iteration.void
removeChunk
(IterativeChunkedAggregationOperator.BucketedContext bucketedContext, Chunk<? extends Values> values, LongChunk<? extends RowKeys> inputRowKeys, IntChunk<RowKeys> destinations, IntChunk<ChunkPositions> startPositions, IntChunk<ChunkLengths> length, WritableBooleanChunk<Values> stateModified) Remove a chunk of data previously aggregated into the result columns.boolean
removeChunk
(IterativeChunkedAggregationOperator.SingletonContext singletonContext, int chunkSize, Chunk<? extends Values> values, LongChunk<? extends RowKeys> inputRowKeys, long destination) Remove a chunk of data previously aggregated into the result columns.void
resetForStep
(@NotNull TableUpdate upstream, int startingDestinationsCount) Reset any per-step internal state.void
Called after initialization; when the operator's result columns must have previous tracking enabled.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.engine.table.impl.by.IterativeChunkedAggregationOperator
addRowSet, initializeRefreshing, modifyRowKeys, modifyRowKeys, propagateFailure, requiresRowKeys, requiresRunFinds, shiftChunk, shiftChunk, unchunkedRowSet
-
Constructor Details
-
TDigestPercentileOperator
-
TDigestPercentileOperator
-
-
Method Details
-
compression
public double compression() -
addChunk
public void addChunk(IterativeChunkedAggregationOperator.BucketedContext bucketedContext, Chunk<? extends Values> values, LongChunk<? extends RowKeys> inputRowKeys, IntChunk<RowKeys> destinations, IntChunk<ChunkPositions> startPositions, IntChunk<ChunkLengths> length, WritableBooleanChunk<Values> stateModified) Description copied from interface:IterativeChunkedAggregationOperator
Aggregate a chunk of data into the result columns.- Specified by:
addChunk
in interfaceIterativeChunkedAggregationOperator
- Parameters:
bucketedContext
- the operator-specific contextvalues
- a chunk of values to aggregateinputRowKeys
- the input row keys, in post-shift spacedestinations
- the destinations in resultColumn to aggregate into, parallel with startPositions and lengthstartPositions
- the starting positions in the chunk for each destinationlength
- the number of values in the chunk for each destinationstateModified
- a boolean output array, parallel to destinations, which is set to true if the corresponding destination has been modified
-
removeChunk
public void removeChunk(IterativeChunkedAggregationOperator.BucketedContext bucketedContext, Chunk<? extends Values> values, LongChunk<? extends RowKeys> inputRowKeys, IntChunk<RowKeys> destinations, IntChunk<ChunkPositions> startPositions, IntChunk<ChunkLengths> length, WritableBooleanChunk<Values> stateModified) Description copied from interface:IterativeChunkedAggregationOperator
Remove a chunk of data previously aggregated into the result columns.- Specified by:
removeChunk
in interfaceIterativeChunkedAggregationOperator
- Parameters:
bucketedContext
- the operator-specific contextvalues
- a chunk of values that have been previously aggregated.inputRowKeys
- the input row keys, in pre-shift spacedestinations
- the destinations in resultColumn to remove the values from, parallel with startPositions and lengthstartPositions
- the starting positions in the chunk for each destinationlength
- the number of values in the chunk for each destinationstateModified
- a boolean output array, parallel to destinations, which is set to true if the corresponding destination has been modified
-
modifyChunk
public void modifyChunk(IterativeChunkedAggregationOperator.BucketedContext bucketedContext, Chunk<? extends Values> preValues, Chunk<? extends Values> postValues, LongChunk<? extends RowKeys> postShiftRowKeys, IntChunk<RowKeys> destinations, IntChunk<ChunkPositions> startPositions, IntChunk<ChunkLengths> length, WritableBooleanChunk<Values> stateModified) Description copied from interface:IterativeChunkedAggregationOperator
Modify a chunk of data previously aggregated into the result columns using a parallel chunk of new values. Never includes modifies that have been shifted ifIterativeChunkedAggregationOperator.requiresRowKeys()
returns true - those are handled inIterativeChunkedAggregationOperator.shiftChunk(BucketedContext, Chunk, Chunk, LongChunk, LongChunk, IntChunk, IntChunk, IntChunk, WritableBooleanChunk)
.- Specified by:
modifyChunk
in interfaceIterativeChunkedAggregationOperator
- Parameters:
bucketedContext
- the operator-specific contextpreValues
- a chunk of values that have been previously aggregatedpostValues
- a chunk of values to aggregatepostShiftRowKeys
- the input row keys, in post-shift spacedestinations
- the destinations in resultColumn to remove the values from, parallel with startPositions and lengthstartPositions
- the starting positions in the chunk for each destinationlength
- the number of values in the chunk for each destinationstateModified
- a boolean output array, parallel to destinations, which is set to true if the corresponding destination has been modified
-
addChunk
public boolean addChunk(IterativeChunkedAggregationOperator.SingletonContext singletonContext, int chunkSize, Chunk<? extends Values> values, LongChunk<? extends RowKeys> inputRowKeys, long destination) Description copied from interface:IterativeChunkedAggregationOperator
Aggregate a chunk of data into the result columns.- Specified by:
addChunk
in interfaceIterativeChunkedAggregationOperator
- Parameters:
singletonContext
- the operator-specific contextchunkSize
- the size of the additionvalues
- the values to aggregateinputRowKeys
- the input row keys, in post-shift spacedestination
- the destination in the result columns- Returns:
- true if the state was modified, false otherwise
-
removeChunk
public boolean removeChunk(IterativeChunkedAggregationOperator.SingletonContext singletonContext, int chunkSize, Chunk<? extends Values> values, LongChunk<? extends RowKeys> inputRowKeys, long destination) Description copied from interface:IterativeChunkedAggregationOperator
Remove a chunk of data previously aggregated into the result columns.- Specified by:
removeChunk
in interfaceIterativeChunkedAggregationOperator
- Parameters:
singletonContext
- the operator-specific contextchunkSize
- the size of the removalvalues
- the values to remove from the aggregationinputRowKeys
- the input row keys, in pre-shift spacedestination
- the destination in the result columns- Returns:
- true if the state was modified, false otherwise
-
modifyChunk
public boolean modifyChunk(IterativeChunkedAggregationOperator.SingletonContext context, int chunkSize, Chunk<? extends Values> previousValues, Chunk<? extends Values> newValues, LongChunk<? extends RowKeys> postShiftRowKeys, long destination) Description copied from interface:IterativeChunkedAggregationOperator
Modify a chunk of data previously aggregated into the result columns using a parallel chunk of new values. Never includes modifies that have been shifted ifIterativeChunkedAggregationOperator.requiresRowKeys()
returns true - those are handled inIterativeChunkedAggregationOperator.shiftChunk(SingletonContext, Chunk, Chunk, LongChunk, LongChunk, long)
.- Specified by:
modifyChunk
in interfaceIterativeChunkedAggregationOperator
- Parameters:
context
- the operator-specific contextchunkSize
- the size of the modificationpreviousValues
- a chunk of values that have been previously aggregated.newValues
- a chunk of values to aggregatepostShiftRowKeys
- the input row keys, in post-shift space- Returns:
- true if the state was modified, false otherwise
-
propagateInitialState
public void propagateInitialState(@NotNull @NotNull QueryTable resultTable, int startingDestinationsCount) Description copied from interface:IterativeChunkedAggregationOperator
Perform any internal state keeping needed for destinations that were added during initialization.- Specified by:
propagateInitialState
in interfaceIterativeChunkedAggregationOperator
- Parameters:
resultTable
- The resultQueryTable
after initializationstartingDestinationsCount
- The number of used destinations at the beginning of this step
-
resetForStep
Description copied from interface:IterativeChunkedAggregationOperator
Reset any per-step internal state. Note that the arguments to this method should not be mutated in any way.- Specified by:
resetForStep
in interfaceIterativeChunkedAggregationOperator
- Parameters:
upstream
- The upstream ShiftAwareListener.UpdatestartingDestinationsCount
- The number of used destinations at the beginning of this step
-
propagateUpdates
public void propagateUpdates(@NotNull @NotNull TableUpdate downstream, @NotNull @NotNull RowSet newDestinations) Description copied from interface:IterativeChunkedAggregationOperator
Perform any internal state keeping needed for destinations that were added (went from 0 keys to > 0), removed (went from > 0 keys to 0), or modified (keys added or removed, or keys modified) by this iteration. Note that the arguments to this method should not be mutated in any way.- Specified by:
propagateUpdates
in interfaceIterativeChunkedAggregationOperator
- Parameters:
downstream
- The downstream TableUpdate (which does not have itsModifiedColumnSet
finalized yet)newDestinations
- New destinations added on this update
-
ensureCapacity
public void ensureCapacity(long tableSize) Description copied from interface:IterativeChunkedAggregationOperator
Ensure that this operator can handle destinations up to tableSize - 1.- Specified by:
ensureCapacity
in interfaceIterativeChunkedAggregationOperator
- Parameters:
tableSize
- the new size of the table
-
getResultColumns
Description copied from interface:IterativeChunkedAggregationOperator
Return a map of result columns produced by this operator.- Specified by:
getResultColumns
in interfaceIterativeChunkedAggregationOperator
- Returns:
- a map of name to columns for the result table
-
startTrackingPrevValues
public void startTrackingPrevValues()Description copied from interface:IterativeChunkedAggregationOperator
Called after initialization; when the operator's result columns must have previous tracking enabled.- Specified by:
startTrackingPrevValues
in interfaceIterativeChunkedAggregationOperator
-
makeSingletonContext
Description copied from interface:IterativeChunkedAggregationOperator
Make aIterativeChunkedAggregationOperator.SingletonContext
suitable for this operator if necessary.- Specified by:
makeSingletonContext
in interfaceIterativeChunkedAggregationOperator
- Parameters:
size
- The maximum size of input chunks that will be used with the result context- Returns:
- A new
IterativeChunkedAggregationOperator.SingletonContext
, or null if none is necessary
-
makeBucketedContext
Description copied from interface:IterativeChunkedAggregationOperator
Make aIterativeChunkedAggregationOperator.BucketedContext
suitable for this operator if necessary.- Specified by:
makeBucketedContext
in interfaceIterativeChunkedAggregationOperator
- Parameters:
size
- The maximum size of input chunks that will be used with the result context- Returns:
- A new
IterativeChunkedAggregationOperator.BucketedContext
, or null if none is necessary
-
makeSecondaryOperator
public IterativeChunkedAggregationOperator makeSecondaryOperator(double percentile, @NotNull @NotNull String resultName)
-