Class BooleanSparseArraySource

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

public class BooleanSparseArraySource extends SparseArrayColumnSource<Boolean> implements MutableColumnSourceGetDefaults.ForBoolean
Sparse array source for Boolean.

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<BooleanSparseArraySource> 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

    • BooleanSparseArraySource

      public BooleanSparseArraySource()
  • 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<Boolean>
      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<Boolean>
    • set

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

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

      public Boolean 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<Boolean>
      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 ColumnSourceGetDefaults.ForBoolean
      Specified by:
      getByte in interface ElementSource<Boolean>
      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<Boolean>
      Specified by:
      getPrevByte in interface MutableColumnSourceGetDefaults.ForBoolean
      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<Boolean>
    • 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<Boolean>
      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<Boolean>
      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<Boolean,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 ObjectChunk<Boolean,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
    • allowsReinterpret

      public <ALTERNATE_DATA_TYPE> boolean allowsReinterpret(@NotNull @NotNull Class<ALTERNATE_DATA_TYPE> alternateDataType)
      Description copied from interface: ColumnSource
      Test if a reinterpret call will succeed.
      Specified by:
      allowsReinterpret in interface ColumnSource<Boolean>
      Overrides:
      allowsReinterpret in class AbstractColumnSource<Boolean>
      Parameters:
      alternateDataType - The alternative type to consider
      Returns:
      If a reinterpret on this column source with the supplied alternateDataType will succeed.
    • doReinterpret

      protected <ALTERNATE_DATA_TYPE> ColumnSource<ALTERNATE_DATA_TYPE> doReinterpret(@NotNull @NotNull Class<ALTERNATE_DATA_TYPE> alternateDataType)
      Description copied from class: AbstractColumnSource
      Supply allowed reinterpret results. The default implementation handles the most common case to avoid code duplication.
      Overrides:
      doReinterpret in class AbstractColumnSource<Boolean>
      Parameters:
      alternateDataType - The alternate data type
      Returns:
      The resulting ColumnSource