Package com.illumon.iris.db.v2
Class SymbolTableToUniqueIdSource
java.lang.Object
com.illumon.iris.db.v2.sources.AbstractColumnSource<Integer>
com.illumon.iris.db.v2.SymbolTableToUniqueIdSource
- All Implemented Interfaces:
ChunkSource<Attributes.Values>,ChunkSource.WithPrev<Attributes.Values>,DefaultChunkSource<Attributes.Values>,DefaultChunkSource.WithPrev<Attributes.Values>,FillContextMaker,GetContextMaker,ColumnSource<Integer>,ColumnSourceGetDefaults.ForInt,ElementSource<Integer>,ImmutableColumnSource<Integer>,ImmutableColumnSourceGetDefaults.ForInt,Releasable,TupleExporter<Integer>,TupleSource<Integer>,Serializable
public class SymbolTableToUniqueIdSource extends AbstractColumnSource<Integer> implements ImmutableColumnSourceGetDefaults.ForInt
This column source is used as a wrapper for the original table's symbol sources.
The symbol sources are reinterpreted to longs, and then the SymbolCombiner produces an IntegerSparseArraySource
for each side. To convert from the symbol table value, we simply look it up in the symbolLookup source and use
that as our chunked result.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class com.illumon.iris.db.v2.sources.AbstractColumnSource
AbstractColumnSource.DefaultedImmutable<DATA_TYPE>, AbstractColumnSource.DefaultedMutable<DATA_TYPE>, AbstractColumnSource.IsSerializableNested 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 inherited from class com.illumon.iris.db.v2.sources.AbstractColumnSource
componentType, groupToRange, 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 -
Method Summary
Modifier and Type Method Description 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.WritableLongChunk<Attributes.Values>fillChunkWithSymbolSource(ChunkSource.FillContext context, WritableChunk<? super Attributes.Values> destination, OrderedKeys orderedKeys)intgetInt(long index)Get the value at the index as an int.static SymbolTableToUniqueIdSourcegetUniqueIdSource(Table symbolTable, ColumnSource<?> keySource)ChunkSource.FillContextmakeFillContext(int chunkCapacity, SharedContext sharedContext)Allocate a newChunkSource.FillContextfor filling chunks from thisFillContextMaker, typically aChunkSource.Methods inherited from class com.illumon.iris.db.v2.sources.AbstractColumnSource
allowsReinterpret, computeFlattenedGroupings, defaultFillChunk, doReinterpret, fillPrevChunk, forEachGroup, forEachResponsiveGroup, getComponentType, getGroupToRange, getGroupToRange, getNativeType, getType, getValuesMapping, groupingToFlatSources, groupingToFlatSources, groupingToFlatSources, isSerializable, match, reinterpret, setGroupToRangeMethods 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.chunk.ChunkSource.WithPrev
fillPrevChunkMethods inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
allowsReinterpret, cast, createPreviousTuple, createTuple, createTupleFromValues, exportElement, exportElement, exportToExternalKey, getColumnSources, getComponentType, getGroupToRange, getGroupToRange, getNativeType, getPrevSource, getType, getValuesMapping, match, reinterpret, releaseCachedResources, startTrackingPrevValuesMethods inherited from interface com.illumon.iris.db.v2.sources.ColumnSourceGetDefaults.ForInt
get, getBoolean, getByte, getChar, getDouble, getFloat, getLong, getShortMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunk, getChunk, getChunkByFilling, 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.chunk.FillContextMaker
makeFillContextMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.GetContextMaker
makeGetContextMethods inherited from interface com.illumon.iris.db.v2.sources.ImmutableColumnSource
getPrev, getPrevBoolean, getPrevByte, getPrevChar, getPrevDouble, getPrevFloat, getPrevInt, getPrevLong, getPrevShort, isImmutableMethods inherited from interface com.illumon.iris.db.v2.tuples.TupleExporter
exportElementReinterpretedMethods inherited from interface com.illumon.iris.db.v2.tuples.TupleSource
createTupleFromReinterpretedValues
-
Method Details
-
getInt
public int getInt(long index)Description copied from interface:ElementSourceGet the value at the index as an int.- Specified by:
getIntin interfaceElementSource<Integer>- Parameters:
index- the location in index space to get the value from.- Returns:
- the int at the index, null values are represented by
QueryConstants.NULL_INT
-
makeFillContext
Description copied from interface:FillContextMakerAllocate a newChunkSource.FillContextfor filling chunks from thisFillContextMaker, typically aChunkSource.- Specified by:
makeFillContextin interfaceDefaultChunkSource<Attributes.Values>- Specified by:
makeFillContextin interfaceFillContextMaker- Parameters:
chunkCapacity- The maximum size of anyWritableChunkthat will be filled with this contextsharedContext- Shared store of intermediate results.- Returns:
- A context for use with fill operations
-
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<Attributes.Values>- Overrides:
fillChunkin classAbstractColumnSource<Integer>- 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
-
fillChunkWithSymbolSource
public WritableLongChunk<Attributes.Values> fillChunkWithSymbolSource(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Attributes.Values> destination, @NotNull OrderedKeys orderedKeys) -
getUniqueIdSource
public static SymbolTableToUniqueIdSource getUniqueIdSource(Table symbolTable, ColumnSource<?> keySource)
-