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 class
AbstractColumnSource.DefaultedImmutable<DATA_TYPE>
static class
AbstractColumnSource.DefaultedMutable<DATA_TYPE>
static interface
AbstractColumnSource.IsSerializable
We 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<?>
componentType
protected Class<T>
type
Fields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
DEFAULT_FILL_INSTANCE, ZERO_LENGTH_CHUNK_SOURCE_ARRAY
Fields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource.WithPrev
ZERO_LENGTH_CHUNK_SOURCE_WITH_PREV_ARRAY
Fields inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
ZERO_LENGTH_COLUMN_SOURCE_ARRAY
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractColumnSource(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.void
defaultFillChunk(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.void
fillChunk(ChunkSource.FillContext context, WritableChunk<? super Attributes.Values> destination, OrderedKeys orderedKeys)
Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys
.void
fillPrevChunk(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()
GroupingBuilder
getGroupingBuilder()
Get aGroupingBuilder
to construct grouping tables for this column.GroupingProvider
getGroupingProvider()
Get the grouping provider associated with this ColumnSource.Class<T>
getNativeType()
Class<T>
getType()
boolean
hasGrouping()
Check if this column has grouping information.boolean
isSerializable()
Finds the most derived class that has an IsSerializable annotation, and returns its value.Index
match(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.void
setGroupingProvider(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, wait
Methods inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
cast, createPreviousTuple, createTuple, createTupleFromValues, exportElement, exportElement, exportToExternalKey, getColumnSources, getPrevSource, isImmutable, releaseCachedResources, startTrackingPrevValues
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunk, getChunk, getChunkByFilling, makeFillContext, makeGetContext
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource.WithPrev
getPrevChunk, getPrevChunk, getPrevChunkByFilling
Methods 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, getShort
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.FillContextMaker
makeFillContext
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.GetContextMaker
makeGetContext
Methods inherited from interface com.illumon.iris.db.v2.tuples.TupleExporter
exportElementReinterpreted
Methods inherited from interface com.illumon.iris.db.v2.tuples.TupleSource
createTupleFromReinterpretedValues
-
Field Details
-
Constructor Details
-
Method Details
-
getType
- Specified by:
getType
in interfaceColumnSource<T>
-
getComponentType
- Specified by:
getComponentType
in interfaceColumnSource<T>
-
getGroupingBuilder
Description copied from interface:ColumnSource
Get aGroupingBuilder
to construct grouping tables for this column. UseColumnSource.hasGrouping()
to determine if this column has a grouping.- Specified by:
getGroupingBuilder
in interfaceColumnSource<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 interfaceColumnSource<T>
- Returns:
- true if this column has groupings
-
getGroupingProvider
Description copied from interface:ColumnSource
Get the grouping provider associated with this ColumnSource.- Specified by:
getGroupingProvider
in interfaceColumnSource<T>
- Returns:
- the grouping provider associated with this ColumnSource.
-
setGroupingProvider
Set a grouping provider for use in lazily-constructing groupings.- Specified by:
setGroupingProvider
in interfaceColumnSource<T>
- Parameters:
groupingProvider
- TheGroupingProvider
to use
-
match
@NotNull public Index match(boolean invertMatch, boolean usePrev, boolean caseInsensitive, 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 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:
getNativeType
in interfaceChunkSource<T>
- Specified by:
getNativeType
in interfaceColumnSource<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 givenOrderedKeys
.- Specified by:
fillChunk
in 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
- AnOrderedKeys
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 givenOrderedKeys
.- Specified by:
fillPrevChunk
in 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
- AnOrderedKeys
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 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:ColumnSource
Provide an alternative view into the data underlying this column source.- Specified by:
reinterpret
in 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
-