Class AbstractColumnSource<T>

java.lang.Object
com.illumon.iris.db.v2.sources.AbstractColumnSource<T>
All Implemented Interfaces:
ChunkSource<Attributes.Values>, ChunkSource.WithPrev<Attributes.Values>, DefaultChunkSource<Attributes.Values>, DefaultChunkSource.WithPrev<Attributes.Values>, FillContextMaker, GetContextMaker, ColumnSource<T>, ElementSource<T>, Releasable, TupleExporter<T>, TupleSource<T>, Serializable
Direct Known Subclasses:
AbstractColumnSource.DefaultedImmutable, AbstractColumnSource.DefaultedMutable, ArrayBackedColumnSource, BitMaskingColumnSource, BitShiftingColumnSource, BooleanAsByteColumnSource, BoxedColumnSource, BoxedLongAsTimeSource, ByteAggregateColumnSource, ByteSsmBackedSource, CharAggregateColumnSource, CharSsmBackedSource, CrossJoinRightColumnSource, DbDateTimeSsmSourceWrapper, DeltaAwareColumnSource, DoubleAggregateColumnSource, DoubleNullToZeroColumnSource, DoubleSsmBackedSource, EmptyToNullStringRegionedColumnSource, FloatAggregateColumnSource, FloatSsmBackedSource, HashTableColumnSource, ImmutableBooleanArraySource, ImmutableByteArraySource, ImmutableCharArraySource, ImmutableDateTimeArraySource, ImmutableDoubleArraySource, ImmutableFloatArraySource, ImmutableInstantArraySource, ImmutableIntArraySource, ImmutableLongArraySource, ImmutableObjectArraySource, ImmutableShortArraySource, IntAggregateColumnSource, IntSsmBackedSource, ListAggregateColumnSource, LocalDateWrapperSource, LocalTimeWrapperSource, LongAggregateColumnSource, LongSsmBackedSource, MergeSortedHelper.SortedMergeColumnSource, NullValueColumnSource, ObjectAggregateColumnSource, ObjectSsmBackedSource, PrevColumnSource, ReadOnlyRedirectedColumnSource, RegionedColumnSourceBase, ReversedColumnSource, RowIdSource, ShiftedColumnSource, ShortAggregateColumnSource, ShortSsmBackedSource, SingleValueColumnSource, SingleValueObjectColumnSource, SmartKeySource, SparseArrayColumnSource, SwitchColumnSource, SymbolTableToUniqueIdSource, TableLogger.NoPrevColumnSource, UnboxedByteBackedColumnSource, UnboxedLongBackedColumnSource, UnboxedTimeBackedColumnSource, UngroupedColumnSource, UnionColumnSource, ViewColumnSource, ViewportColumnSource

public abstract class AbstractColumnSource<T> extends Object implements ColumnSource<T>, Serializable
The basis for all Column Sources. This class contains the default implementations for various grouping operations as well as basic chunking.
See Also:
  • Field Details

    • type

      protected final Class<T> type
    • componentType

      protected final Class<?> componentType
  • Constructor Details

    • AbstractColumnSource

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

      public AbstractColumnSource(@NotNull Class<T> type, @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>
    • getGroupingBuilder

      public GroupingBuilder getGroupingBuilder()
      Description copied from interface: ColumnSource
      Get a GroupingBuilder to construct grouping tables for this column. Use ColumnSource.hasGrouping() to determine if this column has a grouping.
      Specified by:
      getGroupingBuilder in interface ColumnSource<T>
      Returns:
      a GroupingBuilder if this column supports grouping.
    • hasGrouping

      public boolean hasGrouping()
      Description copied from interface: ColumnSource
      Check if this column has grouping information.
      Specified by:
      hasGrouping in interface ColumnSource<T>
      Returns:
      true if this column has groupings
    • hasGrouping

      public boolean hasGrouping(@Nullable ReadOnlyIndex relevantIndex)
      Description copied from interface: ColumnSource
      Check if this column has grouping information within the specified index.
      Specified by:
      hasGrouping in interface ColumnSource<T>
      Parameters:
      relevantIndex - the index to check for grouping within
      Returns:
      true if this column has groupings
    • getGroupingProvider

      public GroupingProvider getGroupingProvider()
      Description copied from interface: ColumnSource
      Get the grouping provider associated with this ColumnSource.
      Specified by:
      getGroupingProvider in interface ColumnSource<T>
      Returns:
      the grouping provider associated with this ColumnSource.
    • setGroupingProvider

      public final void setGroupingProvider(@Nullable GroupingProvider groupingProvider)
      Set a grouping provider for use in lazily-constructing groupings.
      Specified by:
      setGroupingProvider in interface ColumnSource<T>
      Parameters:
      groupingProvider - The GroupingProvider to use
    • match

      @NotNull public Index match(boolean invertMatch, boolean usePrev, boolean caseInsensitive, @NotNull ReadOnlyIndex startingIndex, Object... keys)
      Description copied from interface: ColumnSource
      Produce an index of rows derived from the 'startingIndex' index that match the input set of keys (taking into account invert, and case sensitivity).
      Specified by:
      match in interface ColumnSource<T>
      Parameters:
      invertMatch - If the match should be inverted
      usePrev - if previous values should be used
      caseInsensitive - if the match should be case insensitive
      startingIndex - the index of rows to match
      keys - the keys to match
      Returns:
      an index which is the subset of rows from 'startingIndex' that match the input set of keys
    • matchWithGrouping

      protected final Index matchWithGrouping(@NotNull ReadOnlyIndex startingIndex, boolean caseInsensitive, boolean invertMatch, Object... keys)
      Perform matching with groups. If for any reason grouping could not be computed, this may return null to indicate we should fall back to chunk based iteration.
      Parameters:
      startingIndex - the index to filter
      caseInsensitive - if the filter is case-insensitive
      invertMatch - if the match should be inverted
      keys - the keys to filter
      Returns:
      the filtered index, or null if grouping could not be properly used
    • canUseGrouping

      protected final boolean canUseGrouping(boolean usePrev, @NotNull ReadOnlyIndex startingIndex)
    • isSerializable

      public boolean isSerializable()
      Finds the most derived class that has an IsSerializable annotation, and returns its value. If no annotation is found, then returns false. Note: This is an internal Deephaven function and may be removed or changed at any time.
    • getNativeType

      public Class<T> getNativeType()
      Specified by:
      getNativeType in interface ChunkSource<T>
      Specified by:
      getNativeType in interface ColumnSource<T>
    • fillChunk

      public void fillChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Attributes.Values> destination, @NotNull OrderedKeys orderedKeys)
      Description copied from interface: ChunkSource
      Populates the given destination chunk with data corresponding to the keys from the given OrderedKeys.
      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 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
    • defaultFillChunk

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

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

      public <ALTERNATE_DATA_TYPE> boolean allowsReinterpret(@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>
      Type Parameters:
      ALTERNATE_DATA_TYPE - the dataType to inquire about
      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 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>
      Type Parameters:
      ALTERNATE_DATA_TYPE - the dataType to reinterpret to
      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 Class<ALTERNATE_DATA_TYPE> alternateDataType)
      Supply allowed reinterpret results. The default implementation handles the most common case to avoid code duplication.
      Type Parameters:
      ALTERNATE_DATA_TYPE - the dataType to reinterpret to
      Parameters:
      alternateDataType - The alternate data type
      Returns:
      The resulting ColumnSource