Package org.elasticsearch.action.search
Class QueryPhaseResultConsumer
java.lang.Object
org.elasticsearch.action.search.QueryPhaseResultConsumer
- All Implemented Interfaces:
 Closeable,AutoCloseable,org.elasticsearch.core.Releasable
A 
ArraySearchPhaseResults implementation that incrementally reduces aggregation results
 as shard results are consumed.
 This implementation adds the memory that it used to save and reduce the results of shard aggregations
 in the CircuitBreaker.REQUEST circuit breaker. Before any partial or final reduce, the memory
 needed to reduce the aggregations is estimated and a CircuitBreakingException is thrown if it
 exceeds the maximum memory allowed in this breaker.- 
Constructor Summary
ConstructorsConstructorDescriptionQueryPhaseResultConsumer(SearchRequest request, Executor executor, CircuitBreaker circuitBreaker, SearchPhaseController controller, SearchProgressListener progressListener, NamedWriteableRegistry namedWriteableRegistry, int expectedResultSize, Consumer<Exception> onPartialMergeFailure)Creates aQueryPhaseResultConsumerthat incrementally reduces aggregation results as shard results are consumed. - 
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidconsumeResult(SearchPhaseResult result, Runnable next)intreduce() 
- 
Constructor Details
- 
QueryPhaseResultConsumer
public QueryPhaseResultConsumer(SearchRequest request, Executor executor, CircuitBreaker circuitBreaker, SearchPhaseController controller, SearchProgressListener progressListener, NamedWriteableRegistry namedWriteableRegistry, int expectedResultSize, Consumer<Exception> onPartialMergeFailure)Creates aQueryPhaseResultConsumerthat incrementally reduces aggregation results as shard results are consumed. 
 - 
 - 
Method Details
- 
close
public void close()- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Specified by:
 closein interfaceorg.elasticsearch.core.Releasable
 - 
consumeResult
 - 
reduce
- Throws:
 Exception
 - 
getNumReducePhases
public int getNumReducePhases() 
 -