java.lang.Object
org.apache.lucene.util.Sorter
org.apache.lucene.util.MSBRadixSorter
org.apache.lucene.util.StableMSBRadixSorter
Stable radix sorter for variable-length strings.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA MergeSorter taking advantage of temporary storage. -
Field Summary
FieldsFields inherited from class org.apache.lucene.util.MSBRadixSorter
HISTOGRAM_SIZE, LENGTH_THRESHOLD, LEVEL_THRESHOLD, maxLengthFields inherited from class org.apache.lucene.util.Sorter
BINARY_SORT_THRESHOLD, INSERTION_SORT_THRESHOLD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SortergetFallbackSorter(int k) Get a fall-back sorter which may assume that the first k bytes of all compared strings are equal.protected voidreorder(int from, int to, int[] startOffsets, int[] endOffsets, int k) Reorder elements in stable way, since Dutch sort does not guarantee ordering for same values.protected abstract voidrestore(int i, int j) Restore values between i-th and j-th(excluding) in temporary storage into original storage.protected abstract voidsave(int i, int j) Save the i-th value into the j-th position in temporary storage.Methods inherited from class org.apache.lucene.util.MSBRadixSorter
buildHistogram, byteAt, compare, getBucket, shouldFallback, sort, sortMethods inherited from class org.apache.lucene.util.Sorter
binarySort, binarySort, checkRange, comparePivot, doRotate, heapChild, heapify, heapParent, heapSort, insertionSort, lower, lower2, mergeInPlace, reverse, rotate, setPivot, siftDown, swap, upper, upper2
-
Field Details
-
fixedStartOffsets
private final int[] fixedStartOffsets
-
-
Constructor Details
-
StableMSBRadixSorter
public StableMSBRadixSorter(int maxLength)
-
-
Method Details
-
save
protected abstract void save(int i, int j) Save the i-th value into the j-th position in temporary storage. -
restore
protected abstract void restore(int i, int j) Restore values between i-th and j-th(excluding) in temporary storage into original storage. -
getFallbackSorter
Description copied from class:MSBRadixSorterGet a fall-back sorter which may assume that the first k bytes of all compared strings are equal.- Overrides:
getFallbackSorterin classMSBRadixSorter
-
reorder
protected void reorder(int from, int to, int[] startOffsets, int[] endOffsets, int k) Reorder elements in stable way, since Dutch sort does not guarantee ordering for same values.When this method returns, startOffsets and endOffsets are equal.
- Overrides:
reorderin classMSBRadixSorter- Parameters:
startOffsets- start offsets per bucketendOffsets- end offsets per bucket
-