Class FloatSparseArraySource

All Implemented Interfaces:
ChunkSink<Values>, ChunkSource<Values>, ChunkSource.WithPrev<Values>, ColumnSource<Float>, ElementSource<Float>, FillContextMaker, GetContextMaker, ColumnSourceGetDefaults.ForFloat, DefaultChunkSource<Values>, DefaultChunkSource.WithPrev<Values>, MutableColumnSource<Float>, MutableColumnSourceGetDefaults.ForFloat, DeferredGroupingColumnSource<Float>, FillUnordered<Values>, InMemoryColumnSource, PossiblyImmutableColumnSource, ShiftData.RowSetShiftCallback, Releasable, TupleExporter<Float>, TupleSource<Float>, WritableColumnSource<Float>, WritableSourceWithPrepareForParallelPopulation

public class FloatSparseArraySource extends SparseArrayColumnSource<Float> implements MutableColumnSourceGetDefaults.ForFloat
Sparse array source for Float.

The C-haracterSparseArraySource is replicated to all other types with io.deephaven.engine.table.impl.sources.Replicate. (C-haracter is deliberately spelled that way in order to prevent Replicate from altering this very comment).

  • Field Details

    • prevFlusher

      protected transient UpdateCommitter<FloatSparseArraySource> prevFlusher
      The presence of a prevFlusher means that this ArraySource wants to track previous values. If prevFlusher is null, the ArraySource does not want (or does not yet want) to track previous values. Deserialized ArraySources never track previous values.
    • blocks

      protected FloatOneOrN.Block0 blocks
    • prevBlocks

      protected transient FloatOneOrN.Block0 prevBlocks
  • Constructor Details

    • FloatSparseArraySource

      public FloatSparseArraySource()
  • Method Details

    • ensureCapacity

      public void ensureCapacity(long capacity, boolean nullFill)
      Description copied from interface: WritableColumnSource
      Ensure that this WritableColumnSource can accept row keys in range [0, capacity).
      Specified by:
      ensureCapacity in interface WritableColumnSource<Float>
      Parameters:
      capacity - The new minimum capacity
      nullFill - Whether data should be "null-filled". If true, get operations at row keys that have not been set will return the appropriate null value; otherwise such gets produce undefined results.
    • setNull

      public void setNull(long key)
      Specified by:
      setNull in interface WritableColumnSource<Float>
    • set

      public final void set(long key, float value)
      Specified by:
      set in interface WritableColumnSource<Float>
      Overrides:
      set in class SparseArrayColumnSource<Float>
    • shift

      public void shift(RowSet keysToShift, long shiftDelta)
      Specified by:
      shift in interface ShiftData.RowSetShiftCallback
    • set

      public void set(long key, Float value)
      Specified by:
      set in interface WritableColumnSource<Float>
    • get

      public Float 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 ColumnSourceGetDefaults.ForFloat
      Specified by:
      get in interface ElementSource<Float>
      Parameters:
      rowKey - the location in key space to get the value from.
      Returns:
      the value at the rowKey, potentially null.
    • getPrev

      public Float getPrev(long rowKey)
      Description copied from interface: ElementSource
      Get the previous value at the rowKey. Previous values are used during an UG update cycle to process changes in data. During normal operation previous values will be identical to current values. RowKeys that were not present are undefined.
      Specified by:
      getPrev in interface ElementSource<Float>
      Specified by:
      getPrev in interface MutableColumnSourceGetDefaults.ForFloat
      Parameters:
      rowKey - the location in key space to get the value from.
      Returns:
      the previous value at the rowKey, potentially null.
    • getFloat

      public final 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
    • getPrevFloat

      public final float getPrevFloat(long rowKey)
      Description copied from interface: ElementSource
      Get the previous value at the rowKey as a float. See ElementSource.getPrev(long) for more details. RowKeys that were not present are undefined.
      Specified by:
      getPrevFloat in interface ElementSource<Float>
      Parameters:
      rowKey - the location in key space to get the previous value from.
      Returns:
      the previous float at the rowKey, null values are represented by QueryConstants.NULL_FLOAT
    • startTrackingPrevValues

      public void startTrackingPrevValues()
      Description copied from interface: ColumnSource
      ColumnSource implementations that track previous values have the option to not actually start tracking previous values until this method is called. This is an option, not an obligation: some simple ColumnSource implementations (like TSingleValueSource for various T) always track previous values; other implementations (like PrevColumnSource) never do; some (like TArrayColumnSource) only start tracking once this method is called. An immutable column source can not have distinct prev values; therefore it is implemented as a no-op.
      Specified by:
      startTrackingPrevValues in interface ColumnSource<Float>
    • prepareForParallelPopulation

      public void prepareForParallelPopulation(RowSequence changedRows)
      Description copied from interface: WritableSourceWithPrepareForParallelPopulation
      Prepare this column source such that:
      • all values in rowSet may be accessed using getPrev
      • all values in rowSet may be populated in parallel

      Further operations in this cycle need not check for previous when writing data to the column source; you must provide a row set that contains every row that may be written to this column source.

      Specified by:
      prepareForParallelPopulation in interface WritableSourceWithPrepareForParallelPopulation
      Parameters:
      changedRows - the row sequence of values that will change on this cycle
    • fillFromChunkUnordered

      public void fillFromChunkUnordered(@NotNull @NotNull ChunkSink.FillFromContext context, @NotNull @NotNull Chunk<? extends Values> src, @NotNull @NotNull LongChunk<RowKeys> keys)
      Description copied from interface: ChunkSink
      Fills the ChunkSink with data from the source, with data corresponding to the keys from the given key chunk.
      Specified by:
      fillFromChunkUnordered in interface ChunkSink<Values>
      Specified by:
      fillFromChunkUnordered in interface WritableColumnSource<Float>
      Parameters:
      context - A context containing all mutable/state related data used in writing the Chunk.
      src - The source of the data RowSequence
      keys - A LongChunk representing the keys to be written
    • fillPrevChunk

      public void fillPrevChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> dest, @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.
      dest - 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
    • getChunk

      public FloatChunk<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
    • getPrevChunk

      public FloatChunk<Values> getPrevChunk(@NotNull @NotNull ChunkSource.GetContext context, @NotNull @NotNull RowSequence rowSequence)
      Description copied from interface: ChunkSource.WithPrev
      Returns a chunk of previous data corresponding to the keys from the given RowSequence.
      Specified by:
      getPrevChunk in interface ChunkSource.WithPrev<Values>
      Specified by:
      getPrevChunk in interface DefaultChunkSource.WithPrev<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