Class ProfilingLeafBucketCollector
java.lang.Object
org.elasticsearch.search.aggregations.LeafBucketCollector
org.elasticsearch.search.profile.aggregation.ProfilingLeafBucketCollector
- All Implemented Interfaces:
org.apache.lucene.search.LeafCollector
-
Field Summary
Fields inherited from class org.elasticsearch.search.aggregations.LeafBucketCollector
NO_OP_COLLECTOR -
Constructor Summary
ConstructorsConstructorDescriptionProfilingLeafBucketCollector(LeafBucketCollector delegate, AggregationProfileBreakdown profileBreakdown) -
Method Summary
Modifier and TypeMethodDescriptionvoidcollect(int doc, long bucket)Collect the givendocin the bucket owned byowningBucketOrd.booleanisNoop()Does this collector collect anything? If this returns true we can safely just never callLeafBucketCollector.collect(int, long).voidsetScorer(org.apache.lucene.search.Scorable scorer)Methods inherited from class org.elasticsearch.search.aggregations.LeafBucketCollector
collectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.search.LeafCollector
competitiveIterator
-
Constructor Details
-
ProfilingLeafBucketCollector
public ProfilingLeafBucketCollector(LeafBucketCollector delegate, AggregationProfileBreakdown profileBreakdown)
-
-
Method Details
-
collect
Description copied from class:LeafBucketCollectorCollect the givendocin the bucket owned byowningBucketOrd.The implementation of this method metric aggregations is generally something along the lines of
array[owningBucketOrd] += loadValueFromDoc(doc)Bucket aggregations have more trouble because their job is to make new ordinals. So their implementation generally looks kind of like
long myBucketOrd = mapOwningBucketAndValueToMyOrd(owningBucketOrd, loadValueFromDoc(doc)); collectBucket(doc, myBucketOrd);Some bucket aggregations "know" how many ordinals each owning ordinal needs so they can map "densely". The
rangeaggregation, for example, can perform this mapping with something like:
Other aggregations don't know how many buckets will fall into any particular owning bucket. Thereturn rangeCount * owningBucketOrd + matchingRange(value);termsaggregation, for example, usesLongKeyedBucketOrdswhich amounts to a hash lookup.- Specified by:
collectin classLeafBucketCollector- Throws:
IOException
-
setScorer
- Specified by:
setScorerin interfaceorg.apache.lucene.search.LeafCollector- Overrides:
setScorerin classLeafBucketCollector- Throws:
IOException
-
isNoop
public boolean isNoop()Description copied from class:LeafBucketCollectorDoes this collector collect anything? If this returns true we can safely just never callLeafBucketCollector.collect(int, long).- Overrides:
isNoopin classLeafBucketCollector
-