Class UpdateByOperator.Context
java.lang.Object
io.deephaven.engine.table.impl.updateby.UpdateByOperator.Context
- All Implemented Interfaces:
SafeCloseable
,AutoCloseable
- Direct Known Subclasses:
BaseByteUpdateByOperator.Context
,BaseCharUpdateByOperator.Context
,BaseDoubleUpdateByOperator.Context
,BaseFloatUpdateByOperator.Context
,BaseIntUpdateByOperator.Context
,BaseLongUpdateByOperator.Context
,BaseObjectUpdateByOperator.Context
,BaseShortUpdateByOperator.Context
,BooleanRollingFormulaOperator.Context
,ByteRollingFormulaOperator.Context
,CharRollingFormulaOperator.Context
,DoubleRollingFormulaOperator.Context
,FloatRollingFormulaOperator.Context
,IntRollingFormulaOperator.Context
,LongRollingFormulaOperator.Context
,ObjectRollingFormulaOperator.Context
,RollingGroupOperator.Context
,ShortRollingFormulaOperator.Context
- Enclosing class:
- UpdateByOperator
A context item for use with updateBy operators
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LongChunk<OrderedRowKeys>
protected LongChunk<OrderedRowKeys>
protected int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
accumulateCumulative
(RowSequence inputKeys, Chunk<? extends Values>[] valueChunkArr, LongChunk<? extends Values> tsChunk, int len) For cumulative operators only, this method will be called to pass the input chunk data to the operator and produce the output data values.abstract void
accumulateRolling
(RowSequence inputKeys, Chunk<? extends Values>[] influencerValueChunkArr, LongChunk<OrderedRowKeys> affectedPosChunk, LongChunk<OrderedRowKeys> influencerPosChunk, IntChunk<? extends Values> pushChunk, IntChunk<? extends Values> popChunk, int affectedCount, int influencerCount) For windowed operators only, this method will be called to pass the input chunk data to the operator and produce the output data values.boolean
isValueValid
(long atKey) protected void
pop
(int count) Remove values from the operators current data set.protected abstract void
push
(int pos, int count) Add values to the operators current data setprotected abstract void
reset()
Reset the operator data values to a known state.protected void
setPosChunks
(LongChunk<OrderedRowKeys> affectedPosChunk, LongChunk<OrderedRowKeys> influencerPosChunk) protected abstract void
setValueChunks
(@NotNull Chunk<? extends Values>[] valueChunks) protected abstract void
writeToOutputChunk
(int outIdx) Write the current value for this row to the output chunkprotected abstract void
writeToOutputColumn
(@NotNull RowSequence inputKeys) Write the output chunk to the output columnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.util.SafeCloseable
close
-
Field Details
-
nullCount
protected int nullCount -
affectedPosChunk
-
influencerPosChunk
-
-
Constructor Details
-
Context
public Context()
-
-
Method Details
-
isValueValid
public boolean isValueValid(long atKey) -
setValueChunks
-
setPosChunks
protected void setPosChunks(LongChunk<OrderedRowKeys> affectedPosChunk, LongChunk<OrderedRowKeys> influencerPosChunk) -
push
protected abstract void push(int pos, int count) Add values to the operators current data set- Parameters:
pos
- the index in the associated chunk where this value can be found. Depending on the usage, might be a values chunk (for cumulative operators) or an influencer values chunk (for windowed). It is the task of the operator to pull the data from the chunk and use it properlycount
- the number of items to push from the chunk
-
pop
protected void pop(int count) Remove values from the operators current data set. This is only valid for windowed operators as cumulative operators only append values- Parameters:
count
- the number of items to pop from the data set
-
accumulateCumulative
public abstract void accumulateCumulative(RowSequence inputKeys, Chunk<? extends Values>[] valueChunkArr, LongChunk<? extends Values> tsChunk, int len) For cumulative operators only, this method will be called to pass the input chunk data to the operator and produce the output data values.- Parameters:
inputKeys
- the keys for the input data rows (also matches the output keys)valueChunkArr
- the input data chunks needed by the operator for internal calculationstsChunk
- the timestamp chunk for the input data (if applicable)len
- the number of items in the input data chunks
-
accumulateRolling
public abstract void accumulateRolling(RowSequence inputKeys, Chunk<? extends Values>[] influencerValueChunkArr, LongChunk<OrderedRowKeys> affectedPosChunk, LongChunk<OrderedRowKeys> influencerPosChunk, IntChunk<? extends Values> pushChunk, IntChunk<? extends Values> popChunk, int affectedCount, int influencerCount) For windowed operators only, this method will be called to pass the input chunk data to the operator and produce the output data values. It is important to note that the size of the influencer (input) and affected (output) chunks are not likely be the same. We pass these sizes explicitly to the operators for the sake of the operators (such asCountWhereOperator
with zero input columns) where no input chunks are provided but we must still process the exact number of input rows.- Parameters:
inputKeys
- the keys for the input data rows (also matches the output keys)influencerValueChunkArr
- the input data chunks needed by the operator for internal calculations, these values will be pushed and popped into the current windowaffectedPosChunk
- the row positions of the affected rowsinfluencerPosChunk
- the row positions of the influencer rowspushChunk
- a chunk containing the push instructions for each output row to be calculatedpopChunk
- a chunk containing the pop instructions for each output row to be calculatedaffectedCount
- how many affected (output) rows are being computedinfluencerCount
- how many influencer (input) rows are needed for the computation
-
writeToOutputChunk
protected abstract void writeToOutputChunk(int outIdx) Write the current value for this row to the output chunk -
writeToOutputColumn
Write the output chunk to the output column -
reset
@OverridingMethodsMustInvokeSuper protected abstract void reset()Reset the operator data values to a known state. This may occur during initialization or when a windowed operator has an empty window
-