Class IntChunkedSumOperator
java.lang.Object
io.deephaven.engine.table.impl.by.IntChunkedSumOperator
- All Implemented Interfaces:
ChunkSource<Values>
,FillContextMaker
,GetContextMaker
,IterativeChunkedAggregationOperator
public class IntChunkedSumOperator
extends Object
implements IterativeChunkedAggregationOperator, ChunkSource<Values>
Iterative sum operator, extended for absolute values and regular sums.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.table.ChunkSource
ChunkSource.FillContext, ChunkSource.GetContext, ChunkSource.WithPrev<ATTR extends Any>
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.ChunkSource
DEFAULT_FILL_INSTANCE, ZERO_LENGTH_CHUNK_SOURCE_ARRAY
Fields inherited from interface io.deephaven.engine.table.impl.by.IterativeChunkedAggregationOperator
ZERO_LENGTH_ITERATIVE_CHUNKED_AGGREGATION_OPERATOR_ARRAY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChunk
(IterativeChunkedAggregationOperator.BucketedContext context, 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 context, int chunkSize, Chunk<? extends Values> values, LongChunk<? extends RowKeys> inputRowKeys, long destination) Aggregate a chunk of data into the result columns.void
ensureCapacity
(long tableSize) Ensure that this operator can handle destinations up to tableSize - 1.void
fillChunk
(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Values> destination, @NotNull RowSequence rowSequence) Populates the given destination chunk with data corresponding to the keys from the givenRowSequence
.getChunk
(@NotNull ChunkSource.GetContext context, long firstKey, long lastKey) Same asChunkSource.getChunk(GetContext, RowSequence)
, except that you pass in the begin and last keys representing the begin and last (inclusive) keys of a single range rather than anRowSequence
.getChunk
(@NotNull ChunkSource.GetContext context, @NotNull RowSequence rowSequence) Returns a chunk of data corresponding to the keys from the givenRowSequence
.Get the most suitableChunkType
for use with this ChunkSource.Map<String,
? extends ColumnSource<?>> Return a map of result columns produced by this operator.makeFillContext
(int chunkCapacity, SharedContext sharedContext) Allocate a newChunkSource.FillContext
for filling chunks from thisFillContextMaker
, typically aChunkSource
.makeGetContext
(int chunkCapacity, SharedContext sharedContext) Allocate a newChunkSource.GetContext
for retrieving chunks from thisGetContextMaker
, typically aChunkSource
.void
modifyChunk
(IterativeChunkedAggregationOperator.BucketedContext context, Chunk<? extends Values> previousValues, Chunk<? extends Values> newValues, 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
removeChunk
(IterativeChunkedAggregationOperator.BucketedContext context, 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 context, int chunkSize, Chunk<? extends Values> values, LongChunk<? extends RowKeys> inputRowKeys, long destination) Remove a chunk of data previously aggregated into the result columns.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.FillContextMaker
makeFillContext
Methods inherited from interface io.deephaven.engine.table.GetContextMaker
makeGetContext
Methods inherited from interface io.deephaven.engine.table.impl.by.IterativeChunkedAggregationOperator
addRowSet, initializeRefreshing, makeBucketedContext, makeSingletonContext, modifyRowKeys, modifyRowKeys, propagateFailure, propagateInitialState, propagateUpdates, requiresRowKeys, requiresRunFinds, resetForStep, shiftChunk, shiftChunk, unchunkedRowSet
-
Method Details
-
addChunk
public void addChunk(IterativeChunkedAggregationOperator.BucketedContext context, 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:
context
- 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 context, 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:
context
- 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
-
addChunk
public boolean addChunk(IterativeChunkedAggregationOperator.SingletonContext context, 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:
context
- 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 context, 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:
context
- 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 void modifyChunk(IterativeChunkedAggregationOperator.BucketedContext context, Chunk<? extends Values> previousValues, Chunk<? extends Values> newValues, 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:
context
- the operator-specific contextpreviousValues
- a chunk of values that have been previously aggregatednewValues
- 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
-
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
-
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
-
getChunkType
Description copied from interface:ChunkSource
Get the most suitableChunkType
for use with this ChunkSource.- Specified by:
getChunkType
in interfaceChunkSource<Values>
- Returns:
- The ChunkType
-
getChunk
public Chunk<? extends Values> getChunk(@NotNull @NotNull ChunkSource.GetContext context, @NotNull @NotNull RowSequence rowSequence) Description copied from interface:ChunkSource
Returns a chunk of data corresponding to the keys from the givenRowSequence
.- Specified by:
getChunk
in interfaceChunkSource<Values>
- Parameters:
context
- A context containing all mutable/state related data used in retrieving the Chunk. In particular, the Context may be used to provide a Chunk data poolrowSequence
- AnRowSequence
representing the keys to be fetched- Returns:
- A chunk of data corresponding to the keys from the given
RowSequence
-
getChunk
public Chunk<? extends Values> getChunk(@NotNull @NotNull ChunkSource.GetContext context, long firstKey, long lastKey) Description copied from interface:ChunkSource
Same asChunkSource.getChunk(GetContext, RowSequence)
, except that you pass in the begin and last keys representing the begin and last (inclusive) keys of a single range rather than anRowSequence
. Typically you want to call this only if you don't have anRowSequence
, such as during anRowSequence.forAllRowKeyRanges(LongRangeConsumer)
call. In this case, it allows you to avoid creating an intermediaryRowSequence
object.- Specified by:
getChunk
in interfaceChunkSource<Values>
- Parameters:
context
- A context containing all mutable/state related data used in retrieving the Chunk. In particular, the Context may be used to provide a Chunk data poolfirstKey
- The beginning key (inclusive) of the range to fetch in the chunklastKey
- The last key (inclusive) of the range to fetch in the chunk
-
fillChunk
public void fillChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> destination, @NotNull @NotNull RowSequence rowSequence) Description copied from interface:ChunkSource
Populates the given destination chunk with data corresponding to the keys from the givenRowSequence
.- Specified by:
fillChunk
in interfaceChunkSource<Values>
- Parameters:
context
- A context containing all mutable/state related data used in retrieving the Chunk.destination
- The chunk to be populated according torowSequence
. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,rowSequence.size()).rowSequence
- AnRowSequence
representing the keys to be fetched
-