java.lang.Object
org.apache.lucene.util.Sorter
org.apache.lucene.util.StableMSBRadixSorter.MergeSorter
- Enclosing class:
StableMSBRadixSorter
A MergeSorter taking advantage of temporary storage.
-
Field Summary
Fields inherited from class org.apache.lucene.util.Sorter
BINARY_SORT_THRESHOLD, INSERTION_SORT_THRESHOLD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbulkSave(int from, int tmpFrom, int len) We tried to expose this to implementations to get a bulk copy optimization.private voidmerge(int from, int to, int mid) private voidmergeSort(int from, int to) 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.voidsort(int from, int to) Sort the slice which starts atfrom(inclusive) and ends atto(exclusive).Methods inherited from class org.apache.lucene.util.Sorter
binarySort, binarySort, checkRange, compare, comparePivot, doRotate, heapChild, heapify, heapParent, heapSort, insertionSort, lower, lower2, mergeInPlace, reverse, rotate, setPivot, siftDown, swap, upper, upper2
-
Constructor Details
-
MergeSorter
protected MergeSorter()
-
-
Method Details
-
sort
public void sort(int from, int to) Description copied from class:SorterSort the slice which starts atfrom(inclusive) and ends atto(exclusive). -
mergeSort
private void mergeSort(int from, int to) -
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. -
bulkSave
private void bulkSave(int from, int tmpFrom, int len) We tried to expose this to implementations to get a bulk copy optimization. But it did not bring a noticeable improvement in benchmark aslenis usually small. -
merge
private void merge(int from, int to, int mid)
-