Package com.illumon.iris.db.v2.sources
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,RegionedColumnSourceObject,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:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractColumnSource.DefaultedImmutable<DATA_TYPE>static classAbstractColumnSource.DefaultedMutable<DATA_TYPE>static interfaceAbstractColumnSource.IsSerializableWe have a fair bit of internal state that must be serialized, but not all of our descendants in the class hierarchy should actually be sent over the wire.Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
ChunkSource.FillContext, ChunkSource.GetContext, ChunkSource.WithPrev<ATTR extends Attributes.Any>Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
DefaultChunkSource.SupportsContiguousGet<ATTR extends Attributes.Any>, DefaultChunkSource.WithPrev<ATTR extends Attributes.Any> -
Field Summary
Fields Modifier and Type Field Description protected Class<?>componentTypeprotected Class<T>typeFields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
DEFAULT_FILL_INSTANCE, ZERO_LENGTH_CHUNK_SOURCE_ARRAYFields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource.WithPrev
ZERO_LENGTH_CHUNK_SOURCE_WITH_PREV_ARRAYFields inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
ZERO_LENGTH_COLUMN_SOURCE_ARRAY -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractColumnSource(Class<T> type)AbstractColumnSource(Class<T> type, Class elementType) -
Method Summary
Modifier and Type Method Description <ALTERNATE_DATA_TYPE>
booleanallowsReinterpret(Class<ALTERNATE_DATA_TYPE> alternateDataType)Test if a reinterpret call will succeed.voiddefaultFillChunk(ChunkSource.FillContext context, WritableChunk<? super Attributes.Values> destination, OrderedKeys orderedKeys)protected <ALTERNATE_DATA_TYPE>
ColumnSource<ALTERNATE_DATA_TYPE>doReinterpret(Class<ALTERNATE_DATA_TYPE> alternateDataType)Supply allowed reinterpret results.voidfillChunk(ChunkSource.FillContext context, WritableChunk<? super Attributes.Values> destination, OrderedKeys orderedKeys)Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys.voidfillPrevChunk(ChunkSource.FillContext context, WritableChunk<? super Attributes.Values> destination, OrderedKeys orderedKeys)Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys.Class<?>getComponentType()GroupingBuildergetGroupingBuilder()Get aGroupingBuilderto construct grouping tables for this column.GroupingProvidergetGroupingProvider()Get the grouping provider associated with this ColumnSource.Class<T>getNativeType()Class<T>getType()booleanhasGrouping()Check if this column has grouping information.booleanisSerializable()Finds the most derived class that has an IsSerializable annotation, and returns its value.Indexmatch(boolean invertMatch, boolean usePrev, boolean caseInsensitive, ReadOnlyIndex startingIndex, Object... keys)Produce an index of rows derived from the 'startingIndex' index that match the input set of keys (taking into account invert, and case sensitivity).<ALTERNATE_DATA_TYPE>
ColumnSource<ALTERNATE_DATA_TYPE>reinterpret(Class<ALTERNATE_DATA_TYPE> alternateDataType)Provide an alternative view into the data underlying this column source.voidsetGroupingProvider(GroupingProvider groupingProvider)Set a grouping provider for use in lazily-constructing groupings.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
cast, createPreviousTuple, createTuple, createTupleFromValues, exportElement, exportElement, exportToExternalKey, getColumnSources, getPrevSource, isImmutable, releaseCachedResources, startTrackingPrevValuesMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunk, getChunk, getChunkByFilling, makeFillContext, makeGetContextMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource.WithPrev
getPrevChunk, getPrevChunk, getPrevChunkByFillingMethods inherited from interface com.illumon.iris.db.v2.sources.ElementSource
get, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getPrev, getPrevBoolean, getPrevByte, getPrevChar, getPrevDouble, getPrevFloat, getPrevInt, getPrevLong, getPrevShort, getShortMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.FillContextMaker
makeFillContextMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.GetContextMaker
makeGetContextMethods inherited from interface com.illumon.iris.db.v2.tuples.TupleExporter
exportElementReinterpretedMethods inherited from interface com.illumon.iris.db.v2.tuples.TupleSource
createTupleFromReinterpretedValues
-
Field Details
-
Constructor Details
-
Method Details
-
getType
- Specified by:
getTypein interfaceColumnSource<T>
-
getComponentType
- Specified by:
getComponentTypein interfaceColumnSource<T>
-
getGroupingBuilder
Description copied from interface:ColumnSourceGet aGroupingBuilderto construct grouping tables for this column. UseColumnSource.hasGrouping()to determine if this column has a grouping.- Specified by:
getGroupingBuilderin interfaceColumnSource<T>- Returns:
- a
GroupingBuilderif this column supports grouping.
-
hasGrouping
public boolean hasGrouping()Description copied from interface:ColumnSourceCheck if this column has grouping information.- Specified by:
hasGroupingin interfaceColumnSource<T>- Returns:
- true if this column has groupings
-
getGroupingProvider
Description copied from interface:ColumnSourceGet the grouping provider associated with this ColumnSource.- Specified by:
getGroupingProviderin interfaceColumnSource<T>- Returns:
- the grouping provider associated with this ColumnSource.
-
setGroupingProvider
Set a grouping provider for use in lazily-constructing groupings.- Specified by:
setGroupingProviderin interfaceColumnSource<T>- Parameters:
groupingProvider- TheGroupingProviderto use
-
match
@NotNull public Index match(boolean invertMatch, boolean usePrev, boolean caseInsensitive, ReadOnlyIndex startingIndex, Object... keys)Description copied from interface:ColumnSourceProduce 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:
matchin interfaceColumnSource<T>- Parameters:
invertMatch- If the match should be invertedusePrev- if previous values should be usedcaseInsensitive- if the match should be case insensitivestartingIndex- the index of rows to matchkeys- the keys to match- Returns:
- an index which is the subset of rows from 'startingIndex' that match the input set of keys
-
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
- Specified by:
getNativeTypein interfaceChunkSource<T>- Specified by:
getNativeTypein interfaceColumnSource<T>
-
fillChunk
public void fillChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Attributes.Values> destination, @NotNull OrderedKeys orderedKeys)Description copied from interface:ChunkSourcePopulates the given destination chunk with data corresponding to the keys from the givenOrderedKeys.- Specified by:
fillChunkin interfaceChunkSource<T>- Parameters:
context- A context containing all mutable/state related data used in retrieving the Chunk.destination- The chunk to be populated according toorderedKeys. 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- AnOrderedKeysrepresenting 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.WithPrevPopulates the given destination chunk with data corresponding to the keys from the givenOrderedKeys.- Specified by:
fillPrevChunkin interfaceChunkSource.WithPrev<T>- Parameters:
context- A context containing all mutable/state related data used in retrieving the Chunk.destination- The chunk to be populated according toorderedKeys. 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- AnOrderedKeysrepresenting the keys to be fetched
-
allowsReinterpret
public <ALTERNATE_DATA_TYPE> boolean allowsReinterpret(@NotNull Class<ALTERNATE_DATA_TYPE> alternateDataType)Description copied from interface:ColumnSourceTest if a reinterpret call will succeed.- Specified by:
allowsReinterpretin interfaceColumnSource<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 IllegalArgumentExceptionDescription copied from interface:ColumnSourceProvide an alternative view into the data underlying this column source.- Specified by:
reinterpretin interfaceColumnSource<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
-