You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/12/12 12:44:53 UTC
[05/47] tinkerpop git commit: TINKERPOP-1562 More deprecation around
methods on building GremlinExecutor that used ScriptEngines.
TINKERPOP-1562 More deprecation around methods on building GremlinExecutor that used ScriptEngines.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/42194b8d
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/42194b8d
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/42194b8d
Branch: refs/heads/master
Commit: 42194b8de19d74253277396099af8780052ea034
Parents: ddafaef
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 18 05:34:00 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Dec 2 06:28:50 2016 -0500
----------------------------------------------------------------------
.../gremlin/groovy/engine/GremlinExecutor.java | 37 +++++++++++++++++---
1 file changed, 33 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/42194b8d/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
index 90a3b43..5f7ab09 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
@@ -83,7 +83,7 @@ public class GremlinExecutor implements AutoCloseable {
*/
private ScriptEngines scriptEngines;
- private GremlinScriptEngineManager manager;
+ private GremlinScriptEngineManager gremlinScriptEngineManager;
private final Map<String, EngineSettings> settings;
private final Map<String, Map<String, Map<String,Object>>> modules;
@@ -117,7 +117,7 @@ public class GremlinExecutor implements AutoCloseable {
this.globalBindings = builder.globalBindings;
this.enabledPlugins = builder.enabledPlugins;
- this.manager = new CachedGremlinScriptEngineManager();
+ this.gremlinScriptEngineManager = new CachedGremlinScriptEngineManager();
initializeGremlinScriptEngineManager();
// this is temporary so that we can have backward compatibilty to the old plugin system and ScriptEngines
@@ -306,7 +306,7 @@ public class GremlinExecutor implements AutoCloseable {
// do this weirdo check until the now deprecated ScriptEngines is gutted
final Object o = useGremlinScriptEngineManager ?
- manager.getEngineByName(lang).eval(script, bindings) : scriptEngines.eval(script, bindings, lang);
+ gremlinScriptEngineManager.getEngineByName(lang).eval(script, bindings) : scriptEngines.eval(script, bindings, lang);
// apply a transformation before sending back the result - useful when trying to force serialization
// in the same thread that the eval took place given ThreadLocal nature of graphs as well as some
@@ -349,10 +349,18 @@ public class GremlinExecutor implements AutoCloseable {
return evaluationFuture;
}
+ /**
+ * @deprecated As of release 3.2.4, replaced by {@link #getScriptEngineManager()}.
+ */
+ @Deprecated
public ScriptEngines getScriptEngines() {
return this.scriptEngines;
}
+ public GremlinScriptEngineManager getScriptEngineManager() {
+ return this.gremlinScriptEngineManager;
+ }
+
public ExecutorService getExecutorService() {
return executorService;
}
@@ -450,7 +458,7 @@ public class GremlinExecutor implements AutoCloseable {
}
final Method create = builderClazz.getMethod("create");
- manager.addModule((GremlinModule) create.invoke(moduleBuilder));
+ gremlinScriptEngineManager.addModule((GremlinModule) create.invoke(moduleBuilder));
} catch (Exception ex) {
throw new IllegalStateException(ex);
}
@@ -542,6 +550,8 @@ public class GremlinExecutor implements AutoCloseable {
/**
* Create a {@code Builder} and specify the first ScriptEngine to be included.
+ *
+ * @deprecated As of release 3.2.4, replaced by {@link #build()}.
*/
public static Builder build(final String engineName, final List<String> imports,
final List<String> staticImports, final List<String> scripts,
@@ -580,7 +590,10 @@ public class GremlinExecutor implements AutoCloseable {
* @param staticImports A list of static imports for the engine.
* @param scripts A list of scripts to execute in the engine to initialize it.
* @param config Custom configuration map for the ScriptEngine
+ *
+ * @deprecated As of release 3.2.4, replaced by {@link #addModules(String, Map)}.
*/
+ @Deprecated
public Builder addEngineSettings(final String engineName, final List<String> imports,
final List<String> staticImports, final List<String> scripts,
final Map<String, Object> config) {
@@ -593,6 +606,12 @@ public class GremlinExecutor implements AutoCloseable {
return this;
}
+ /**
+ * Add a configuration for a {@link GremlinModule} to the executor. The key is the fully qualified class name
+ * of the {@link GremlinModule} instance and the value is a map of configuration values. In that map, the key
+ * is the name of a builder method on the {@link GremlinModule} and the value is some argument to pass to that
+ * method.
+ */
public Builder addModules(final String engineName, final Map<String, Map<String,Object>> modules) {
this.modules.put(engineName, modules);
return this;
@@ -623,7 +642,10 @@ public class GremlinExecutor implements AutoCloseable {
/**
* Replaces any settings provided.
+ *
+ * @deprecated As of release 3.2.4, replaced by {@link #addModules(String, Map)}.
*/
+ @Deprecated
public Builder engineSettings(final Map<String, EngineSettings> settings) {
this.settings = settings;
return this;
@@ -681,7 +703,10 @@ public class GremlinExecutor implements AutoCloseable {
/**
* A set of maven coordinates for dependencies to be applied for the script engine instances.
+ *
+ * @deprecated As of release 3.2.4, not replaced.
*/
+ @Deprecated
public Builder use(final List<List<String>> use) {
this.use = use;
return this;
@@ -689,7 +714,11 @@ public class GremlinExecutor implements AutoCloseable {
/**
* Set of the names of plugins that should be enabled for the engine.
+ *
+ * @deprecated As of release 3.2.4, replaced by {@link #addModules(String, Map)} though behavior is not quite
+ * the same.
*/
+ @Deprecated
public Builder enabledPlugins(final Set<String> enabledPlugins) {
this.enabledPlugins = enabledPlugins;
return this;