Class ShortChunkColumnSource

java.lang.Object
io.deephaven.engine.table.impl.AbstractColumnSource<Short>
io.deephaven.engine.table.impl.sources.chunkcolumnsource.ShortChunkColumnSource
All Implemented Interfaces:
ChunkSource<Values>, ChunkSource.WithPrev<Values>, ColumnSource<Short>, ElementSource<Short>, FillContextMaker, GetContextMaker, ColumnSourceGetDefaults.ForShort, DefaultChunkSource<Values>, DefaultChunkSource.WithPrev<Values>, ImmutableColumnSource<Short>, ImmutableColumnSourceGetDefaults.ForShort, ChunkColumnSource<Short>, Releasable, TupleExporter<Short>, TupleSource<Short>

public class ShortChunkColumnSource extends AbstractColumnSource<Short> implements ImmutableColumnSourceGetDefaults.ForShort, ChunkColumnSource<Short>
A column source backed by ShortChunks.

The address space of the column source is dense, with each chunk backing a contiguous set of indices. The getChunk(GetContext, RowSequence) call will return the backing chunk or a slice of the backing chunk if possible.

  • Constructor Details

    • ShortChunkColumnSource

      public ShortChunkColumnSource()
    • ShortChunkColumnSource

      protected ShortChunkColumnSource(gnu.trove.list.array.TLongArrayList firstOffsetForData)
  • Method Details

    • getShort

      public short getShort(long rowKey)
      Description copied from interface: ElementSource
      Get the value at the rowKey as a short. RowKeys that are not present are undefined.
      Specified by:
      getShort in interface ElementSource<Short>
      Parameters:
      rowKey - the location in key space to get the value from.
      Returns:
      the short at the rowKey, null values are represented by QueryConstants.NULL_SHORT
    • makeGetContext

      public ChunkSource.GetContext makeGetContext(int chunkCapacity, SharedContext sharedContext)
      Description copied from interface: GetContextMaker
      Allocate a new ChunkSource.GetContext for retrieving chunks from this GetContextMaker, typically a ChunkSource.
      Specified by:
      makeGetContext in interface DefaultChunkSource<Values>
      Specified by:
      makeGetContext in interface GetContextMaker
      Parameters:
      chunkCapacity - The maximum size required for any WritableChunk allocated as part of the result.
      sharedContext - Shared store of intermediate results.
      Returns:
      A context for use with get operations
    • getChunk

      public Chunk<? extends Values> getChunk(@NotNull @NotNull ChunkSource.GetContext context, @NotNull @NotNull RowSequence rowSequence)
      Description copied from interface: ChunkSource
      Returns a chunk of data corresponding to the keys from the given RowSequence.
      Specified by:
      getChunk in interface ChunkSource<Values>
      Specified by:
      getChunk in interface DefaultChunkSource<Values>
      Parameters:
      context - A context containing all mutable/state related data used in retrieving the Chunk. In particular, the Context may be used to provide a Chunk data pool
      rowSequence - An RowSequence representing the keys to be fetched
      Returns:
      A chunk of data corresponding to the keys from the given RowSequence
    • fillChunk

      public void fillChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> 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<Values>
      Overrides:
      fillChunk in class AbstractColumnSource<Short>
      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 Values> 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<Values>
      Overrides:
      fillPrevChunk in class AbstractColumnSource<Short>
      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
    • addChunk

      public void addChunk(@NotNull @NotNull WritableShortChunk<? extends Values> chunk)
      Append a chunk of data to this column source. The chunk must not be empty (i.e., the size must be greater than zero).
      Parameters:
      chunk - the chunk of data to add
    • addChunk

      public void addChunk(@NotNull @NotNull WritableChunk<? extends Values> chunk)
      Description copied from interface: ChunkColumnSource
      Append a chunk of data to this column source. The chunk must not be empty (i.e., the size must be greater than zero).
      Specified by:
      addChunk in interface ChunkColumnSource<Short>
      Parameters:
      chunk - the chunk of data to add
    • clear

      public void clear()
      Description copied from interface: ChunkColumnSource
      Reset the column source to be ready for reuse.

      Clear will discard the currently held chunks. This should not be called if a table will continue to reference the column source; as it violates the immutability contract.

      Specified by:
      clear in interface ChunkColumnSource<Short>
    • getSize

      public long getSize()
      Description copied from interface: ChunkColumnSource
      Get the size of this column source (one more than the last valid row key).
      Specified by:
      getSize in interface ChunkColumnSource<Short>
      Returns:
      the size of this column source