Class InverseIndexRedirectionIndexImpl

java.lang.Object
com.illumon.iris.db.v2.utils.InverseIndexRedirectionIndexImpl
All Implemented Interfaces:
RedirectionIndex

public class InverseIndexRedirectionIndexImpl extends Object implements RedirectionIndex
  • Constructor Details

    • InverseIndexRedirectionIndexImpl

      public InverseIndexRedirectionIndexImpl(Index wrappedIndex)
  • Method Details

    • ascendingMapping

      public boolean ascendingMapping()
      Description copied from interface: RedirectionIndex
      If 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:
      ascendingMapping in interface RedirectionIndex
      Returns:
      if our output maintains ascending order
    • put

      public long put(long key, long index)
      Description copied from interface: RedirectionIndex
      Insert a mapping from key to inner index into this redirection.
      Specified by:
      put in interface RedirectionIndex
      Parameters:
      key - the key to be mapped
      index - the index the key should be mapped to on the inner source
      Returns:
      the previous mapping for the specified key, or ReadOnlyIndex.NULL_KEY if there was none.
    • ensureUpdateCapacity

      public void ensureUpdateCapacity(int capacity)
      Description copied from interface: RedirectionIndex
      Ensure that there is enough space to perform at least 'capacity' updates.
      Specified by:
      ensureUpdateCapacity in interface RedirectionIndex
      Parameters:
      capacity - the capacity of the update
    • get

      public long get(long key)
      Description copied from interface: RedirectionIndex
      Get the current inner mapping for the specified key.
      Specified by:
      get in interface RedirectionIndex
      Parameters:
      key - the key to find a mapping for.
      Returns:
      the current mapping for the specified key, or ReadOnlyIndex.NULL_KEY if there was none.
    • getPrev

      public long getPrev(long key)
      Description copied from interface: RedirectionIndex
      Get the previous mapping for the specified key
      Specified by:
      getPrev in interface RedirectionIndex
      Parameters:
      key - the key to locate a mapping for
      Returns:
      the mapped value or ReadOnlyIndex.NULL_KEY if none existed.
    • fillChunk

      public void fillChunk(@NotNull RedirectionIndex.FillContext fillContext, @NotNull WritableLongChunk<Attributes.KeyIndices> mappedKeysOut, @NotNull OrderedKeys keysToMap)
      Description copied from interface: RedirectionIndex
      Lookup each element in OrderedKeys and write the result to mappedKeysOut
      Specified by:
      fillChunk in interface RedirectionIndex
      Parameters:
      fillContext - the RedirectionIndex FillContext
      mappedKeysOut - the result chunk
      keysToMap - 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:
      fillPrevChunk in interface RedirectionIndex
    • startTrackingPrevValues

      public void startTrackingPrevValues()
      Description copied from interface: RedirectionIndex
      Indicate to the implementation that it should track changes with previous values for ticking updates.
      Specified by:
      startTrackingPrevValues in interface RedirectionIndex
    • remove

      public long remove(long leftIndex)
      Description copied from interface: RedirectionIndex
      Remove the specified mapping from the redirection
      Specified by:
      remove in interface RedirectionIndex
      Parameters:
      leftIndex - the index to unmap.
      Returns:
      the previous mapping or ReadOnlyIndex.NULL_KEY if none existed.
    • toString

      public String toString()
      Overrides:
      toString in class Object