Class ByteArrayExpansionKernel
java.lang.Object
io.deephaven.extensions.barrage.chunk.array.ByteArrayExpansionKernel
- All Implemented Interfaces:
ArrayExpansionKernel
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T,A extends Any>
WritableObjectChunk<T,A> contract(Chunk<A> source, IntChunk<ChunkPositions> perElementLengthDest, WritableChunk<A> outChunk, int outOffset, int totalRows) This contracts the source from a pair ofLongChunkandChunk<T>and produces aChunk<T[]>.<T,A extends Any>
WritableChunk<A>expand(ObjectChunk<T, A> source, WritableIntChunk<ChunkPositions> perElementLengthDest) This expands the source from aT[]per element to a flatTper element.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
ByteArrayExpansionKernel
public ByteArrayExpansionKernel()
-
-
Method Details
-
expand
public <T,A extends Any> WritableChunk<A> expand(ObjectChunk<T, A> source, WritableIntChunk<ChunkPositions> perElementLengthDest) Description copied from interface:ArrayExpansionKernelThis expands the source from aT[]per element to a flatTper element. The kernel records the number of consecutive elements that belong to a row inperElementLengthDest. The returned chunk is owned by the caller.- Specified by:
expandin interfaceArrayExpansionKernel- Parameters:
source- the source chunk of T[] to expandperElementLengthDest- the destination IntChunk for whichdest.get(i + 1) - dest.get(i)is equivalent tosource.get(i).length- Returns:
- an unrolled/flattened chunk of T
-
contract
public <T,A extends Any> WritableObjectChunk<T,A> contract(Chunk<A> source, IntChunk<ChunkPositions> perElementLengthDest, WritableChunk<A> outChunk, int outOffset, int totalRows) Description copied from interface:ArrayExpansionKernelThis contracts the source from a pair ofLongChunkandChunk<T>and produces aChunk<T[]>. The returned chunk is owned by the caller.- Specified by:
contractin interfaceArrayExpansionKernel- Parameters:
source- the source chunk of T to contractperElementLengthDest- the source IntChunk for whichdest.get(i + 1) - dest.get(i)is equivalent tosource.get(i).lengthoutChunk- the returned chunk from an earlier record batchoutOffset- the offset to start writing intooutChunktotalRows- the total known rows for this column; if known (else 0)- Returns:
- a result chunk of T[]
-