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
ConstructorDescriptionQueryPhaseResultConsumer(SearchRequest request, Executor executor, CircuitBreaker circuitBreaker, SearchPhaseController controller, SearchProgressListener progressListener, NamedWriteableRegistry namedWriteableRegistry, int expectedResultSize, Consumer<Exception> onPartialMergeFailure)
Creates aQueryPhaseResultConsumer
that incrementally reduces aggregation results as shard results are consumed. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
consumeResult(SearchPhaseResult result, Runnable next)
int
reduce()
-
Constructor Details
-
QueryPhaseResultConsumer
public QueryPhaseResultConsumer(SearchRequest request, Executor executor, CircuitBreaker circuitBreaker, SearchPhaseController controller, SearchProgressListener progressListener, NamedWriteableRegistry namedWriteableRegistry, int expectedResultSize, Consumer<Exception> onPartialMergeFailure)Creates aQueryPhaseResultConsumer
that incrementally reduces aggregation results as shard results are consumed.
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.elasticsearch.core.Releasable
-
consumeResult
-
reduce
- Throws:
Exception
-
getNumReducePhases
public int getNumReducePhases()
-