Interface BarrageCopyKernel
public interface BarrageCopyKernel
Typed kernel for copying individual cells from per-delta source chunks into a destination chunk, using a pre-computed
encoded mapping array. Each mapping entry encodes (deltaIndex, add-or-mod flag, position) in a single long using the
bit constants defined here.
Using a typed kernel avoids the virtual dispatch and System.arraycopy overhead of calling
WritableChunk.copyFromChunk(src, offset, pos, 1) for each cell.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBase context for a BarrageCopyKernel. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final intstatic final intstatic final long -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyFromDeltaChunks(long[] mapping, WritableChunk<Values> dest, BarrageCopyKernel.BarrageCopyKernelContext context) Copy cells from per-delta source chunk arrays into a destination chunk.static BarrageCopyKernelmakeBarrageCopyKernel(ChunkType chunkType) makeContext(WritableChunk<Values>[][] addChunks, WritableChunk<Values>[][] modChunks, int deltaChunkSize) Create a context for this copy kernel that will contain add / mod delta chunks cast to the correct type.
-
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
-
makeBarrageCopyKernel
-
makeContext
BarrageCopyKernel.BarrageCopyKernelContext makeContext(WritableChunk<Values>[][] addChunks, WritableChunk<Values>[][] modChunks, int deltaChunkSize) Create a context for this copy kernel that will contain add / mod delta chunks cast to the correct type.- Parameters:
addChunks- the add delta chunks (per delta)modChunks- the mod delta chunks (per delta)- Returns:
- a context that can be passed to
copyFromDeltaChunks(long[], WritableChunk, BarrageCopyKernelContext)to drive the copy from the add / mod delta chunks into the output chunk.
-
copyFromDeltaChunks
void copyFromDeltaChunks(long[] mapping, WritableChunk<Values> dest, BarrageCopyKernel.BarrageCopyKernelContext context) Copy cells from per-delta source chunk arrays into a destination chunk.- Parameters:
mapping- encoded source references, one per output positiondest- the output chunk to fill (sized tomapping.length)context- the context returned frommakeContext(WritableChunk[][], WritableChunk[][], int)that contains the correctly typed add / mod delta chunks to drive the copy.
-