summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/search/aggregations/metrics
diff options
context:
space:
mode:
authorRyan Ernst <ryan@iernst.net>2017-05-26 00:02:54 -0700
committerGitHub <noreply@github.com>2017-05-26 00:02:54 -0700
commit74e031e8421928e48bb72ceb189aeffdd40698b6 (patch)
treeb8af501e89a79a050bde9a9301aa5f135e10e18f /core/src/main/java/org/elasticsearch/search/aggregations/metrics
parent8eab1fefa1bfe3ea33d3ad8f95375609f4044bef (diff)
Scripting: Rename CompiledType to FactoryType in ScriptContext (#24897)
This commit renames the concept of the "compiled type" to a "factory type", along with all implementations of this class to be named Factory. This brings it inline with the classes purpose.
Diffstat (limited to 'core/src/main/java/org/elasticsearch/search/aggregations/metrics')
-rw-r--r--core/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/InternalScriptedMetric.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/InternalScriptedMetric.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/InternalScriptedMetric.java
index a309a0ddcc..49cb6dcf96 100644
--- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/InternalScriptedMetric.java
+++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/scripted/InternalScriptedMetric.java
@@ -24,7 +24,6 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.script.ExecutableScript;
import org.elasticsearch.script.Script;
-import org.elasticsearch.script.ScriptContext;
import org.elasticsearch.search.aggregations.InternalAggregation;
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
@@ -95,9 +94,9 @@ public class InternalScriptedMetric extends InternalAggregation implements Scrip
if (firstAggregation.reduceScript.getParams() != null) {
vars.putAll(firstAggregation.reduceScript.getParams());
}
- ExecutableScript.Compiled compiled = reduceContext.scriptService().compile(
+ ExecutableScript.Factory factory = reduceContext.scriptService().compile(
firstAggregation.reduceScript, ExecutableScript.AGGS_CONTEXT);
- ExecutableScript script = compiled.newInstance(vars);
+ ExecutableScript script = factory.newInstance(vars);
aggregation = Collections.singletonList(script.run());
} else if (reduceContext.isFinalReduce()) {
aggregation = Collections.singletonList(aggregationObjects);