Class DoubleSparseArraySource

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

public class DoubleSparseArraySource extends SparseArrayColumnSource<Double> implements MutableColumnSourceGetDefaults.ForDouble
Sparse array source for Double.

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<DoubleSparseArraySource> 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 DoubleOneOrN.Block0 blocks
    • prevBlocks

      protected transient DoubleOneOrN.Block0 prevBlocks
  • Constructor Details

    • DoubleSparseArraySource

      public DoubleSparseArraySource()
  • 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<Double>
      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<Double>
    • set

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

      public void shift(RowSet keysToShift, long shiftDelta)
      Description copied from interface: RowSetShiftCallback
      Signals that the row keys in rowSet should be shifted by the provided shiftDelta.
      Specified by:
      shift in interface RowSetShiftCallback
      Parameters:
      keysToShift - The row keys to shift
      shiftDelta - The shift delta to apply to each row key in rowSet
    • set

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

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

      public Double 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<Double>
      Specified by:
      getPrev in interface MutableColumnSourceGetDefaults.ForDouble
      Parameters:
      rowKey - the location in key space to get the value from.
      Returns:
      the previous value at the rowKey, potentially null.
    • getDouble

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

      public final double getPrevDouble(long rowKey)
      Description copied from interface: ElementSource
      Get the previous value at the rowKey as a double. See ElementSource.getPrev(long) for more details. RowKeys that were not present are undefined.
      Specified by:
      getPrevDouble in interface ElementSource<Double>
      Parameters:
      rowKey - the location in key space to get the previous value from.
      Returns:
      the previous double at the rowKey, null values are represented by QueryConstants.NULL_DOUBLE
    • 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<Double>
    • 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<Double>
      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<Double>
      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 DoubleChunk<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 DoubleChunk<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