Class ObjectSparseArraySource<T>

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

public class ObjectSparseArraySource<T> extends SparseArrayColumnSource<T> implements MutableColumnSourceGetDefaults.ForObject<T>
Sparse array source for Object.

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<ObjectSparseArraySource> 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 ObjectOneOrN.Block0<T> blocks
    • prevBlocks

      protected transient ObjectOneOrN.Block0<T> prevBlocks
  • Constructor Details

    • ObjectSparseArraySource

      public ObjectSparseArraySource(Class<T> type)
  • 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<T>
      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<T>
    • set

      public final void set(long key, T value)
      Specified by:
      set in interface WritableColumnSource<T>
    • 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
    • get

      public final 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.
    • getPrev

      public final T 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<T>
      Parameters:
      rowKey - the location in key space to get the value from.
      Returns:
      the previous value at the rowKey, potentially null.
    • 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<T>
    • 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<T>
      Specified by:
      fillFromChunkUnordered in interface WritableColumnSource<T>
      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<T>
      Overrides:
      fillPrevChunk in class AbstractColumnSource<T>
      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 ObjectChunk<T,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
    • getPrevChunk

      public ObjectChunk<T,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<T>
      Specified by:
      getPrevChunk in interface DefaultChunkSource.WithPrev<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