Class AbstractStaticUpdateByOperator
java.lang.Object
com.illumon.iris.db.v2.updateby.internal.AbstractStaticUpdateByOperator
- All Implemented Interfaces:
ChunkedUpdateByOperator
- Direct Known Subclasses:
BaseObjectBinaryStaticOperator
,BaseStaticEMAOperator
,BigNumberStaticEMAOperator
,BooleanStaticChunkedFillByOperator
,BooleanStaticCumSumOperator
,ByteStaticChunkedFillByOperator
,ByteStaticCumMinMaxOperator
,ByteStaticCumProdOperator
,ByteStaticCumSumOperator
,CharStaticChunkedFillByOperator
,DoubleStaticChunkedFillByOperator
,DoubleStaticCumMinMaxOperator
,DoubleStaticCumProdOperator
,DoubleStaticCumSumOperator
,FloatStaticChunkedFillByOperator
,FloatStaticCumMinMaxOperator
,FloatStaticCumProdOperator
,FloatStaticCumSumOperator
,IntegerStaticCumMinMaxOperator
,IntegerStaticCumProdOperator
,IntegerStaticCumSumOperator
,IntStaticChunkedFillByOperator
,LongRecordingUpdateByOperator
,LongStaticChunkedFillByOperator
,LongStaticCumMinMaxOperator
,LongStaticCumProdOperator
,LongStaticCumSumOperator
,ObjectStaticChunkedFillByOperator
,ShortStaticChunkedFillByOperator
,ShortStaticCumMinMaxOperator
,ShortStaticCumProdOperator
,ShortStaticCumSumOperator
public abstract class AbstractStaticUpdateByOperator extends Object implements ChunkedUpdateByOperator
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.updateby.ChunkedUpdateByOperator
ChunkedUpdateByOperator.BucketedUpdateContext, ChunkedUpdateByOperator.UpdateContext
-
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.updateby.ChunkedUpdateByOperator
ZERO_LENGTH_OP_ARRAY
-
Constructor Summary
Constructors Constructor Description AbstractStaticUpdateByOperator()
-
Method Summary
Modifier and Type Method Description boolean
anyModified(ChunkedUpdateByOperator.BucketedUpdateContext ctx)
Check if the update has modified any rows for this operator.boolean
anyModified(ChunkedUpdateByOperator.UpdateContext ctx)
Check if the update has modified any rows for this operator.void
applyShift(ChunkedUpdateByOperator.UpdateContext updateContext, ReadOnlyIndex prevIndex, IndexShiftData shifted)
Apply a shift to the operation.void
finishFor(ChunkedUpdateByOperator.BucketedUpdateContext updateContext, UpdateBy.UpdateType type)
Perform and bookkeeping required at the end of a single part of the update.void
finishFor(ChunkedUpdateByOperator.UpdateContext updateContext, UpdateBy.UpdateType type)
Perform and bookkeeping required at the end of a single part of the update.ReadOnlyIndex
getAdditionalModifications(ChunkedUpdateByOperator.UpdateContext ctx)
Get an index of rows that were modified beyond the input set of modifications from the upstream.void
initializeFor(ChunkedUpdateByOperator.BucketedUpdateContext updateContext, UpdateBy.UpdateType type, ReadOnlyIndex updateIndex)
Initialize the context for the specified stage of the update process.void
initializeFor(ChunkedUpdateByOperator.UpdateContext updateContext, UpdateBy.UpdateType type, ReadOnlyIndex updateIndex)
Initialize the context for the specified stage of the update process.void
modifyChunk(ChunkedUpdateByOperator.UpdateContext updateContext, LongChunk<Attributes.OrderedKeyIndices> prevKeyChunk, LongChunk<Attributes.OrderedKeyIndices> keyChunk, Chunk<Attributes.Values> prevWorkingChunk, Chunk<Attributes.Values> postWorkingChunk, long groupPosition)
Modify a chunk of values with the operation.void
removeChunk(ChunkedUpdateByOperator.UpdateContext updateContext, LongChunk<Attributes.OrderedKeyIndices> keyChunk, Chunk<Attributes.Values> prevWorkingChunk, long groupPosition)
Remove a chunk of values from the operation.void
setBucketCapacity(int capacity)
Notify the operator of the current maximum bucket.void
setUpstream(ChunkedUpdateByOperator.BucketedUpdateContext ctx, ShiftAwareListener.Update upstream)
Set theupstream
update object for this update cycle.void
setUpstream(ChunkedUpdateByOperator.UpdateContext ctx, ShiftAwareListener.Update upstream)
Set theupstream
update object for this update cycle.void
startTrackingPrev()
Indicate that the operation should start tracking previous values for ticking updates.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.v2.updateby.ChunkedUpdateByOperator
addChunk, addChunk, getInputColumnName, getOutputColumnNames, getOutputColumns, makeBucketedContext, makeUpdateContext
-
Constructor Details
-
AbstractStaticUpdateByOperator
public AbstractStaticUpdateByOperator()
-
-
Method Details
-
setBucketCapacity
public void setBucketCapacity(int capacity)Description copied from interface:ChunkedUpdateByOperator
Notify the operator of the current maximum bucket.- Specified by:
setBucketCapacity
in interfaceChunkedUpdateByOperator
- Parameters:
capacity
- the capacity
-
setUpstream
public void setUpstream(@NotNull ChunkedUpdateByOperator.UpdateContext ctx, @NotNull ShiftAwareListener.Update upstream)Description copied from interface:ChunkedUpdateByOperator
Set theupstream
update object for this update cycle.- Specified by:
setUpstream
in interfaceChunkedUpdateByOperator
- Parameters:
ctx
- the context objectupstream
- the upstream update
-
setUpstream
public void setUpstream(@NotNull ChunkedUpdateByOperator.BucketedUpdateContext ctx, @NotNull ShiftAwareListener.Update upstream)Description copied from interface:ChunkedUpdateByOperator
Set theupstream
update object for this update cycle.- Specified by:
setUpstream
in interfaceChunkedUpdateByOperator
- Parameters:
ctx
- the context objectupstream
- the upstream update
-
initializeFor
public void initializeFor(@NotNull ChunkedUpdateByOperator.UpdateContext updateContext, @NotNull UpdateBy.UpdateType type, @NotNull ReadOnlyIndex updateIndex)Description copied from interface:ChunkedUpdateByOperator
Initialize the context for the specified stage of the update process. This will always be followed by a call to
ChunkedUpdateByOperator.finishFor(UpdateContext, UpdateBy.UpdateType)
at the end of each successful update.- Specified by:
initializeFor
in interfaceChunkedUpdateByOperator
- Parameters:
updateContext
- the context objecttype
- the type of update being appliedupdateIndex
- the index of rows associated with the update.
-
initializeFor
public void initializeFor(@NotNull ChunkedUpdateByOperator.BucketedUpdateContext updateContext, @NotNull UpdateBy.UpdateType type, @NotNull ReadOnlyIndex updateIndex)Description copied from interface:ChunkedUpdateByOperator
Initialize the context for the specified stage of the update process. This will always be followed by a call to
ChunkedUpdateByOperator.finishFor(UpdateContext, UpdateBy.UpdateType)
at the end of each successful update.- Specified by:
initializeFor
in interfaceChunkedUpdateByOperator
- Parameters:
updateContext
- the context objecttype
- the type of update being appliedupdateIndex
- the index of rows associated with the update.
-
finishFor
public void finishFor(@NotNull ChunkedUpdateByOperator.UpdateContext updateContext, @NotNull UpdateBy.UpdateType type)Description copied from interface:ChunkedUpdateByOperator
Perform and bookkeeping required at the end of a single part of the update. This is always preceded with a call toChunkedUpdateByOperator.initializeFor(UpdateContext, UpdateBy.UpdateType, ReadOnlyIndex)
- Specified by:
finishFor
in interfaceChunkedUpdateByOperator
- Parameters:
updateContext
- the context objecttype
- the type of update being applied
-
finishFor
public void finishFor(@NotNull ChunkedUpdateByOperator.BucketedUpdateContext updateContext, @NotNull UpdateBy.UpdateType type)Description copied from interface:ChunkedUpdateByOperator
Perform and bookkeeping required at the end of a single part of the update. This is always preceded with a call toChunkedUpdateByOperator.initializeFor(UpdateContext, UpdateBy.UpdateType, ReadOnlyIndex)
- Specified by:
finishFor
in interfaceChunkedUpdateByOperator
- Parameters:
updateContext
- the context objecttype
- the type of update being applied
-
startTrackingPrev
public final void startTrackingPrev()Description copied from interface:ChunkedUpdateByOperator
Indicate that the operation should start tracking previous values for ticking updates.- Specified by:
startTrackingPrev
in interfaceChunkedUpdateByOperator
-
modifyChunk
public final void modifyChunk(@NotNull ChunkedUpdateByOperator.UpdateContext updateContext, @NotNull LongChunk<Attributes.OrderedKeyIndices> prevKeyChunk, @NotNull LongChunk<Attributes.OrderedKeyIndices> keyChunk, @NotNull Chunk<Attributes.Values> prevWorkingChunk, @NotNull Chunk<Attributes.Values> postWorkingChunk, long groupPosition)Description copied from interface:ChunkedUpdateByOperator
Modify a chunk of values with the operation.- Specified by:
modifyChunk
in interfaceChunkedUpdateByOperator
- Parameters:
updateContext
- the context objectprevKeyChunk
- a chunk of pre-shift keys. This will be equal tokeyChunk
if no shift is presentkeyChunk
- a chunk of post-shift space keys for the update.prevWorkingChunk
- a chunk of previous values for the updatepostWorkingChunk
- a chunk of current values for the update
-
removeChunk
public final void removeChunk(@NotNull ChunkedUpdateByOperator.UpdateContext updateContext, @NotNull LongChunk<Attributes.OrderedKeyIndices> keyChunk, @NotNull Chunk<Attributes.Values> prevWorkingChunk, long groupPosition)Description copied from interface:ChunkedUpdateByOperator
Remove a chunk of values from the operation.- Specified by:
removeChunk
in interfaceChunkedUpdateByOperator
- Parameters:
updateContext
- the context objectkeyChunk
- a chunk of keys being removed.prevWorkingChunk
- the chunk of values being removed
-
applyShift
public final void applyShift(@NotNull ChunkedUpdateByOperator.UpdateContext updateContext, @NotNull ReadOnlyIndex prevIndex, @NotNull IndexShiftData shifted)Description copied from interface:ChunkedUpdateByOperator
Apply a shift to the operation.- Specified by:
applyShift
in interfaceChunkedUpdateByOperator
- Parameters:
updateContext
- the context objectprevIndex
- the pre-shifted indexshifted
- the shifts being applied
-
getAdditionalModifications
@NotNull public final ReadOnlyIndex getAdditionalModifications(@NotNull ChunkedUpdateByOperator.UpdateContext ctx)Description copied from interface:ChunkedUpdateByOperator
Get an index of rows that were modified beyond the input set of modifications from the upstream. This is invoked once at the end of a complete update cycle (that is, after all adds, removes, modifies and shifts have been processed) ifChunkedUpdateByOperator.anyModified(UpdateContext)
has returned true.- Specified by:
getAdditionalModifications
in interfaceChunkedUpdateByOperator
- Parameters:
ctx
- the context object- Returns:
- a
index
of additional rows that were modified
-
anyModified
Description copied from interface:ChunkedUpdateByOperator
Check if the update has modified any rows for this operator. This is invoked once at the end of a complete update cycle (that is, after all adds, removes, modifies and shifts have been processed).- Specified by:
anyModified
in interfaceChunkedUpdateByOperator
- Parameters:
ctx
- the context object- Returns:
- true if the update modified any rows.
-
anyModified
Description copied from interface:ChunkedUpdateByOperator
Check if the update has modified any rows for this operator. This is invoked once at the end of a complete update cycle (that is, after all adds, removes, modifies and shifts have been processed).- Specified by:
anyModified
in interfaceChunkedUpdateByOperator
- Parameters:
ctx
- the context object- Returns:
- true if the update modified any rows.
-