Class ObjectSparseArraySource<T>

All Implemented Interfaces:
ChunkSource<Attributes.Values>, ChunkSource.WithPrev<Attributes.Values>, DefaultChunkSource<Attributes.Values>, DefaultChunkSource.WithPrev<Attributes.Values>, FillContextMaker, GetContextMaker, ColumnSource<T>, ColumnSourceGetDefaults.ForObject<T>, ElementSource<T>, FillUnordered, MutableColumnSource<T>, MutableColumnSourceGetDefaults.ForObject<T>, Releasable, WritableChunkSink<Attributes.Values>, WritableSource<T>, TupleExporter<T>, TupleSource<T>, Serializable

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 com.illumon.iris.db.v2.sources.Replicate. (C-haracter is deliberately spelled that way in order to prevent Replicate from altering this very comment).

See Also:
  • 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)
      Specified by:
      ensureCapacity in interface WritableSource<T>
    • setNull

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

      public final void set(long key, T value)
      Specified by:
      set in interface WritableSource<T>
    • shift

      public void shift(ReadOnlyIndex keysToShift, long shiftDelta)
      Overrides:
      shift in class SparseArrayColumnSource<T>
    • copy

      public void copy(ColumnSource<T> sourceColumn, long sourceKey, long destKey)
      Specified by:
      copy in interface WritableSource<T>
    • get

      public final T get(long index)
      Description copied from interface: ElementSource
      Get the value from the source. This may return boxed values for basic types.
      Specified by:
      get in interface ElementSource<T>
      Parameters:
      index - the location in index space to get the value from.
      Returns:
      the value at the index, potentially null.
    • getPrev

      public final T getPrev(long index)
      Description copied from interface: ElementSource
      Get the previous value at the index. Previous values are used during an LTM update cycle to process changes in data. During normal operation previous values will be identical to current values.
      Specified by:
      getPrev in interface ElementSource<T>
      Parameters:
      index - the location in index space to get the value from.
      Returns:
      the previous value at the index, or 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>
    • fillFromChunkUnordered

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

      public void fillPrevChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Attributes.Values> dest, @NotNull OrderedKeys orderedKeys)
      Description copied from interface: ChunkSource.WithPrev
      Populates the given destination chunk with data corresponding to the keys from the given OrderedKeys.
      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 orderedKeys. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,orderedKeys.size()).
      orderedKeys - An OrderedKeys representing the keys to be fetched
    • getChunk

      public ObjectChunk<T,Attributes.Values> getChunk(@NotNull ChunkSource.GetContext context, @NotNull OrderedKeys orderedKeys)
      Description copied from interface: ChunkSource
      Returns a chunk of data corresponding to the keys from the given OrderedKeys.
      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
      orderedKeys - An OrderedKeys representing the keys to be fetched
      Returns:
      A chunk of data corresponding to the keys from the given OrderedKeys
    • getPrevChunk

      public ObjectChunk<T,Attributes.Values> getPrevChunk(@NotNull ChunkSource.GetContext context, @NotNull OrderedKeys orderedKeys)
      Description copied from interface: ChunkSource.WithPrev
      Returns a chunk of previous data corresponding to the keys from the given OrderedKeys.
      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
      orderedKeys - An OrderedKeys representing the keys to be fetched
      Returns:
      A chunk of data corresponding to the keys from the given OrderedKeys.