Class ObjectArrayExpansionKernel

java.lang.Object
io.deephaven.extensions.barrage.chunk.array.ObjectArrayExpansionKernel
All Implemented Interfaces:
ArrayExpansionKernel

public class ObjectArrayExpansionKernel extends Object implements ArrayExpansionKernel
  • Constructor Details

    • ObjectArrayExpansionKernel

      public ObjectArrayExpansionKernel(Class<?> componentType)
  • Method Details

    • expand

      public <T, A extends Any> WritableChunk<A> expand(ObjectChunk<T,A> source, WritableIntChunk<ChunkPositions> perElementLengthDest)
      Description copied from interface: ArrayExpansionKernel
      This expands the source from a T[] per element to a flat T per element. The kernel records the number of consecutive elements that belong to a row in perElementLengthDest. The returned chunk is owned by the caller.
      Specified by:
      expand in interface ArrayExpansionKernel
      Parameters:
      source - the source chunk of T[] to expand
      perElementLengthDest - the destination IntChunk for which dest.get(i + 1) - dest.get(i) is equivalent to source.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: ArrayExpansionKernel
      This contracts the source from a pair of LongChunk and Chunk<T> and produces a Chunk<T[]>. The returned chunk is owned by the caller.
      Specified by:
      contract in interface ArrayExpansionKernel
      Parameters:
      source - the source chunk of T to contract
      perElementLengthDest - the source IntChunk for which dest.get(i + 1) - dest.get(i) is equivalent to source.get(i).length
      outChunk - the returned chunk from an earlier record batch
      outOffset - the offset to start writing into outChunk
      totalRows - the total known rows for this column; if known (else 0)
      Returns:
      a result chunk of T[]