Interface ColumnSource<T>
- All Superinterfaces:
ChunkSource<Attributes.Values>,ChunkSource.WithPrev<Attributes.Values>,DefaultChunkSource<Attributes.Values>,DefaultChunkSource.WithPrev<Attributes.Values>,ElementSource<T>,FillContextMaker,GetContextMaker,Releasable,TupleExporter<T>,TupleSource<T>
- All Known Subinterfaces:
AggregateColumnSource<DB_ARRAY_TYPE,,COMPONENT_TYPE> ColumnSourceGetDefaults.ForBoolean,ColumnSourceGetDefaults.ForByte,ColumnSourceGetDefaults.ForChar,ColumnSourceGetDefaults.ForDouble,ColumnSourceGetDefaults.ForFloat,ColumnSourceGetDefaults.ForInt,ColumnSourceGetDefaults.ForLong,ColumnSourceGetDefaults.ForLongAsDateTime,ColumnSourceGetDefaults.ForLongAsInstant,ColumnSourceGetDefaults.ForObject<DATA_TYPE>,ColumnSourceGetDefaults.ForShort,ColumnSourceGetDefaults.LongBacked<DATA_TYPE>,ContextualizedObjectColumnSource<DATA_TYPE>,ImmutableColumnSource<DATA_TYPE>,ImmutableColumnSourceGetDefaults.ForBoolean,ImmutableColumnSourceGetDefaults.ForByte,ImmutableColumnSourceGetDefaults.ForChar,ImmutableColumnSourceGetDefaults.ForDouble,ImmutableColumnSourceGetDefaults.ForFloat,ImmutableColumnSourceGetDefaults.ForInt,ImmutableColumnSourceGetDefaults.ForLong,ImmutableColumnSourceGetDefaults.ForLongAsDateTime,ImmutableColumnSourceGetDefaults.ForObject<DATA_TYPE>,ImmutableColumnSourceGetDefaults.ForShort,ImmutableColumnSourceGetDefaults.LongBacked<DATA_TYPE>,MutableColumnSource<DATA_TYPE>,MutableColumnSourceGetDefaults.ForBoolean,MutableColumnSourceGetDefaults.ForByte,MutableColumnSourceGetDefaults.ForChar,MutableColumnSourceGetDefaults.ForDouble,MutableColumnSourceGetDefaults.ForFloat,MutableColumnSourceGetDefaults.ForInt,MutableColumnSourceGetDefaults.ForLong,MutableColumnSourceGetDefaults.ForLongAsDateTime,MutableColumnSourceGetDefaults.ForLongAsInstant,MutableColumnSourceGetDefaults.ForObject<DATA_TYPE>,MutableColumnSourceGetDefaults.ForShort,MutableColumnSourceGetDefaults.LongBacked<DATA_TYPE>,PartitioningRegionedSource,RegionedColumnSource<DATA_TYPE>,ReverseLookupColumnSource<DATA_TYPE,,EXTRA_VALUE_TYPE> SizedColumnSource<DATA_TYPE>,SizedContextualizedObjectColumnSource<DATA_TYPE>,SsmBackedColumnSource<K,,T> SymbolTableSource<SYMBOL_TYPE>,WritableSource<T>
- All Known Implementing Classes:
AbstractColumnSource,AbstractColumnSource.DefaultedImmutable,AbstractColumnSource.DefaultedMutable,ArrayBackedColumnSource,BitMaskingColumnSource,BitShiftingColumnSource,BooleanArraySource,BooleanAsByteColumnSource,BooleanSingleValueSource,BooleanSparseArraySource,BoxedColumnSource,BoxedColumnSource.OfDateTime,BoxedLongAsTimeSource,ByteAggregateColumnSource,ByteArraySource,ByteSingleValueSource,ByteSparseArraySource,ByteSsmBackedSource,CharacterArraySource,CharacterSingleValueSource,CharacterSparseArraySource,CharAggregateColumnSource,CharSsmBackedSource,CrossJoinRightColumnSource,DateTimeArraySource,DatetimeAsLongColumnSource,DateTimeSparseArraySource,DbDateTimeSsmSourceWrapper,DeltaAwareColumnSource,DoubleAggregateColumnSource,DoubleArraySource,DoubleNullToZeroColumnSource,DoubleSingleValueSource,DoubleSparseArraySource,DoubleSsmBackedSource,EmptyToNullStringRegionedColumnSource,FloatAggregateColumnSource,FloatArraySource,FloatSingleValueSource,FloatSparseArraySource,FloatSsmBackedSource,HashTableColumnSource,ImmutableBooleanArraySource,ImmutableByteArraySource,ImmutableCharArraySource,ImmutableDateTimeArraySource,ImmutableDoubleArraySource,ImmutableFloatArraySource,ImmutableInstantArraySource,ImmutableIntArraySource,ImmutableLongArraySource,ImmutableObjectArraySource,ImmutableShortArraySource,InstantArraySource,InstantAsLongColumnSource,InstantSparseArraySource,IntAggregateColumnSource,IntegerArraySource,IntegerSingleValueSource,IntegerSparseArraySource,IntSsmBackedSource,ListAggregateColumnSource,LocalDateWrapperSource,LocalTimeWrapperSource,LongAggregateColumnSource,LongArraySource,LongAsDateTimeColumnSource,LongAsInstantColumnSource,LongAsLocalDateColumnSource,LongAsLocalTimeColumnSource,LongAsZonedDateTimeColumnSource,LongSingleValueSource,LongSparseArraySource,LongSsmBackedSource,MergeSortedHelper.SortedMergeColumnSource,NanosBasedTimeArraySource,NanosBasedTimeSparseArraySource,NullValueColumnSource,ObjectAggregateColumnSource,ObjectArraySource,ObjectSingleValueSource,ObjectSparseArraySource,ObjectSsmBackedSource,PrevColumnSource,ReadOnlyRedirectedColumnSource,RedirectedColumnSource,RegionedColumnSourceBase,RegionedColumnSourceObject,RegionedColumnSourceObject.AsValues,RegionedColumnSourceObjectWithDictionary,RegionedColumnSourcePartitioning,ReversedColumnSource,RowIdSource,ShiftedColumnSource,ShortAggregateColumnSource,ShortArraySource,ShortSingleValueSource,ShortSparseArraySource,ShortSsmBackedSource,SingleValueColumnSource,SingleValueObjectColumnSource,SmartKeySource,SparseArrayColumnSource,SwitchColumnSource,SymbolTableToUniqueIdSource,TableLogger.NoPrevColumnSource,UnboxedByteBackedColumnSource,UnboxedLongBackedColumnSource,UnboxedLongBackedWritableSource,UnboxedTimeBackedColumnSource,UngroupedArrayColumnSource,UngroupedBooleanArrayColumnSource,UngroupedBoxedBooleanArrayColumnSource,UngroupedBoxedByteArrayColumnSource,UngroupedBoxedByteDbArrayColumnSource,UngroupedBoxedCharArrayColumnSource,UngroupedBoxedCharDbArrayColumnSource,UngroupedBoxedDoubleArrayColumnSource,UngroupedBoxedDoubleDbArrayColumnSource,UngroupedBoxedFloatArrayColumnSource,UngroupedBoxedFloatDbArrayColumnSource,UngroupedBoxedIntArrayColumnSource,UngroupedBoxedIntDbArrayColumnSource,UngroupedBoxedLongArrayColumnSource,UngroupedBoxedLongDbArrayColumnSource,UngroupedBoxedShortArrayColumnSource,UngroupedBoxedShortDbArrayColumnSource,UngroupedByteArrayColumnSource,UngroupedByteDbArrayColumnSource,UngroupedCharArrayColumnSource,UngroupedCharDbArrayColumnSource,UngroupedColumnSource,UngroupedDbArrayColumnSource,UngroupedDoubleArrayColumnSource,UngroupedDoubleDbArrayColumnSource,UngroupedFloatArrayColumnSource,UngroupedFloatDbArrayColumnSource,UngroupedIntArrayColumnSource,UngroupedIntDbArrayColumnSource,UngroupedLongArrayColumnSource,UngroupedLongDbArrayColumnSource,UngroupedShortArrayColumnSource,UngroupedShortDbArrayColumnSource,UnionColumnSource,ViewColumnSource,ViewportColumnSource,ZonedDateTimeArraySource,ZonedDateTimeAsLongSource,ZonedDateTimeSparseArraySource
Note for implementors: All ColumnSource implementations must map ReadOnlyIndex.NULL_KEY to a null value
for all get and getPrev methods.
-
Nested Class Summary
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
FieldsFields 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_ARRAY -
Method Summary
Modifier and TypeMethodDescription<ALTERNATE_DATA_TYPE>
booleanallowsReinterpret(Class<ALTERNATE_DATA_TYPE> alternateDataType) Test if a reinterpret call will succeed.default <TYPE> ColumnSource<TYPE>Returns thisColumnSource, parameterized by<TYPE>, if the data type of this column (as given bygetType()) can be cast toclazz.default TcreatePreviousTuple(long indexKey) Create a tuple for previous key column values at the supplied index key.default TcreateTuple(long indexKey) Create a tuple for key column values at the supplied index key.default TcreateTupleFromValues(Object... values) Create a tuple for the supplied (boxed) values.default ObjectexportElement(T tuple, int elementIndex) Export a single element from the tuple, identified by its element index, to an Objectdefault <ELEMENT_TYPE>
voidexportElement(T tuple, int elementIndex, WritableSource<ELEMENT_TYPE> writableSource, long destinationIndexKey) Export a single element from the tuple, identified by its element index, to the destination index key of the supplied writable source.default ObjectexportToExternalKey(T tuple) Export this tuple's element list as a key suitable for theTableMaps resulting fromTable.byExternal(boolean, java.lang.String...).default List<ColumnSource>Get theColumnSources backing this tuple source.Class<?>Get aGroupingBuilderto construct grouping tables for this column.Get the grouping provider associated with this ColumnSource.default ChunkSource<Attributes.Values>getType()booleanCheck if this column has grouping information.booleanhasGrouping(ReadOnlyIndex relevantIndex) Check if this column has grouping information within the specified index.booleanDetermine if this column source is immutable, meaning that the values at a given index key never change.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.default voidRelease any resources held for caching purposes.voidsetGroupingProvider(GroupingProvider groupingProvider) Supply a provider that will lazily construct the group-to-range map.default voidColumnSource implementations that track previous values have the option to not actually start tracking previous values until this method is called.Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
fillChunk, getChunkTypeMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource.WithPrev
fillPrevChunkMethods 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
-
ZERO_LENGTH_COLUMN_SOURCE_ARRAY
-
-
Method Details
-
getType
-
getComponentType
Class<?> getComponentType() -
getNativeType
- Specified by:
getNativeTypein interfaceChunkSource<T>
-
match
@NotNull Index match(boolean invertMatch, boolean usePrev, boolean caseInsensitive, @NotNull 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).- 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
-
startTrackingPrevValues
default void startTrackingPrevValues()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. -
getGroupingBuilder
Get aGroupingBuilderto construct grouping tables for this column. UsehasGrouping()to determine if this column has a grouping.- Returns:
- a
GroupingBuilderif this column supports grouping.
-
hasGrouping
boolean hasGrouping()Check if this column has grouping information.- Returns:
- true if this column has groupings
-
hasGrouping
Check if this column has grouping information within the specified index.- Parameters:
relevantIndex- the index to check for grouping within- Returns:
- true if this column has groupings
-
getGroupingProvider
GroupingProvider getGroupingProvider()Get the grouping provider associated with this ColumnSource.- Returns:
- the grouping provider associated with this ColumnSource.
-
setGroupingProvider
Supply a provider that will lazily construct the group-to-range map.- Parameters:
groupingProvider- The provider
-
isImmutable
boolean isImmutable()Determine if this column source is immutable, meaning that the values at a given index key never change.- Returns:
- true if the values at a given index of the column source never change, false otherwise
-
releaseCachedResources
@OverridingMethodsMustInvokeSuper default void releaseCachedResources()Release any resources held for caching purposes. Implementations need not guarantee that concurrent accesses are correct, as the purpose of this method is to ensure cleanup for column sources that will no longer be used.- Specified by:
releaseCachedResourcesin interfaceReleasable
-
allowsReinterpret
<ALTERNATE_DATA_TYPE> boolean allowsReinterpret(@NotNull Class<ALTERNATE_DATA_TYPE> alternateDataType) Test if a reinterpret call will succeed.- 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
<ALTERNATE_DATA_TYPE> ColumnSource<ALTERNATE_DATA_TYPE> reinterpret(@NotNull Class<ALTERNATE_DATA_TYPE> alternateDataType) throws IllegalArgumentException Provide an alternative view into the data underlying this column source.- 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
-
getColumnSources
Description copied from interface:TupleSourceGet theColumnSources backing this tuple source.- Specified by:
getColumnSourcesin interfaceTupleSource<T>- Returns:
- The column sources
-
createTuple
Description copied from interface:TupleSourceCreate a tuple for key column values at the supplied index key.- Specified by:
createTuplein interfaceTupleSource<T>- Parameters:
indexKey- The index key- Returns:
- The resulting tuple
-
createPreviousTuple
Description copied from interface:TupleSourceCreate a tuple for previous key column values at the supplied index key.- Specified by:
createPreviousTuplein interfaceTupleSource<T>- Parameters:
indexKey- The index key- Returns:
- The resulting tuple
-
createTupleFromValues
Description copied from interface:TupleSourceCreate a tuple for the supplied (boxed) values.- Specified by:
createTupleFromValuesin interfaceTupleSource<T>- Parameters:
values- The values- Returns:
- The resulting tuple
-
exportElement
default <ELEMENT_TYPE> void exportElement(T tuple, int elementIndex, @NotNull WritableSource<ELEMENT_TYPE> writableSource, long destinationIndexKey) Description copied from interface:TupleExporterExport a single element from the tuple, identified by its element index, to the destination index key of the supplied writable source.For the empty tuple, this is unsupported.
For singles, this will copy the sole element, possibly in boxed form.
For doubles and longer, this will copy the specified element without any unnecessary boxing.
- Specified by:
exportElementin interfaceTupleExporter<T>- Type Parameters:
ELEMENT_TYPE- the type of the element to be exported- Parameters:
tuple- The tuple to export an element fromelementIndex- The element index to exportwritableSource- The destinationdestinationIndexKey- The destination index key
-
exportElement
Description copied from interface:TupleExporterExport a single element from the tuple, identified by its element index, to an ObjectFor the empty tuple, this is unsupported.
For singles, this will copy the sole element, possibly in boxed form.
For doubles and longer, this will copy the specified element without any unnecessary boxing.
- Specified by:
exportElementin interfaceTupleExporter<T>- Parameters:
tuple- The tuple to export an element fromelementIndex- The element index to export- Returns:
- a single value from the tuple
-
exportToExternalKey
Description copied from interface:TupleExporterExport this tuple's element list as a key suitable for the
TableMaps resulting fromTable.byExternal(boolean, java.lang.String...).For the empty tuple this is a unsupported.
For singles, this is the (boxed) sole element itself.
For doubles and longer, this is a newly-allocated "
SmartKey".- Specified by:
exportToExternalKeyin interfaceTupleExporter<T>- Parameters:
tuple- The tuple to export all elements from- Returns:
- The new smart key
-
getPrevSource
- Specified by:
getPrevSourcein interfaceChunkSource.WithPrev<T>- Specified by:
getPrevSourcein interfaceDefaultChunkSource.WithPrev<T>- Returns:
- a chunk source which accesses the previous values.
-
cast
Returns thisColumnSource, parameterized by<TYPE>, if the data type of this column (as given bygetType()) can be cast toclazz. This is analogous to casting the objects provided by this column source toclazz.For example, the following code will throw an exception if the "MyString" column does not actually contain
Stringdata:ColumnSource<String> colSource = table.getColumnSource("MyString").getParameterized(String.class)Due to the nature of type erasure, the JVM will still insert an additional cast to
TYPEwhen elements are retrieved from the column source, such as withString myStr = colSource.get(0).- Type Parameters:
TYPE- The target type, as a type parameter. Intended to be inferred fromclazz.- Parameters:
clazz- The target type.- Returns:
- A
ColumnSourceparameterized byTYPE.
-