Package com.illumon.iris.db.v2.utils
Class InverseIndexRedirectionIndexImpl
java.lang.Object
com.illumon.iris.db.v2.utils.InverseIndexRedirectionIndexImpl
- All Implemented Interfaces:
RedirectionIndex
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.utils.RedirectionIndex
RedirectionIndex.Factory, RedirectionIndex.FillContext -
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.utils.RedirectionIndex
DEFAULT_FILL_INSTANCE, EMPTY_CONTEXT, FACTORY, USE_LOCK_FREE_IMPL_PROPERTY_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIf this RedirectionIndex is guaranteed to map outer keys in ascending order to inner keys in ascending order; then return true; all other redirections must return false.voidensureUpdateCapacity(int capacity) Ensure that there is enough space to perform at least 'capacity' updates.voidfillChunk(RedirectionIndex.FillContext fillContext, WritableLongChunk<Attributes.KeyIndices> mappedKeysOut, OrderedKeys keysToMap) Lookup each element in OrderedKeys and write the result to mappedKeysOutvoidfillPrevChunk(RedirectionIndex.FillContext fillContext, WritableLongChunk<Attributes.KeyIndices> mappedKeysOut, OrderedKeys keysToMap) longget(long key) Get the current inner mapping for the specified key.longgetPrev(long key) Get the previous mapping for the specified keylongput(long key, long index) Insert a mapping from key to inner index into this redirection.longremove(long leftIndex) Remove the specified mapping from the redirectionvoidIndicate to the implementation that it should track changes with previous values for ticking updates.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.illumon.iris.db.v2.utils.RedirectionIndex
applyShift, fillChunkUnordered, fillFromChunk, makeFillContext, makeFillFromContext, putVoid, removeAll, removeAllUnordered, removeVoid
-
Constructor Details
-
InverseIndexRedirectionIndexImpl
-
-
Method Details
-
ascendingMapping
public boolean ascendingMapping()Description copied from interface:RedirectionIndexIf this RedirectionIndex is guaranteed to map outer keys in ascending order to inner keys in ascending order; then return true; all other redirections must return false.- Specified by:
ascendingMappingin interfaceRedirectionIndex- Returns:
- if our output maintains ascending order
-
put
public long put(long key, long index) Description copied from interface:RedirectionIndexInsert a mapping from key to inner index into this redirection.- Specified by:
putin interfaceRedirectionIndex- Parameters:
key- the key to be mappedindex- the index the key should be mapped to on the inner source- Returns:
- the previous mapping for the specified key, or
ReadOnlyIndex.NULL_KEYif there was none.
-
ensureUpdateCapacity
public void ensureUpdateCapacity(int capacity) Description copied from interface:RedirectionIndexEnsure that there is enough space to perform at least 'capacity' updates.- Specified by:
ensureUpdateCapacityin interfaceRedirectionIndex- Parameters:
capacity- the capacity of the update
-
get
public long get(long key) Description copied from interface:RedirectionIndexGet the current inner mapping for the specified key.- Specified by:
getin interfaceRedirectionIndex- Parameters:
key- the key to find a mapping for.- Returns:
- the current mapping for the specified key, or
ReadOnlyIndex.NULL_KEYif there was none.
-
getPrev
public long getPrev(long key) Description copied from interface:RedirectionIndexGet the previous mapping for the specified key- Specified by:
getPrevin interfaceRedirectionIndex- Parameters:
key- the key to locate a mapping for- Returns:
- the mapped value or
ReadOnlyIndex.NULL_KEYif none existed.
-
fillChunk
public void fillChunk(@NotNull RedirectionIndex.FillContext fillContext, @NotNull WritableLongChunk<Attributes.KeyIndices> mappedKeysOut, @NotNull OrderedKeys keysToMap) Description copied from interface:RedirectionIndexLookup each element in OrderedKeys and write the result to mappedKeysOut- Specified by:
fillChunkin interfaceRedirectionIndex- Parameters:
fillContext- the RedirectionIndex FillContextmappedKeysOut- the result chunkkeysToMap- the keys to lookup in this redirection index
-
fillPrevChunk
public void fillPrevChunk(@NotNull RedirectionIndex.FillContext fillContext, @NotNull WritableLongChunk<Attributes.KeyIndices> mappedKeysOut, @NotNull OrderedKeys keysToMap) - Specified by:
fillPrevChunkin interfaceRedirectionIndex
-
startTrackingPrevValues
public void startTrackingPrevValues()Description copied from interface:RedirectionIndexIndicate to the implementation that it should track changes with previous values for ticking updates.- Specified by:
startTrackingPrevValuesin interfaceRedirectionIndex
-
remove
public long remove(long leftIndex) Description copied from interface:RedirectionIndexRemove the specified mapping from the redirection- Specified by:
removein interfaceRedirectionIndex- Parameters:
leftIndex- the index to unmap.- Returns:
- the previous mapping or
ReadOnlyIndex.NULL_KEYif none existed.
-
toString
-