You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by tw...@apache.org on 2016/05/10 20:58:10 UTC

[1/3] incubator-tinkerpop git commit: Precompile scripts during ScriptRecordReader initialization.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 9159fe710 -> 16b4a5f59


Precompile scripts during ScriptRecordReader initialization.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/be6f8d79
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/be6f8d79
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/be6f8d79

Branch: refs/heads/master
Commit: be6f8d79f606cc0a39dd45457e26328dd31e5636
Parents: 09b87ea
Author: Ted Wilmes <tw...@gmail.com>
Authored: Fri May 6 14:54:54 2016 -0500
Committer: Ted Wilmes <tw...@gmail.com>
Committed: Fri May 6 14:54:54 2016 -0500

----------------------------------------------------------------------
 .../hadoop/structure/io/script/ScriptRecordReader.java       | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/be6f8d79/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 16265a2..ea72f9a 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
@@ -41,6 +41,8 @@ import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
 
 import javax.script.Bindings;
+import javax.script.Compilable;
+import javax.script.CompiledScript;
 import javax.script.ScriptEngine;
 import javax.script.ScriptException;
 import java.io.IOException;
@@ -66,6 +68,7 @@ public final class ScriptRecordReader extends RecordReader<NullWritable, VertexW
 
     private ScriptEngine engine;
     private String parse;
+    private CompiledScript script;
 
     private GraphFilter graphFilter = new GraphFilter();
 
@@ -85,6 +88,9 @@ public final class ScriptRecordReader extends RecordReader<NullWritable, VertexW
         try (final InputStream stream = fs.open(new Path(configuration.get(SCRIPT_FILE)));
              final InputStreamReader reader = new InputStreamReader(stream)) {
             this.parse = String.join("\n", IOUtils.toString(reader), READ_CALL);
+            script = ((Compilable) engine).compile(this.parse);
+        } catch (ScriptException e) {
+            throw new IOException(e.getMessage(), e);
         }
     }
 
@@ -99,7 +105,7 @@ public final class ScriptRecordReader extends RecordReader<NullWritable, VertexW
                 bindings.put(GRAPH, graph);
                 bindings.put(LINE, this.lineRecordReader.getCurrentValue().toString());
                 bindings.put(FACTORY, factory);
-                final StarGraph.StarVertex sv = (StarGraph.StarVertex) engine.eval(this.parse, bindings);
+                final StarGraph.StarVertex sv = (StarGraph.StarVertex) script.eval(bindings);
                 if (sv != null) {
                     final Optional<StarGraph.StarVertex> vertex = sv.applyGraphFilter(this.graphFilter);
                     if (vertex.isPresent()) {


[3/3] incubator-tinkerpop git commit: Updated CHANGELOG.

Posted by tw...@apache.org.
Updated CHANGELOG.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/16b4a5f5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/16b4a5f5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/16b4a5f5

Branch: refs/heads/master
Commit: 16b4a5f59f7322256a17b6880d84b955e86532ed
Parents: 546f842
Author: Ted Wilmes <tw...@gmail.com>
Authored: Tue May 10 16:57:41 2016 -0400
Committer: Ted Wilmes <tw...@gmail.com>
Committed: Tue May 10 16:57:41 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/16b4a5f5/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index a230df1..82ef2c6 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -44,6 +44,7 @@ TinkerPop 3.2.1 (NOT OFFICIALLY RELEASED YET)
 * Deprecated the `ScriptExecutor` - the `-e` option to `gremlin.sh` is now handled by `Console`.
 * `Traversal` now allows cancellation with `Thread.interrupt()`.
 * Added a Gremlin language variant tutorial teaching people how to embed Gremlin in a host programming language.
+* Added precompile of ScriptInputFormat scripts to ScriptRecordReader to improve performance.
 
 [[release-3.2.0-incubating]]
 TinkerPop 3.2.0 (Release Date: April 8, 2016)


[2/3] incubator-tinkerpop git commit: Merge branch 'TINKERPOP-1295'

Posted by tw...@apache.org.
Merge branch 'TINKERPOP-1295'


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/546f8420
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/546f8420
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/546f8420

Branch: refs/heads/master
Commit: 546f84205896ca94b2c5198f3ba20194c3b5b399
Parents: 9159fe7 be6f8d7
Author: Ted Wilmes <tw...@gmail.com>
Authored: Tue May 10 16:30:46 2016 -0400
Committer: Ted Wilmes <tw...@gmail.com>
Committed: Tue May 10 16:30:46 2016 -0400

----------------------------------------------------------------------
 .../hadoop/structure/io/script/ScriptRecordReader.java       | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------