Module org.elasticsearch.xcore
Interface ExponentialHistogramValuesReader
public interface ExponentialHistogramValuesReader
-
Method Summary
Modifier and TypeMethodDescriptionbooleanadvanceExact(int target) Advance the iterator to exactlytargetand return whethertargethas a value.default org.apache.lucene.search.DocIdSetIteratordefault intReturns the histogram value for the current document.doublemaxValue()A shortcut for invokingExponentialHistogram.max()on the return value ofhistogramValue().doubleminValue()A shortcut for invokingExponentialHistogram.min()on the return value ofhistogramValue().doublesumValue()A shortcut for invokingExponentialHistogram.sum()on the return value ofhistogramValue().longA shortcut for invokingExponentialHistogram.valueCount()on the return value ofhistogramValue().
-
Method Details
-
histogramValue
Returns the histogram value for the current document. Must be called only after a successful call toadvanceExact(int). The returned histogram instance may be reused across calls, so if you need to hold on to it, make a copy.- Returns:
- the histogram value for the current document
- Throws:
IOException
-
valuesCountValue
A shortcut for invokingExponentialHistogram.valueCount()on the return value ofhistogramValue(). This method is more performant because it avoids loading the unnecessary parts of the histogram. Must be called only after a successful call toadvanceExact(int).- Returns:
- the count of values in the histogram for the current document
- Throws:
IOException
-
sumValue
A shortcut for invokingExponentialHistogram.sum()on the return value ofhistogramValue(). This method is more performant because it avoids loading the unnecessary parts of the histogram. Must be called only after a successful call toadvanceExact(int).- Returns:
- the sum of values in the histogram for the current document
- Throws:
IOException
-
minValue
A shortcut for invokingExponentialHistogram.min()on the return value ofhistogramValue(). This method is more performant because it avoids loading the unnecessary parts of the histogram. Must be called only after a successful call toadvanceExact(int). If the histogram is empty, this will returnDouble.POSITIVE_INFINITY.- Returns:
- the minimum of the values in the histogram for the current document
- Throws:
IOException
-
maxValue
A shortcut for invokingExponentialHistogram.max()on the return value ofhistogramValue(). This method is more performant because it avoids loading the unnecessary parts of the histogram. Must be called only after a successful call toadvanceExact(int). If the histogram is empty, this will returnDouble.NEGATIVE_INFINITY.- Returns:
- the maximum of the values in the histogram for the current document
- Throws:
IOException
-
advanceExact
Advance the iterator to exactlytargetand return whethertargethas a value.targetmust be greater than or equal to the current doc ID and must be a valid doc ID, ie. ≥ 0 and <maxDoc.- Throws:
IOException
-
docValueCount
default int docValueCount() -
docIdIterator
- Returns:
- a doc id iterator over the doc values when available, otherwise null.
Moving the returned iterator also moves the position of the
ExponentialHistogramValuesReaderinstance.
-