Interface FacetRecorder
- All Known Implementing Classes:
CountFacetRecorder
,LongAggregationsFacetRecorder
,MultiFacetsRecorder
TODO: In the next iteration we can add an extra layer between FacetRecorder and
LeafFacetRecorder, e.g. SliceFacetRecorder. The new layer will be created per Collector
, which means that collecting of multiple leafs (segments)
within a slice is sequential and can be done to a single non-sync map to improve performance and
reduce memory consumption. We already tried that, but didn't see any performance improvement.
Given that it also makes lazy leaf recorder init in FacetFieldCollector
trickier, it was decided to rollback the
initial attempt and try again later, in the next iteration.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(int ordinal) Check if any data was recorded for provided facet ordinal.getLeafRecorder
(LeafReaderContext context) Get leaf recorder.boolean
isEmpty()
True if there are no recordsReturn next collected ordinal, orOrdinalIterator.NO_MORE_ORDS
void
reduce
(FacetCutter facetCutter) Reduce leaf recorder results into this recorder.
-
Method Details
-
getLeafRecorder
Get leaf recorder.- Throws:
IOException
-
recordedOrds
OrdinalIterator recordedOrds()Return next collected ordinal, orOrdinalIterator.NO_MORE_ORDS
-
isEmpty
boolean isEmpty()True if there are no records -
reduce
Reduce leaf recorder results into this recorder. IfFacetCutter.getOrdinalsToRollup()
result is not null, it also rolls up values.After this method is called, it's illegal to add values to recorder, i.e. calling
getLeafRecorder(org.apache.lucene.index.LeafReaderContext)
orLeafFacetRecorder.record(int, int)
on its leaf recorders.- Throws:
UnsupportedOperationException
- ifFacetCutter.getOrdinalsToRollup()
returns not null but this recorder doesn't support rollup.IOException
-
contains
boolean contains(int ordinal) Check if any data was recorded for provided facet ordinal.
-