Class RollingGroupOperator
java.lang.Object
io.deephaven.engine.table.impl.updateby.UpdateByOperator
io.deephaven.engine.table.impl.updateby.rollinggroup.RollingGroupOperator
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WritableColumnSource<Long>protected WritableColumnSource<? extends RowSet>Store a mapping from row keys to bucket RowSetsprotected LongArraySourceprotected ObjectArraySource<? extends RowSet>protected LongArraySourceprotected WritableColumnSource<Long>These sources will retain the position offsets from the current row position for the source and end of this window.Fields inherited from class io.deephaven.engine.table.impl.updateby.UpdateByOperator
affectingColumns, forwardWindowScaleUnits, inputModifiedColumnSet, isWindowed, outputModifiedColumnSet, pair, reverseWindowScaleUnits, rowRedirection, timestampColumnName -
Constructor Summary
ConstructorsModifierConstructorDescriptionRollingGroupOperator(@NotNull MatchPair[] pairs, @NotNull String[] affectingColumns, @Nullable String timestampColumnName, long reverseWindowScaleUnits, long forwardWindowScaleUnits) protectedRollingGroupOperator(@NotNull MatchPair[] pairs, @NotNull String[] affectingColumns, @Nullable String timestampColumnName, long reverseWindowScaleUnits, long forwardWindowScaleUnits, @NotNull String[] inputColumnNames, @NotNull String[] outputColumnNames) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyOutputShift(@NotNull RowSet subRowSetToShift, long delta) Apply a shift to the operation.voidclearOutputRows(RowSet toClear) Clear the output rows by setting value to NULL.copy()Create an uninitialized copy of this operator.protected voidcreateInputModifiedColumnSet(@NotNull QueryTable source) Create the modified column set for the input columns of this operator.protected voidcreateOutputModifiedColumnSet(@NotNull QueryTable result) Create the modified column set for the output columns from this operator.protected voidextractDownstreamModifiedColumnSet(@NotNull TableUpdate upstream, @NotNull TableUpdate downstream) Set the downstream modified column set appropriately for this operator.protected @NotNull String[]Get the names of the input column(s) for this operator.protected @NotNull String[]Get an array of the output column names.@NotNull Map<String,ColumnSource<?>> Get a map of outputName to outputColumnSourcefor this operation.voidinitializeRolling(UpdateByOperator.Context context, @NotNull RowSet bucketRowSet) Initialize the bucket context for a windowed operatorvoidinitializeSources(@NotNull Table source, @Nullable RowRedirection rowRedirection) Initialize this operator with a specific source table (and row redirection if needed).makeUpdateContext(int chunkSize, int influencerChunkSize) Make anUpdateByOperator.Contextsuitable for use with updates.voidprepareForParallelPopulation(RowSet changedRows) Prepare this operator output column for parallel updated.protected booleanReturn whether the operator needs affected and influencer row positions during accumulation.voidIndicate that the operation should start tracking previous values for ticking updates.Methods inherited from class io.deephaven.engine.table.impl.updateby.UpdateByOperator
finishUpdate, getAffectingColumnNames, getFwdWindowUnits, getInputModifiedColumnSet, getOutputModifiedColumnSet, getPrevWindowUnits, getTimestampColumnName, initializeCumulative, initializeCumulativeWithKeyValues, initializeRollingWithKeyValues
-
Field Details
-
groupRowSetSource
Store a mapping from row keys to bucket RowSets -
innerGroupRowSetSource
-
startSource
These sources will retain the position offsets from the current row position for the source and end of this window. A primary benefit of storing offsets in position space vs. row keys is eliminating the need to shift keys stored inside these column sources. Also, any insertion/modification/remove that occurs within this specified window will trigger re-computation of these position offsets.NOTE: these offsets are inclusive and are stored as simple relative positions where start==0 or end==0 implies the current row is included in the window. A start/end range of [-5,-3] defines a window including exactly 3 rows beginning 5 rows earlier than this one and continuing through 3 rows earlier than this (inclusive). A range of [0,0] contains exactly the current row.
-
innerStartSource
-
endSource
-
innerEndSource
-
-
Constructor Details
-
RollingGroupOperator
-
RollingGroupOperator
protected RollingGroupOperator(@NotNull @NotNull MatchPair[] pairs, @NotNull @NotNull String[] affectingColumns, @Nullable @Nullable String timestampColumnName, long reverseWindowScaleUnits, long forwardWindowScaleUnits, @NotNull @NotNull String[] inputColumnNames, @NotNull @NotNull String[] outputColumnNames)
-
-
Method Details
-
copy
Description copied from class:UpdateByOperatorCreate an uninitialized copy of this operator.UpdateByOperator.initializeSources(Table, RowRedirection)must be called before this operator can be used.- Specified by:
copyin classUpdateByOperator- Returns:
- a copy of this operator
-
initializeSources
public void initializeSources(@NotNull @NotNull Table source, @Nullable @Nullable RowRedirection rowRedirection) Description copied from class:UpdateByOperatorInitialize this operator with a specific source table (and row redirection if needed). This will be called exactly once per operator.- Specified by:
initializeSourcesin classUpdateByOperator
-
makeUpdateContext
Description copied from class:UpdateByOperatorMake anUpdateByOperator.Contextsuitable for use with updates.- Specified by:
makeUpdateContextin classUpdateByOperator- Parameters:
chunkSize- The maximum size of affected chunks that will be provided during the update.influencerChunkSize- The maximum size of influencer chunks that will be provided during the update.- Returns:
- a new context
-
prepareForParallelPopulation
Description copied from class:UpdateByOperatorPrepare this operator output column for parallel updated.- Specified by:
prepareForParallelPopulationin classUpdateByOperator
-
initializeRolling
public void initializeRolling(@NotNull UpdateByOperator.Context context, @NotNull @NotNull RowSet bucketRowSet) Description copied from class:UpdateByOperatorInitialize the bucket context for a windowed operator- Overrides:
initializeRollingin classUpdateByOperator
-
applyOutputShift
Description copied from class:UpdateByOperatorApply a shift to the operation.- Specified by:
applyOutputShiftin classUpdateByOperator
-
clearOutputRows
Description copied from class:UpdateByOperatorClear the output rows by setting value to NULL. Dense sources will apply removes to the inner source.- Specified by:
clearOutputRowsin classUpdateByOperator
-
startTrackingPrev
public void startTrackingPrev()Description copied from class:UpdateByOperatorIndicate that the operation should start tracking previous values for ticking updates.- Specified by:
startTrackingPrevin classUpdateByOperator
-
getOutputColumnNames
Get an array of the output column names.- Overrides:
getOutputColumnNamesin classUpdateByOperator- Returns:
- the output column names.
-
getOutputColumns
Get a map of outputName to outputColumnSourcefor this operation.- Specified by:
getOutputColumnsin classUpdateByOperator- Returns:
- a map of output column name to output column source
-
getInputColumnNames
Get the names of the input column(s) for this operator.- Overrides:
getInputColumnNamesin classUpdateByOperator- Returns:
- the names of the input column
-
requiresRowPositions
protected boolean requiresRowPositions()Return whether the operator needs affected and influencer row positions during accumulation. RollingGroup sets this totrue.- Overrides:
requiresRowPositionsin classUpdateByOperator
-
createInputModifiedColumnSet
Create the modified column set for the input columns of this operator.- Overrides:
createInputModifiedColumnSetin classUpdateByOperator
-
createOutputModifiedColumnSet
Create the modified column set for the output columns from this operator.- Overrides:
createOutputModifiedColumnSetin classUpdateByOperator
-
extractDownstreamModifiedColumnSet
protected void extractDownstreamModifiedColumnSet(@NotNull @NotNull TableUpdate upstream, @NotNull @NotNull TableUpdate downstream) Set the downstream modified column set appropriately for this operator.- Overrides:
extractDownstreamModifiedColumnSetin classUpdateByOperator
-