Class DoubleChunkColumnSource

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

public class DoubleChunkColumnSource extends AbstractColumnSource<Double> implements ImmutableColumnSourceGetDefaults.ForDouble, ChunkColumnSource<Double>
A column source backed by DoubleChunks.

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

    • DoubleChunkColumnSource

      public DoubleChunkColumnSource()
    • DoubleChunkColumnSource

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

    • getDouble

      public double getDouble(long rowKey)
      Description copied from interface: ElementSource
      Get the value at the rowKey as a double. RowKeys that are not present are undefined.
      Specified by:
      getDouble in interface ElementSource<Double>
      Parameters:
      rowKey - the location in key space to get the value from.
      Returns:
      the double at the rowKey, null values are represented by QueryConstants.NULL_DOUBLE
    • 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<Double>
      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<Double>
      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 WritableDoubleChunk<? 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<Double>
      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<Double>
    • 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<Double>
      Returns:
      the size of this column source