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
A Column source that maps Symbol table keys from an original source to new values using a lookup source. The lookup source is generated
by a
SymbolTableCombiner
using the factory method
.- See Also:
-
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 class com.illumon.iris.db.v2.sources.AbstractColumnSource
componentType, 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
.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) Create a newSymbolTableToUniqueIdSource
from the given symbol table and input column.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, canUseGrouping, defaultFillChunk, doReinterpret, fillPrevChunk, getComponentType, getGroupingBuilder, getGroupingProvider, getNativeType, getType, hasGrouping, isSerializable, match, matchWithGrouping, 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
getChunkType
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
-
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) Create a newSymbolTableToUniqueIdSource
from the given symbol table and input column. ThesymbolTable
will be rehashed to produce a new mapping of IDs that are guaranteed to be unique for each source key value. The resulting source can then be used to map symbol keys from the original source to these new IDs.- Parameters:
symbolTable
- The symbol table for the specifiedkeySource
. (Typically fromSymbolTableSource.getStaticSymbolTable(ReadOnlyIndex, boolean)
)keySource
- The original column source containing the values- Returns:
- a new
SymbolTableToUniqueIdSource
-