diff options
author | Ryan Ernst <ryan@iernst.net> | 2017-05-26 00:02:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-26 00:02:54 -0700 |
commit | 74e031e8421928e48bb72ceb189aeffdd40698b6 (patch) | |
tree | b8af501e89a79a050bde9a9301aa5f135e10e18f /modules/lang-mustache/src/main | |
parent | 8eab1fefa1bfe3ea33d3ad8f95375609f4044bef (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 'modules/lang-mustache/src/main')
-rw-r--r-- | modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustacheScriptEngine.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustacheScriptEngine.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustacheScriptEngine.java index dd67820889..3363db47b4 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustacheScriptEngine.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustacheScriptEngine.java @@ -25,7 +25,6 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.logging.log4j.util.Supplier; import org.elasticsearch.SpecialPermission; -import org.elasticsearch.common.Nullable; import org.elasticsearch.common.io.FastStringReader; import org.elasticsearch.common.logging.ESLoggerFactory; import org.elasticsearch.script.ExecutableScript; @@ -33,8 +32,6 @@ import org.elasticsearch.script.GeneralScriptException; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptContext; import org.elasticsearch.script.ScriptEngine; -import org.elasticsearch.script.SearchScript; -import org.elasticsearch.search.lookup.SearchLookup; import java.io.Reader; import java.io.StringWriter; @@ -71,8 +68,8 @@ public final class MustacheScriptEngine implements ScriptEngine { final MustacheFactory factory = createMustacheFactory(params); Reader reader = new FastStringReader(templateSource); Mustache template = factory.compile(reader, "query-template"); - ExecutableScript.Compiled compiled = p -> new MustacheExecutableScript(template, p); - return context.compiledClazz.cast(compiled); + ExecutableScript.Factory compiled = p -> new MustacheExecutableScript(template, p); + return context.factoryClazz.cast(compiled); } private CustomMustacheFactory createMustacheFactory(Map<String, String> params) { @@ -91,7 +88,7 @@ public final class MustacheScriptEngine implements ScriptEngine { * Used at query execution time by script service in order to execute a query template. * */ private class MustacheExecutableScript implements ExecutableScript { - /** Compiled template. */ + /** Factory template. */ private Mustache template; /** Parameters to fill above object with. */ private Map<String, Object> vars; |