Class VectorChunkAdapter<ATTR extends Any>

java.lang.Object
io.deephaven.engine.table.impl.select.VectorChunkAdapter<ATTR>
All Implemented Interfaces:
ChunkSource<ATTR>, ChunkSource.WithPrev<ATTR>, FillContextMaker, GetContextMaker, DefaultChunkSource<ATTR>, DefaultChunkSource.WithPrev<ATTR>

public class VectorChunkAdapter<ATTR extends Any> extends Object implements DefaultChunkSource.WithPrev<ATTR>
This class wraps an inner ChunkSource holding a Vector. The purpose of doing so is to apply Vector#getDirect to the underlying Vector values returned by the underlying ChunkSource. This is the strategy for implementing this class: makeGetContext() - doesn't need to change. The default implementation in our parent, namely DefaultChunkSource#makeGetContext, already does the right thing. getChunk() - likewise. makeFillContext() - We don't need to add anything to the "inner" context, so we just delegate to inner and return its context fillContext() - We first let the inner fill the chunk, then we overwrite each value (where non-null) with the result of Vector#getDirect() invoked on that value.
  • Constructor Details

  • Method Details

    • getChunkType

      public ChunkType getChunkType()
      Description copied from interface: ChunkSource
      Get the most suitable ChunkType for use with this ChunkSource.
      Specified by:
      getChunkType in interface ChunkSource<ATTR extends Any>
      Returns:
      The ChunkType
    • fillChunk

      public void fillChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super ATTR> destination, @NotNull @NotNull RowSequence rowSequence)
      Description copied from interface: ChunkSource
      Populates the given destination chunk with data corresponding to the keys from the given RowSequence.
      Specified by:
      fillChunk in interface ChunkSource<ATTR extends Any>
      Parameters:
      context - A context containing all mutable/state related data used in retrieving the Chunk.
      destination - The chunk to be populated according to rowSequence. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,rowSequence.size()).
      rowSequence - An RowSequence representing the keys to be fetched
    • fillPrevChunk

      public void fillPrevChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super ATTR> destination, @NotNull @NotNull RowSequence rowSequence)
      Description copied from interface: ChunkSource.WithPrev
      Populates the given destination chunk with data corresponding to the keys from the given RowSequence.
      Specified by:
      fillPrevChunk in interface ChunkSource.WithPrev<ATTR extends Any>
      Parameters:
      context - A context containing all mutable/state related data used in retrieving the Chunk.
      destination - The chunk to be populated according to rowSequence. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,rowSequence.size()).
      rowSequence - An RowSequence representing the keys to be fetched
    • makeFillContext

      public ChunkSource.FillContext makeFillContext(int chunkCapacity, SharedContext sharedContext)
      Description copied from interface: FillContextMaker
      Allocate a new ChunkSource.FillContext for filling chunks from this FillContextMaker, typically a ChunkSource.
      Specified by:
      makeFillContext in interface DefaultChunkSource<ATTR extends Any>
      Specified by:
      makeFillContext in interface FillContextMaker
      Parameters:
      chunkCapacity - The maximum size of any WritableChunk that will be filled with this context
      sharedContext - Shared store of intermediate results.
      Returns:
      A context for use with fill operations