public static final class IndexSorter.LongSorter extends Object implements IndexSorter
IndexSorter.ComparableProvider, IndexSorter.DocComparator, IndexSorter.DoubleSorter, IndexSorter.FloatSorter, IndexSorter.IntSorter, IndexSorter.LongSorter, IndexSorter.NumericDocValuesProvider, IndexSorter.SortedDocValuesProvider, IndexSorter.StringSorter
Constructor and Description |
---|
LongSorter(String providerName,
Long missingValue,
boolean reverse,
IndexSorter.NumericDocValuesProvider valuesProvider)
Creates a new LongSorter
|
Modifier and Type | Method and Description |
---|---|
IndexSorter.ComparableProvider[] |
getComparableProviders(List<? extends LeafReader> readers)
Get an array of
IndexSorter.ComparableProvider , one per segment, for merge sorting documents in different segments |
IndexSorter.DocComparator |
getDocComparator(LeafReader reader,
int maxDoc)
Get a comparator that determines the sort order of docs within a single Reader.
|
String |
getProviderName()
The SPI-registered name of a
SortFieldProvider that will deserialize the parent SortField |
public LongSorter(String providerName, Long missingValue, boolean reverse, IndexSorter.NumericDocValuesProvider valuesProvider)
public IndexSorter.ComparableProvider[] getComparableProviders(List<? extends LeafReader> readers) throws IOException
IndexSorter
IndexSorter.ComparableProvider
, one per segment, for merge sorting documents in different segmentsgetComparableProviders
in interface IndexSorter
readers
- the readers to be mergedIOException
public IndexSorter.DocComparator getDocComparator(LeafReader reader, int maxDoc) throws IOException
IndexSorter
FieldComparator
API because it requires docIDs to be sent
in-order. The default implementations allocate array[maxDoc] to hold native values for comparison,
but 1) they are transient (only alive while sorting this one segment) and 2) in the typical
index sorting case, they are only used to sort newly flushed segments, which will be smaller
than merged segmentsgetDocComparator
in interface IndexSorter
reader
- the Reader to sortmaxDoc
- the number of documents in the ReaderIOException
public String getProviderName()
IndexSorter
SortFieldProvider
that will deserialize the parent SortFieldgetProviderName
in interface IndexSorter
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.