Package com.illumon.iris.db.v2.utils
Class IndexUtilities
java.lang.Object
com.illumon.iris.db.v2.utils.IndexUtilities
public class IndexUtilities extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
IndexUtilities.Comparator
-
Constructor Summary
Constructors Constructor Description IndexUtilities()
-
Method Summary
Modifier and Type Method Description static com.fishlib.base.log.LogOutput
append(com.fishlib.base.log.LogOutput logOutput, ReadOnlyIndex.RangeIterator it)
static void
fillKeyIndicesChunk(ReadOnlyIndex index, WritableLongChunk<? extends Attributes.KeyIndices> chunkToFill)
static void
fillKeyRangesChunk(ReadOnlyIndex index, WritableLongChunk<Attributes.OrderedKeyRanges> chunkToFill)
static void
forAllInvertedLongRanges(Index sourceIndex, Index destIndex, LongRangeConsumer lrc)
This is equivalent to `sourceIndex.invert(destIndex).forAllLongRanges(lrc)`, but requires O(1) space.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.
-
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
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 enablesPreemptiveUpdatesTable.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 indexdestIndex
- index values to look for within sourceIndexlrc
- consumer to handle each inverted range that is encountered
-