Interface BarrageCopyKernel
public interface BarrageCopyKernel
Typed kernel for gathering one column of a coalesced Barrage update out of the chunks of the per-cycle updates it was
built from. The caller describes where every output row comes from as
BarrageCopyKernel.Runs; this kernel owns how the data
moves.
Replicated per chunk type only so the loop's copy call stays monomorphic. One shared implementation would see every chunk class, go megamorphic, and stop the typed copy inlining: measured a third slower at short run lengths.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classWhere every row of one output column comes from, as stretches that are contiguous in both the output and the delta chunk they come from: for each, the first output position, the encoded origin of its first row (seeoriginOffset(int, boolean)) and how many rows follow contiguously. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final intstatic final intstatic final long -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy(BarrageCopyKernel.Runs runs, WritableChunk<Values>[] dest, WritableChunk<Values>[][] addChunks, WritableChunk<Values>[][] modChunks, int deltaChunkSize) Fill one column's output chunks from one column's per-delta chunks, followingruns.static BarrageCopyKernelmakeBarrageCopyKernel(ChunkType chunkType) The kernel forchunkType: a stateless shared instance, not a new one, named to matchCopyKernel.makeCopyKernel(io.deephaven.chunk.ChunkType).static longoriginOffset(int deltaIndex, boolean fromModChunks) Position zero of one side (adds or mods) of one delta, in the bit layout above.
-
Field Details
-
DELTA_POSITION_MASK
static final long DELTA_POSITION_MASK- See Also:
-
DELTA_INDEX_SHIFT
static final int DELTA_INDEX_SHIFT- See Also:
-
DELTA_INDEX_MASK
static final long DELTA_INDEX_MASK- See Also:
-
DELTA_MOD_FLAG_BIT
static final int DELTA_MOD_FLAG_BIT- See Also:
-
-
Method Details
-
originOffset
static long originOffset(int deltaIndex, boolean fromModChunks) Position zero of one side (adds or mods) of one delta, in the bit layout above. Add a position within that side's chunks, or shift a whole row set of positions by it, for the encoded originsBarrageCopyKernel.Runscarries. -
makeBarrageCopyKernel
The kernel forchunkType: a stateless shared instance, not a new one, named to matchCopyKernel.makeCopyKernel(io.deephaven.chunk.ChunkType). -
copy
void copy(BarrageCopyKernel.Runs runs, WritableChunk<Values>[] dest, WritableChunk<Values>[][] addChunks, WritableChunk<Values>[][] modChunks, int deltaChunkSize) Fill one column's output chunks from one column's per-delta chunks, followingruns.Each run is split wherever it crosses an origin or destination chunk boundary, and every resulting stretch moves with one typed array copy. An implementation casts the chunk arrays to its own chunk type once per call, so there is nothing worth keeping between calls and nothing to close afterwards.
- Parameters:
runs- where every output row comes from, in output orderdest- the output chunks to fill, all ofdeltaChunkSizerows except the last, holdingruns.totalRowsrows between themaddChunks- the add delta chunks for this column, indexed by the delta index a run's origin encodesmodChunks- the mod delta chunks for this column, indexed the same waydeltaChunkSize- the number of rows in every delta chunk except the last of a column, which is what lets an encoded position locate its chunk. Must be a power of two.
-