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.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, 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 TypeMethodDescriptionvoidfillChunk(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) intgetInt(long index) Get the value at the index as an int.static SymbolTableToUniqueIdSourcegetUniqueIdSource(Table symbolTable, ColumnSource<?> keySource) Create a newSymbolTableToUniqueIdSourcefrom the given symbol table and input column.makeFillContext(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, canUseGrouping, defaultFillChunk, doReinterpret, fillPrevChunk, getComponentType, getGroupingBuilder, getGroupingProvider, getNativeType, getType, hasGrouping, hasGrouping, isSerializable, match, matchWithGrouping, reinterpret, setGroupingProviderMethods 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
getChunkTypeMethods 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, getGroupingBuilder, getGroupingProvider, getNativeType, getPrevSource, getType, hasGrouping, hasGrouping, match, reinterpret, releaseCachedResources, setGroupingProvider, 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
-
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) Create a newSymbolTableToUniqueIdSourcefrom the given symbol table and input column. ThesymbolTablewill 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
-