Class ByteSparseArraySource

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

public class ByteSparseArraySource extends SparseArrayColumnSource<Byte> implements MutableColumnSourceGetDefaults.ForByte
Sparse array source for Byte.

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<ByteSparseArraySource> 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 ByteOneOrN.Block0 blocks
    • prevBlocks

      protected transient ByteOneOrN.Block0 prevBlocks
  • Constructor Details

    • ByteSparseArraySource

      public ByteSparseArraySource()
  • 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<Byte>
      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<Byte>
    • set

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

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

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

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

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

      public final byte getByte(long rowKey)
      Description copied from interface: ElementSource
      Get the value at the rowKey as a byte. RowKeys that are not present are undefined.
      Specified by:
      getByte in interface ElementSource<Byte>
      Parameters:
      rowKey - the location in key space to get the value from.
      Returns:
      the boolean at the rowKey, null values are represented by QueryConstants.NULL_BYTE
    • getPrevByte

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