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.IsSerializable
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 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
-
Method Summary
Modifier and Type Method Description 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
.WritableLongChunk<Attributes.Values>
fillChunkWithSymbolSource(ChunkSource.FillContext context, WritableChunk<? super Attributes.Values> destination, OrderedKeys orderedKeys)
int
getInt(long index)
Get the value at the index as an int.static SymbolTableToUniqueIdSource
getUniqueIdSource(Table symbolTable, ColumnSource<?> keySource)
ChunkSource.FillContext
makeFillContext(int chunkCapacity, SharedContext sharedContext)
Allocate a newChunkSource.FillContext
for filling chunks from thisFillContextMaker
, typically aChunkSource
.Methods inherited from class com.illumon.iris.db.v2.sources.AbstractColumnSource
allowsReinterpret, defaultFillChunk, doReinterpret, fillPrevChunk, getComponentType, getGroupingBuilder, getGroupingProvider, getNativeType, getType, hasGrouping, isSerializable, match, reinterpret, setGroupingProvider
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.chunk.ChunkSource.WithPrev
fillPrevChunk
Methods inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
allowsReinterpret, cast, createPreviousTuple, createTuple, createTupleFromValues, exportElement, exportElement, exportToExternalKey, getColumnSources, getComponentType, getGroupingBuilder, getGroupingProvider, getNativeType, getPrevSource, getType, hasGrouping, match, reinterpret, releaseCachedResources, setGroupingProvider, startTrackingPrevValues
Methods inherited from interface com.illumon.iris.db.v2.sources.ColumnSourceGetDefaults.ForInt
get, getBoolean, getByte, getChar, getDouble, getFloat, getLong, getShort
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunk, getChunk, getChunkByFilling, 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.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.sources.ImmutableColumnSource
getPrev, getPrevBoolean, getPrevByte, getPrevChar, getPrevDouble, getPrevFloat, getPrevInt, getPrevLong, getPrevShort, isImmutable
Methods inherited from interface com.illumon.iris.db.v2.tuples.TupleExporter
exportElementReinterpreted
Methods inherited from interface com.illumon.iris.db.v2.tuples.TupleSource
createTupleFromReinterpretedValues
-
Method Details
-
getInt
public int getInt(long index)Description copied from interface:ElementSource
Get the value at the index as an int.- Specified by:
getInt
in 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:FillContextMaker
Allocate a newChunkSource.FillContext
for filling chunks from thisFillContextMaker
, typically aChunkSource
.- Specified by:
makeFillContext
in interfaceDefaultChunkSource<Attributes.Values>
- Specified by:
makeFillContext
in interfaceFillContextMaker
- Parameters:
chunkCapacity
- The maximum size of anyWritableChunk
that 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:ChunkSource
Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys
.- Specified by:
fillChunk
in interfaceChunkSource<Attributes.Values>
- Overrides:
fillChunk
in 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
- AnOrderedKeys
representing 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)
-