Class IndexUtilities

java.lang.Object
com.illumon.iris.db.v2.utils.IndexUtilities

public class IndexUtilities extends Object
  • Constructor Details

    • IndexUtilities

      public IndexUtilities()
  • Method Details

    • fillKeyIndicesChunk

      public static void fillKeyIndicesChunk(ReadOnlyIndex index, WritableLongChunk<? extends Attributes.KeyIndices> chunkToFill)
    • fillKeyRangesChunk

      public static void fillKeyRangesChunk(ReadOnlyIndex index, WritableLongChunk<Attributes.OrderedKeyRanges> chunkToFill)
    • append

      public static com.fishlib.base.log.LogOutput append(com.fishlib.base.log.LogOutput logOutput, ReadOnlyIndex.RangeIterator it)
    • rangeSearch

      public static long rangeSearch(long begin, long end, IndexUtilities.Comparator comp)
      Look for the biggest value of i that satisfies begin <= i <= end and comp.directionToTargetFrom(i) > 0, or some value that satisfies comp.directionToTargetFrom(i) == 0.
      Parameters:
      begin - The beginning of the range (inclusive)
      end - The end of the range (inclusive)
      comp - a Comparator.
      Returns:
      the last position i inside the provided range that satisfies comp.directionToTargetFrom(i) > 0, or some position that satisfies comp.directionToTargetFrom(i) == 0.
    • forAllInvertedLongRanges

      public static void forAllInvertedLongRanges(Index sourceIndex, Index destIndex, LongRangeConsumer lrc)
      This is equivalent to `sourceIndex.invert(destIndex).forAllLongRanges(lrc)`, but requires O(1) space. Note that coalescing adjacent position-space runs enables PreemptiveUpdatesTable.copyPartialColumns(com.illumon.iris.db.v2.utils.Index, com.illumon.iris.db.v2.utils.Index, java.lang.Object[], java.lang.Object[]) to make minimal System.arraycopy calls.
      Parameters:
      sourceIndex - index to find the destIndex keys in - ranges in the callback will be on this index
      destIndex - index values to look for within sourceIndex
      lrc - consumer to handle each inverted range that is encountered