Class ObjectChunkColumnSource<T>

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

public class ObjectChunkColumnSource<T> extends AbstractColumnSource<T> implements ImmutableColumnSourceGetDefaults.ForObject<T>, ChunkColumnSource<T>
A column source backed by ObjectChunks.

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

    • ObjectChunkColumnSource

      protected ObjectChunkColumnSource(Class<T> type, Class<?> componentType)
    • ObjectChunkColumnSource

      protected ObjectChunkColumnSource(Class<T> type, Class<?> componentType, gnu.trove.list.array.TLongArrayList firstOffsetForData)
  • Method Details

    • get

      public T get(long rowKey)
      Description copied from interface: ElementSource
      Get the value from the source. This may return boxed values for basic types. RowKeys that are not present are undefined.
      Specified by:
      get in interface ElementSource<T>
      Parameters:
      rowKey - the location in key space to get the value from.
      Returns:
      the value at the rowKey, potentially null.
    • 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<T>
      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<T>
      Specified by:
      getChunk in interface DefaultChunkSource<T>
      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<T>
      Overrides:
      fillChunk in class AbstractColumnSource<T>
      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<T>
      Overrides:
      fillPrevChunk in class AbstractColumnSource<T>
      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 WritableObjectChunk<T,? 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<T>
      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<T>
    • 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<T>
      Returns:
      the size of this column source