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 2017/02/25 16:53:44 UTC
[1/2] tinkerpop git commit: TINKERPOP-1612 Removed dependency on
gremlin-groovy-test from hadoop-gremlin
Repository: tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1612 89dc0c577 -> 89e4968c8
TINKERPOP-1612 Removed dependency on gremlin-groovy-test from hadoop-gremlin
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/3ef07cb9
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/3ef07cb9
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/3ef07cb9
Branch: refs/heads/TINKERPOP-1612
Commit: 3ef07cb9c9ac4815f6b5becc8e2432fcefcab0cb
Parents: 89dc0c5
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Sat Feb 25 11:48:40 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sat Feb 25 11:48:40 2017 -0500
----------------------------------------------------------------------
hadoop-gremlin/pom.xml | 6 ------
1 file changed, 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3ef07cb9/hadoop-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/pom.xml b/hadoop-gremlin/pom.xml
index 927b2af..5dbcfe9 100644
--- a/hadoop-gremlin/pom.xml
+++ b/hadoop-gremlin/pom.xml
@@ -139,12 +139,6 @@ limitations under the License.
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
- <artifactId>gremlin-groovy-test</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkergraph-gremlin</artifactId>
<version>${project.version}</version>
<scope>test</scope>
[2/2] tinkerpop git commit: TINKERPOP-1612 Allow any scriptengine to
be used for ScriptRecordReader
Posted by sp...@apache.org.
TINKERPOP-1612 Allow any scriptengine to be used for ScriptRecordReader
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/89e4968c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/89e4968c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/89e4968c
Branch: refs/heads/TINKERPOP-1612
Commit: 89e4968c8eafe282eb78f67f1f7e2ce6705f0fc4
Parents: 3ef07cb
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Sat Feb 25 11:49:01 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sat Feb 25 11:49:01 2017 -0500
----------------------------------------------------------------------
.../hadoop/structure/io/script/ScriptRecordReader.java | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/89e4968c/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/script/ScriptRecordReader.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/script/ScriptRecordReader.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/script/ScriptRecordReader.java
index ea72f9a..3299c1c 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/script/ScriptRecordReader.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/script/ScriptRecordReader.java
@@ -27,12 +27,11 @@ import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.input.LineRecordReader;
-import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider;
-import org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider;
-import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
import org.apache.tinkerpop.gremlin.hadoop.Constants;
import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
import org.apache.tinkerpop.gremlin.hadoop.structure.util.ConfUtil;
+import org.apache.tinkerpop.gremlin.jsr223.CachedGremlinScriptEngineManager;
+import org.apache.tinkerpop.gremlin.jsr223.GremlinScriptEngineManager;
import org.apache.tinkerpop.gremlin.process.computer.GraphFilter;
import org.apache.tinkerpop.gremlin.process.computer.util.VertexProgramHelper;
import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -58,13 +57,14 @@ import java.util.Optional;
public final class ScriptRecordReader extends RecordReader<NullWritable, VertexWritable> {
protected final static String SCRIPT_FILE = "gremlin.hadoop.scriptInputFormat.script";
- //protected final static String SCRIPT_ENGINE = "gremlin.hadoop.scriptInputFormat.scriptEngine";
+ protected final static String SCRIPT_ENGINE = "gremlin.hadoop.scriptInputFormat.scriptEngine";
private final static String GRAPH = "graph";
private final static String LINE = "line";
private final static String FACTORY = "factory";
private final static String READ_CALL = "parse(" + LINE + "," + FACTORY + ")";
private final VertexWritable vertexWritable = new VertexWritable();
private final LineRecordReader lineRecordReader;
+ private final GremlinScriptEngineManager manager = new CachedGremlinScriptEngineManager();
private ScriptEngine engine;
private String parse;
@@ -82,8 +82,7 @@ public final class ScriptRecordReader extends RecordReader<NullWritable, VertexW
final Configuration configuration = context.getConfiguration();
if (configuration.get(Constants.GREMLIN_HADOOP_GRAPH_FILTER, null) != null)
this.graphFilter = VertexProgramHelper.deserialize(ConfUtil.makeApacheConfiguration(configuration), Constants.GREMLIN_HADOOP_GRAPH_FILTER);
- this.engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) new DefaultImportCustomizerProvider());
- //this.engine = ScriptEngineCache.get(configuration.get(SCRIPT_ENGINE, ScriptEngineCache.DEFAULT_SCRIPT_ENGINE));
+ this.engine = manager.getEngineByName(configuration.get(SCRIPT_ENGINE, "gremlin-groovy"));
final FileSystem fs = FileSystem.get(configuration);
try (final InputStream stream = fs.open(new Path(configuration.get(SCRIPT_FILE)));
final InputStreamReader reader = new InputStreamReader(stream)) {