Class AbstractColumnSource<T>

java.lang.Object
io.deephaven.engine.table.impl.AbstractColumnSource<T>
All Implemented Interfaces:
ChunkSource<Values>, ChunkSource.WithPrev<Values>, ColumnSource<T>, ElementSource<T>, FillContextMaker, GetContextMaker, DefaultChunkSource<Values>, DefaultChunkSource.WithPrev<Values>, Releasable, TupleExporter<T>, TupleSource<T>
Direct Known Subclasses:
AbstractArrowColumnSource, AbstractColumnSource.DefaultedImmutable, AbstractColumnSource.DefaultedMutable, AbstractDeferredGroupingColumnSource, AlternatingColumnSource, BaseAggregateSlicedColumnSource, BitMaskingColumnSource, BitShiftingColumnSource, BooleanAsByteColumnSource, BooleanSparseArraySource.ReinterpretedAsByte, ByteAggregateColumnSource, ByteAsBooleanColumnSource, ByteChunkColumnSource, ByteSsmBackedSource, CharAggregateColumnSource, CharChunkColumnSource, CharSsmBackedSource, CrossJoinRightColumnSource, DelegatingColumnSource, DeltaAwareColumnSource, DoubleAggregateColumnSource, DoubleChunkColumnSource, DoubleNullToZeroColumnSource, DoubleSsmBackedSource, FloatAggregateColumnSource, FloatChunkColumnSource, FloatSsmBackedSource, HashTableColumnSource, ImmutableConstantByteSource, ImmutableConstantCharSource, ImmutableConstantDoubleSource, ImmutableConstantFloatSource, ImmutableConstantIntSource, ImmutableConstantLongSource, ImmutableConstantNanosBasedTimeSource, ImmutableConstantObjectSource, ImmutableConstantShortSource, InstantSsmSourceWrapper, IntAggregateColumnSource, IntChunkColumnSource, IntSsmBackedSource, LocalDateWrapperSource, LocalTimeWrapperSource, LongAggregateColumnSource, LongAsTimeSource, LongChunkColumnSource, LongSsmBackedSource, MergeSortedHelper.SortedMergeColumnSource, NullValueColumnSource, ObjectAggregateColumnSource, ObjectChunkColumnSource, ObjectSsmBackedSource, PrevColumnSource, RangeAggregateColumnSource, ReversedColumnSource, RowKeyColumnSource, RowPositionColumnSource, ShiftedColumnSource, ShortAggregateColumnSource, ShortChunkColumnSource, ShortSsmBackedSource, SingleValueColumnSource, SingleValueObjectColumnSource, SwitchColumnSource, SymbolTableToUniqueIdSource, UnboxedLongBackedColumnSource, UnboxedLongBackedColumnSource, UnboxedTimeBackedColumnSource, UngroupedColumnSource, UnionColumnSource, ViewColumnSource

public abstract class AbstractColumnSource<T> extends Object implements ColumnSource<T>, DefaultChunkSource.WithPrev<Values>
  • Field Details

    • USE_RANGES_AVERAGE_RUN_LENGTH

      public static final long USE_RANGES_AVERAGE_RUN_LENGTH
      Minimum average run length in an RowSequence that should trigger Chunk-filling by key ranges instead of individual keys.
      See Also:
    • type

      protected final Class<T> type
    • componentType

      protected final Class<?> componentType
    • updateGraph

      protected final UpdateGraph updateGraph
    • groupToRange

      protected volatile Map<T,RowSet> groupToRange
    • rowSetIndexerKey

      protected volatile List<ColumnSource<?>> rowSetIndexerKey
  • Constructor Details

    • AbstractColumnSource

      protected AbstractColumnSource(@NotNull @NotNull Class<T> type)
    • AbstractColumnSource

      public AbstractColumnSource(@NotNull @NotNull Class<T> type, @Nullable @Nullable Class<?> elementType)
  • Method Details

    • getType

      public Class<T> getType()
      Specified by:
      getType in interface ColumnSource<T>
    • getComponentType

      public Class<?> getComponentType()
      Specified by:
      getComponentType in interface ColumnSource<T>
    • getPrevSource

      public ColumnSource<T> getPrevSource()
      Specified by:
      getPrevSource in interface ChunkSource.WithPrev<T>
      Specified by:
      getPrevSource in interface ColumnSource<T>
      Specified by:
      getPrevSource in interface DefaultChunkSource.WithPrev<T>
      Returns:
      a chunk source which accesses the previous values.
    • getColumnSources

      public List<ColumnSource<?>> getColumnSources()
      Description copied from interface: TupleSource
      Get the ColumnSources backing this tuple source.
      Specified by:
      getColumnSources in interface TupleSource<T>
      Returns:
      The column sources
    • getGroupToRange

      public Map<T,RowSet> getGroupToRange()
      Description copied from interface: ColumnSource
      Compute grouping information for all keys present in this column source.
      Specified by:
      getGroupToRange in interface ColumnSource<T>
      Returns:
      A map from distinct data values to a RowSet that contains those values
    • getGroupToRange

      public Map<T,RowSet> getGroupToRange(RowSet rowSet)
      Description copied from interface: ColumnSource
      Compute grouping information for (at least) all keys present in rowSet.
      Specified by:
      getGroupToRange in interface ColumnSource<T>
      Parameters:
      rowSet - The RowSet to consider
      Returns:
      A map from distinct data values to a RowSet that contains those values
    • setGroupToRange

      public final void setGroupToRange(@Nullable @Nullable Map<T,RowSet> groupToRange)
    • match

      public WritableRowSet match(boolean invertMatch, boolean usePrev, boolean caseInsensitive, @NotNull @NotNull RowSet mapper, Object... keys)
      Specified by:
      match in interface ColumnSource<T>
    • getValuesMapping

      public Map<T,RowSet> getValuesMapping(RowSet subRange)
      Specified by:
      getValuesMapping in interface ColumnSource<T>
    • fillChunk

      public void fillChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> destination, @NotNull @NotNull RowSequence rowSequence)
      Description copied from interface: ChunkSource
      Populates the given destination chunk with data corresponding to the keys from the given RowSequence.
      Specified by:
      fillChunk in interface ChunkSource<T>
      Parameters:
      context - A context containing all mutable/state related data used in retrieving the Chunk.
      destination - 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
    • defaultFillChunk

      @VisibleForTesting public final void defaultFillChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> destination, @NotNull @NotNull RowSequence rowSequence)
    • fillPrevChunk

      public void fillPrevChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> destination, @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>
      Parameters:
      context - A context containing all mutable/state related data used in retrieving the Chunk.
      destination - 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
    • defaultFillPrevChunk

      protected final void defaultFillPrevChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> destination, @NotNull @NotNull RowSequence 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<T>
      Parameters:
      alternateDataType - The alternative type to consider
      Returns:
      If a reinterpret on this column source with the supplied alternateDataType will succeed.
    • reinterpret

      public final <ALTERNATE_DATA_TYPE> ColumnSource<ALTERNATE_DATA_TYPE> reinterpret(@NotNull @NotNull Class<ALTERNATE_DATA_TYPE> alternateDataType) throws IllegalArgumentException
      Description copied from interface: ColumnSource
      Provide an alternative view into the data underlying this column source.
      Specified by:
      reinterpret in interface ColumnSource<T>
      Parameters:
      alternateDataType - The alternative type to expose
      Returns:
      A column source of the alternate data type, backed by the same underlying data.
      Throws:
      IllegalArgumentException - If the alternativeDataType supplied is not supported
    • doReinterpret

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