-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove BigArrays from SearchContext #65981
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ | |
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; | ||
import org.elasticsearch.common.xcontent.ObjectParser; | ||
import org.elasticsearch.common.xcontent.XContentBuilder; | ||
import org.elasticsearch.index.query.QueryRewriteContext; | ||
import org.elasticsearch.search.aggregations.AggregationBuilder; | ||
import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode; | ||
import org.elasticsearch.search.aggregations.AggregatorFactories; | ||
|
@@ -401,11 +400,6 @@ public String getType() { | |
return NAME; | ||
} | ||
|
||
@Override | ||
protected AggregationBuilder doRewrite(QueryRewriteContext queryShardContext) throws IOException { | ||
return super.doRewrite(queryShardContext); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This didn't do anything.... |
||
|
||
@Override | ||
protected ValuesSourceRegistry.RegistryKey<?> getRegistryKey() { | ||
return REGISTRY_KEY; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -230,6 +230,12 @@ public final AggregationUsageService getUsageService() { | |
*/ | ||
public abstract Analyzer getIndexAnalyzer(Function<String, NamedAnalyzer> unindexedFieldAnalyzer); | ||
|
||
/** | ||
* Is this request cacheable? Requests that have | ||
* non-deterministic queries or scripts aren't cachable. | ||
*/ | ||
public abstract boolean isCacheable(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are required by tests. I could avoid adding it with some terrible casting stuff in tests but I think it is better to be up front about it. |
||
|
||
/** | ||
* Implementation of {@linkplain AggregationContext} for production usage | ||
* that wraps our ubiquitous {@link QueryShardContext} and anything else | ||
|
@@ -239,6 +245,7 @@ public final AggregationUsageService getUsageService() { | |
*/ | ||
public static class ProductionAggregationContext extends AggregationContext { | ||
private final QueryShardContext context; | ||
private final BigArrays bigArrays; | ||
private final Query topLevelQuery; | ||
private final AggregationProfiler profiler; | ||
private final MultiBucketConsumer multiBucketConsumer; | ||
|
@@ -277,6 +284,7 @@ public ProductionAggregationContext( | |
Supplier<Boolean> isCancelled | ||
) { | ||
this.context = context; | ||
this.bigArrays = context.bigArrays().withCircuitBreaking(); // We can break in searches. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Had to move with |
||
this.topLevelQuery = topLevelQuery; | ||
this.profiler = profiler; | ||
this.multiBucketConsumer = multiBucketConsumer; | ||
|
@@ -343,7 +351,7 @@ public ValuesSourceRegistry getValuesSourceRegistry() { | |
|
||
@Override | ||
public BigArrays bigArrays() { | ||
return context.bigArrays(); | ||
return bigArrays; | ||
} | ||
|
||
@Override | ||
|
@@ -425,5 +433,10 @@ public CircuitBreaker breaker() { | |
public Analyzer getIndexAnalyzer(Function<String, NamedAnalyzer> unindexedFieldAnalyzer) { | ||
return context.getIndexAnalyzer(unindexedFieldAnalyzer); | ||
} | ||
|
||
@Override | ||
public boolean isCacheable() { | ||
return context.isCacheable(); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clusterService
was unused so I removed it while I was clearingbigArrays
.