Class FloatChunkColumnSource

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

public class FloatChunkColumnSource extends AbstractColumnSource<Float> implements ImmutableColumnSourceGetDefaults.ForFloat, ChunkColumnSource<Float>
A column source backed by FloatChunks.

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

    • FloatChunkColumnSource

      public FloatChunkColumnSource()
    • FloatChunkColumnSource

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

    • getFloat

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