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.

  • Field Details

  • 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 origins BarrageCopyKernel.Runs carries.
    • makeBarrageCopyKernel

      static BarrageCopyKernel makeBarrageCopyKernel(ChunkType chunkType)
      The kernel for chunkType: a stateless shared instance, not a new one, named to match CopyKernel.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, following runs.

      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 order
      dest - the output chunks to fill, all of deltaChunkSize rows except the last, holding runs.totalRows rows between them
      addChunks - the add delta chunks for this column, indexed by the delta index a run's origin encodes
      modChunks - the mod delta chunks for this column, indexed the same way
      deltaChunkSize - 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.