Merge branch 'tp33'
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index f63c040..e7f975d 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -16,6 +16,44 @@
////
= TinkerPop3 CHANGELOG
+== TinkerPop 3.4.0 (Avant-Gremlin Construction #3 for Theremin and Flowers)
+
+image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/images/avant-gremlin.png[width=185]
+
+[[release-3-4-0]]
+=== TinkerPop 3.4.0 (Release Date: NOT OFFICIALLY RELEASED YET)
+
+This release also includes changes from <<release-3-3-3, 3.3.3>>.
+
+* Moved `Parameterizing` interface to the `org.apache.tinkerpop.gremlin.process.traversal.step` package with other marker interfaces of its type.
+* Replaced `Parameterizing.addPropertyMutations()` with `Configuring.configure()`.
+* Changed interface hierarchy for `Parameterizing` and `Mutating` interfaces as they are tightly related.
+* Introduced the `with()` step modulator which can supply configuration options to `Configuring` steps.
+* Added `supportsUpsert()` option to `VertexFeatures` and `EdgeFeatures`.
+* `min()` and `max()` now support all types implementing `Comparable`.
+* Change the `toString()` of `Path` to be standardized as other graph elements are.
+* `hadoop-gremlin` no longer generates a test artifact.
+* Allowed `GraphProvider` to expose a cached `Graph.Feature` object so that the test suite could re-use them to speed test runs.
+* Fixed a bug in `ReducingBarrierStep`, that returned the provided seed value despite no elements being available.
+* Changed the order of `select()` scopes. The order is now: maps, side-effects, paths.
+* Removed previously deprecated Credentials DSL infrastructure.
+* Moved `TraversalEngine` to `gremlin-test` as it has long been only used in testing infrastructure.
+* Events from `EventStrategy` raised from "new" mutations will now return a `KeyedVertexProperty` or `KeyedProperty` as is appropriate.
+* `MutationListener#vertexPropertyChanged(Vertex, VertexProperty, Object, Object...)` no longer has a default implementation.
+* Removed previously deprecated `MutationListener#vertexPropertyChanged(Vertex, Property, Object, Object...)`.
+* Removed previously deprecated `OpSelectorHandler` constructor.
+* Removed previously deprecated `close()` from `GremlinGroovyScriptEngine` which no longer implements `AutoCloseable`.
+* Removed previously deprecated `getGraphInputFormat()` and `getGraphOutputFormat()` from `HadoopConfiguration`.
+* Removed previously deprecated `AbstractOpProcessor#makeFrame()` method.
+* Removed previously deprecated `AuthenticationSettings.className` configuration option in Gremlin Server.
+* Removed previously deprecated `GraphManager` methods `getGraphs()` and `getTraversalSources()`.
+* Removed previously deprecated Gremlin Server setting for `serializedResponseTimeout`.
+* Removed previously deprecated Structure API exceptions related to "element not found" situations.
+* Removed previously deprecated `rebindings` options from the Java driver API.
+* Removed previously deprecated `LambdaCollectingBarrierStep.Consumers` enum.
+* Removed previously deprecated `HasContainer#makeHasContainers(String, P)`
+* Removed support for Giraph.
+
== TinkerPop 3.3.0 (Gremlin Symphony #40 in G Minor)
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/images/gremlin-mozart.png[width=185]
diff --git a/docker/hadoop/Dockerfile b/docker/hadoop/Dockerfile
deleted file mode 100644
index 86b2598..0000000
--- a/docker/hadoop/Dockerfile
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-FROM tinkerpop:base
-
-MAINTAINER Daniel Kuppitz <me@gremlin.guru>
-
-ENV HADOOP_VERSION 2.7.2
-
-COPY install.sh /usr/local/sbin/install-hadoop.sh
-RUN /usr/local/sbin/install-hadoop.sh
diff --git a/docs/preprocessor/install-plugins.sh b/docs/preprocessor/install-plugins.sh
index 990dbe4..0a7ca31 100755
--- a/docs/preprocessor/install-plugins.sh
+++ b/docs/preprocessor/install-plugins.sh
@@ -25,7 +25,7 @@
INSTALL_TEMPLATE="docs/preprocessor/install-plugins.groovy"
INSTALL_FILE="${TMP_DIR}/install-plugins.groovy"
-plugins=("hadoop-gremlin" "spark-gremlin" "giraph-gremlin" "neo4j-gremlin")
+plugins=("hadoop-gremlin" "spark-gremlin" "neo4j-gremlin")
# plugins=()
pluginsCount=${#plugins[@]}
diff --git a/docs/preprocessor/preprocess-file.sh b/docs/preprocessor/preprocess-file.sh
index 7d3956d..e1a4df6 100755
--- a/docs/preprocessor/preprocess-file.sh
+++ b/docs/preprocessor/preprocess-file.sh
@@ -110,7 +110,7 @@
mv ext/spark-gremlin .ext/
cat ext/plugins.txt | tee .ext/plugins.all | grep -Fv 'SparkGremlinPlugin' > .ext/plugins.txt
;;
- "implementations-hadoop-start" | "implementations-hadoop-end" | "implementations-spark" | "implementations-giraph" | "olap-spark-yarn")
+ "implementations-hadoop-start" | "implementations-hadoop-end" | "implementations-spark" | "olap-spark-yarn")
# deactivate Neo4j plugin to prevent version conflicts between TinkerPop's Spark jars and Neo4j's Spark jars
mkdir .ext
mv ext/neo4j-gremlin .ext/
@@ -121,9 +121,8 @@
mkdir .ext
mv ext/neo4j-gremlin .ext/
mv ext/spark-gremlin .ext/
- mv ext/giraph-gremlin .ext/
mv ext/hadoop-gremlin .ext/
- cat ext/plugins.txt | tee .ext/plugins.all | grep -v 'Neo4jGremlinPlugin\|SparkGremlinPlugin\|GiraphGremlinPlugin\|HadoopGremlinPlugin' > .ext/plugins.txt
+ cat ext/plugins.txt | tee .ext/plugins.all | grep -v 'Neo4jGremlinPlugin\|SparkGremlinPlugin\|HadoopGremlinPlugin' > .ext/plugins.txt
;;
esac
@@ -136,7 +135,7 @@
awk -f ${AWK_SCRIPTS}/prepare.awk |
awk -f ${AWK_SCRIPTS}/init-code-blocks.awk -v TP_HOME="${TP_HOME}" -v PYTHONPATH="${TP_HOME}/gremlin-python/target/classes/Lib" |
awk -f ${AWK_SCRIPTS}/progressbar.awk -v tpl=${AWK_SCRIPTS}/progressbar.groovy.template |
- HADOOP_GREMLIN_LIBS="${CONSOLE_HOME}/ext/giraph-gremlin/lib:${CONSOLE_HOME}/ext/tinkergraph-gremlin/lib" bin/gremlin.sh |
+ HADOOP_GREMLIN_LIBS="${CONSOLE_HOME}/ext/tinkergraph-gremlin/lib" bin/gremlin.sh |
${lb} awk -f ${AWK_SCRIPTS}/ignore.awk |
${lb} awk -f ${AWK_SCRIPTS}/prettify.awk |
${lb} awk -f ${AWK_SCRIPTS}/cleanup.awk |
diff --git a/docs/site/home/downloads.html b/docs/site/home/downloads.html
index fd27d66..24195bc 100644
--- a/docs/site/home/downloads.html
+++ b/docs/site/home/downloads.html
@@ -17,7 +17,7 @@
<div class="container">
<div class="row">
<h3>Download Apache TinkerPop™</h3>
- <p><img src="images/gremlin-download.png" style="float:right;width:150px;padding:10px;"/>Apache TinkerPop provides three packaged downloads per release version. The
+ <p><img src="img/gremlin-download.png" style="float:right;width:150px;padding:10px;"/>Apache TinkerPop provides three packaged downloads per release version. The
<a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-console">Gremlin Console</a> and <a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-server">Gremlin Server</a>
downloads are binary distributions, which contain pre-packaged versions of these important TinkerPop applications that are designed to work out-of-the-box
when unpackaged. The source distribution is a snapshot of the source code and files used in the building of those binary distributions.</p>
diff --git a/docs/site/home/gremlin.html b/docs/site/home/gremlin.html
index 74e7c5e..21fe1e8 100644
--- a/docs/site/home/gremlin.html
+++ b/docs/site/home/gremlin.html
@@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<img src="images/tinkerpop-cityscape.png" class="img-responsive" />
+<img src="img/tinkerpop-cityscape.png" class="img-responsive" />
<div class="container">
<div class="hero-unit" style="padding:10px">
<b><font size="5" face="american typewriter">Apache TinkerPop™</font></b>
@@ -34,7 +34,7 @@
users a rich collection of steps that they can compose in order to ask any conceivable question they may have of their data for Gremlin is <a href="http://arxiv.org/abs/1508.03843">Turing Complete</a>.
</div>
<div class="col-sm-2 col-md-2">
- <img src="images/gremlin-head.png" width="100%">
+ <img src="img/gremlin-head.png" width="100%">
</div>
</div>
<br/>
@@ -209,7 +209,7 @@
not need to learn both a database query language and a domain-specific BigData analytics language (e.g. Spark DSL, MapReduce, etc.).
Gremlin is all that is required to build a graph-based application because the Gremlin traversal machine will handle the rest.
<br/><br/>
- <center><img src="images/oltp-and-olap.png" style="width:80%;" class="img-responsive"></center>
+ <center><img src="img/oltp-and-olap.png" style="width:80%;" class="img-responsive"></center>
</div>
<br/>
<div class="container">
@@ -268,7 +268,7 @@
<br/>
<div class="row">
<div class="col-sm-5 col-md-4">
- <img src="images/gremlin-language-variants.png" class="img-responsive">
+ <img src="img/gremlin-language-variants.png" class="img-responsive">
</div>
<div class="col-sm-7 col-md-8">
Classic database query languages, like <a href="https://en.wikipedia.org/wiki/SQL">SQL</a>, were conceived as being fundamentally different from the programming languages that would
@@ -339,9 +339,8 @@
GraphTraversalSource g;
g = graph.traversal(); // local OLTP
g = graph.traversal().withRemote(DriverRemoteConnection.using("server.yaml")) // remote OLTP
-g = graph.traversal().withComputer(SparkGraphComputer.class); // distributed OLAP
-g = graph.traversal().withComputer(GiraphGraphComputer.class); // distributed OLAP</code>
-</pre>
+g = graph.traversal().withComputer(SparkGraphComputer.class); // distributed OLAP/code>
+ </code></pre>
</div>
<br/>
</div>
@@ -352,16 +351,16 @@
<div class="carousel slide" data-ride="carousel" data-type="multi" data-interval="7000" id="relatedResources">
<div class="carouselGrid-inner">
<div class="item active">
- <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="https://academy.datastax.com/resources/getting-started-graph-databases"><img src="images/resources/graph-databases-101-resource.png" width="100%" /></a></div>
+ <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="https://academy.datastax.com/resources/getting-started-graph-databases"><img src="img/resources/graph-databases-101-resource.png" width="100%" /></a></div>
</div>
<div class="item">
- <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="http://datastax.com/dev/blog/the-benefits-of-the-gremlin-graph-traversal-machine"><img src="images/resources/benefits-gremlin-machine-resource.png" width="100%" /></a></div>
+ <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="http://datastax.com/dev/blog/the-benefits-of-the-gremlin-graph-traversal-machine"><img src="img/resources/benefits-gremlin-machine-resource.png" width="100%" /></a></div>
</div>
<div class="item">
- <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="http://arxiv.org/abs/1508.03843"><img src="images/resources/arxiv-article-resource.png" width="100%" /></a></div>
+ <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="http://arxiv.org/abs/1508.03843"><img src="img/resources/arxiv-article-resource.png" width="100%" /></a></div>
</div>
<div class="item">
- <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="http://sql2gremlin.com/"><img src="images/resources/sql-2-gremlin-resource.png" width="100%" /></a></div>
+ <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="http://sql2gremlin.com/"><img src="img/resources/sql-2-gremlin-resource.png" width="100%" /></a></div>
</div>
</div>
<a class="left carouselGrid-control" href="#relatedResources" data-slide="prev">
@@ -392,5 +391,7 @@
});
</script>
</div>
+ <br/>
+ <br/>
</div>
</div>
diff --git a/docs/site/home/images/apache-tinkerpop-logo.png b/docs/site/home/img/apache-tinkerpop-logo.png
similarity index 100%
rename from docs/site/home/images/apache-tinkerpop-logo.png
rename to docs/site/home/img/apache-tinkerpop-logo.png
Binary files differ
diff --git a/docs/site/home/images/blueprints-handdrawn.png b/docs/site/home/img/blueprints-handdrawn.png
similarity index 100%
rename from docs/site/home/images/blueprints-handdrawn.png
rename to docs/site/home/img/blueprints-handdrawn.png
Binary files differ
diff --git a/docs/site/home/images/cityscape-button.png b/docs/site/home/img/cityscape-button.png
similarity index 100%
rename from docs/site/home/images/cityscape-button.png
rename to docs/site/home/img/cityscape-button.png
Binary files differ
diff --git a/docs/site/home/images/egg-logo.png b/docs/site/home/img/egg-logo.png
similarity index 100%
rename from docs/site/home/images/egg-logo.png
rename to docs/site/home/img/egg-logo.png
Binary files differ
diff --git a/docs/site/home/images/favicon.ico b/docs/site/home/img/favicon.ico
similarity index 100%
rename from docs/site/home/images/favicon.ico
rename to docs/site/home/img/favicon.ico
Binary files differ
diff --git a/docs/site/home/images/furnace-handdrawn.png b/docs/site/home/img/furnace-handdrawn.png
similarity index 100%
rename from docs/site/home/images/furnace-handdrawn.png
rename to docs/site/home/img/furnace-handdrawn.png
Binary files differ
diff --git a/docs/site/home/images/graph-globe.png b/docs/site/home/img/graph-globe.png
similarity index 100%
rename from docs/site/home/images/graph-globe.png
rename to docs/site/home/img/graph-globe.png
Binary files differ
diff --git a/docs/site/home/images/graph-vs-table.png b/docs/site/home/img/graph-vs-table.png
similarity index 100%
rename from docs/site/home/images/graph-vs-table.png
rename to docs/site/home/img/graph-vs-table.png
Binary files differ
diff --git a/docs/site/home/images/gremlin-apache.png b/docs/site/home/img/gremlin-apache.png
similarity index 100%
rename from docs/site/home/images/gremlin-apache.png
rename to docs/site/home/img/gremlin-apache.png
Binary files differ
diff --git a/docs/site/home/images/gremlin-download.png b/docs/site/home/img/gremlin-download.png
similarity index 100%
rename from docs/site/home/images/gremlin-download.png
rename to docs/site/home/img/gremlin-download.png
Binary files differ
diff --git a/docs/site/home/images/gremlin-github.png b/docs/site/home/img/gremlin-github.png
similarity index 100%
rename from docs/site/home/images/gremlin-github.png
rename to docs/site/home/img/gremlin-github.png
Binary files differ
diff --git a/docs/site/home/images/gremlin-gym-mini.png b/docs/site/home/img/gremlin-gym-mini.png
similarity index 100%
rename from docs/site/home/images/gremlin-gym-mini.png
rename to docs/site/home/img/gremlin-gym-mini.png
Binary files differ
diff --git a/docs/site/home/images/gremlin-handdrawn.png b/docs/site/home/img/gremlin-handdrawn.png
similarity index 100%
rename from docs/site/home/images/gremlin-handdrawn.png
rename to docs/site/home/img/gremlin-handdrawn.png
Binary files differ
diff --git a/docs/site/home/images/gremlin-head.png b/docs/site/home/img/gremlin-head.png
similarity index 100%
rename from docs/site/home/images/gremlin-head.png
rename to docs/site/home/img/gremlin-head.png
Binary files differ
diff --git a/docs/site/home/images/gremlin-language-variants.png b/docs/site/home/img/gremlin-language-variants.png
similarity index 100%
rename from docs/site/home/images/gremlin-language-variants.png
rename to docs/site/home/img/gremlin-language-variants.png
Binary files differ
diff --git a/docs/site/home/images/gremlin-quill.png b/docs/site/home/img/gremlin-quill.png
similarity index 100%
rename from docs/site/home/images/gremlin-quill.png
rename to docs/site/home/img/gremlin-quill.png
Binary files differ
diff --git a/docs/site/home/images/homepage.graffle b/docs/site/home/img/homepage.graffle
similarity index 100%
rename from docs/site/home/images/homepage.graffle
rename to docs/site/home/img/homepage.graffle
diff --git a/docs/site/home/images/logos/blazegraph-logo.png b/docs/site/home/img/logos/blazegraph-logo.png
similarity index 100%
rename from docs/site/home/images/logos/blazegraph-logo.png
rename to docs/site/home/img/logos/blazegraph-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/cosmosdb-logo.png b/docs/site/home/img/logos/cosmosdb-logo.png
similarity index 100%
rename from docs/site/home/images/logos/cosmosdb-logo.png
rename to docs/site/home/img/logos/cosmosdb-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/datastax-logo.png b/docs/site/home/img/logos/datastax-logo.png
similarity index 100%
rename from docs/site/home/images/logos/datastax-logo.png
rename to docs/site/home/img/logos/datastax-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/grakn-logo.png b/docs/site/home/img/logos/grakn-logo.png
similarity index 100%
rename from docs/site/home/images/logos/grakn-logo.png
rename to docs/site/home/img/logos/grakn-logo.png
Binary files differ
diff --git a/docs/site/home/img/logos/gremlin-dotnet-logo.png b/docs/site/home/img/logos/gremlin-dotnet-logo.png
new file mode 100644
index 0000000..967b36b
--- /dev/null
+++ b/docs/site/home/img/logos/gremlin-dotnet-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/gremlin-groovy-logo.png b/docs/site/home/img/logos/gremlin-groovy-logo.png
similarity index 100%
rename from docs/site/home/images/logos/gremlin-groovy-logo.png
rename to docs/site/home/img/logos/gremlin-groovy-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/gremlin-java-logo.png b/docs/site/home/img/logos/gremlin-java-logo.png
similarity index 100%
rename from docs/site/home/images/logos/gremlin-java-logo.png
rename to docs/site/home/img/logos/gremlin-java-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/gremlin-python-logo.png b/docs/site/home/img/logos/gremlin-python-logo.png
similarity index 100%
rename from docs/site/home/images/logos/gremlin-python-logo.png
rename to docs/site/home/img/logos/gremlin-python-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/gremlin-scala-logo.png b/docs/site/home/img/logos/gremlin-scala-logo.png
similarity index 100%
rename from docs/site/home/images/logos/gremlin-scala-logo.png
rename to docs/site/home/img/logos/gremlin-scala-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/ibmgraph-logo.png b/docs/site/home/img/logos/ibmgraph-logo.png
similarity index 100%
rename from docs/site/home/images/logos/ibmgraph-logo.png
rename to docs/site/home/img/logos/ibmgraph-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/janusgraph-logo.png b/docs/site/home/img/logos/janusgraph-logo.png
similarity index 100%
rename from docs/site/home/images/logos/janusgraph-logo.png
rename to docs/site/home/img/logos/janusgraph-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/keylines-logo.png b/docs/site/home/img/logos/keylines-logo.png
similarity index 100%
rename from docs/site/home/images/logos/keylines-logo.png
rename to docs/site/home/img/logos/keylines-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/linkurious-logo.png b/docs/site/home/img/logos/linkurious-logo.png
similarity index 100%
rename from docs/site/home/images/logos/linkurious-logo.png
rename to docs/site/home/img/logos/linkurious-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/neo4j-logo.png b/docs/site/home/img/logos/neo4j-logo.png
similarity index 100%
rename from docs/site/home/images/logos/neo4j-logo.png
rename to docs/site/home/img/logos/neo4j-logo.png
Binary files differ
diff --git a/docs/site/home/img/logos/neptune-logo.png b/docs/site/home/img/logos/neptune-logo.png
new file mode 100644
index 0000000..db44a9c
--- /dev/null
+++ b/docs/site/home/img/logos/neptune-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/ogre-logo.png b/docs/site/home/img/logos/ogre-logo.png
similarity index 100%
rename from docs/site/home/images/logos/ogre-logo.png
rename to docs/site/home/img/logos/ogre-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/orientdb-logo.png b/docs/site/home/img/logos/orientdb-logo.png
similarity index 100%
rename from docs/site/home/images/logos/orientdb-logo.png
rename to docs/site/home/img/logos/orientdb-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/sparql-gremlin-logo.png b/docs/site/home/img/logos/sparql-gremlin-logo.png
similarity index 100%
rename from docs/site/home/images/logos/sparql-gremlin-logo.png
rename to docs/site/home/img/logos/sparql-gremlin-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/sql-gremlin-logo.png b/docs/site/home/img/logos/sql-gremlin-logo.png
similarity index 100%
rename from docs/site/home/images/logos/sql-gremlin-logo.png
rename to docs/site/home/img/logos/sql-gremlin-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/stardog-logo.png b/docs/site/home/img/logos/stardog-logo.png
similarity index 100%
rename from docs/site/home/images/logos/stardog-logo.png
rename to docs/site/home/img/logos/stardog-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/titan-logo.png b/docs/site/home/img/logos/titan-logo.png
similarity index 100%
rename from docs/site/home/images/logos/titan-logo.png
rename to docs/site/home/img/logos/titan-logo.png
Binary files differ
diff --git a/docs/site/home/images/logos/tomsawyer-logo.png b/docs/site/home/img/logos/tomsawyer-logo.png
similarity index 100%
rename from docs/site/home/images/logos/tomsawyer-logo.png
rename to docs/site/home/img/logos/tomsawyer-logo.png
Binary files differ
diff --git a/docs/site/home/images/meeting-room-button.png b/docs/site/home/img/meeting-room-button.png
similarity index 100%
rename from docs/site/home/images/meeting-room-button.png
rename to docs/site/home/img/meeting-room-button.png
Binary files differ
diff --git a/docs/site/home/images/oltp-and-olap.png b/docs/site/home/img/oltp-and-olap.png
similarity index 100%
rename from docs/site/home/images/oltp-and-olap.png
rename to docs/site/home/img/oltp-and-olap.png
Binary files differ
diff --git a/docs/site/home/images/peon-head.png b/docs/site/home/img/peon-head.png
similarity index 100%
rename from docs/site/home/images/peon-head.png
rename to docs/site/home/img/peon-head.png
Binary files differ
diff --git a/docs/site/home/images/policy/adjacency-list.png b/docs/site/home/img/policy/adjacency-list.png
similarity index 100%
rename from docs/site/home/images/policy/adjacency-list.png
rename to docs/site/home/img/policy/adjacency-list.png
Binary files differ
diff --git a/docs/site/home/images/policy/blueprints-character.png b/docs/site/home/img/policy/blueprints-character.png
similarity index 100%
rename from docs/site/home/images/policy/blueprints-character.png
rename to docs/site/home/img/policy/blueprints-character.png
Binary files differ
diff --git a/docs/site/home/images/policy/business-gremlin.png b/docs/site/home/img/policy/business-gremlin.png
similarity index 100%
rename from docs/site/home/images/policy/business-gremlin.png
rename to docs/site/home/img/policy/business-gremlin.png
Binary files differ
diff --git a/docs/site/home/images/policy/cyclicpath-step.png b/docs/site/home/img/policy/cyclicpath-step.png
similarity index 100%
rename from docs/site/home/images/policy/cyclicpath-step.png
rename to docs/site/home/img/policy/cyclicpath-step.png
Binary files differ
diff --git a/docs/site/home/images/policy/flat-map-lambda.png b/docs/site/home/img/policy/flat-map-lambda.png
similarity index 100%
rename from docs/site/home/images/policy/flat-map-lambda.png
rename to docs/site/home/img/policy/flat-map-lambda.png
Binary files differ
diff --git a/docs/site/home/images/policy/frames-character.png b/docs/site/home/img/policy/frames-character.png
similarity index 100%
rename from docs/site/home/images/policy/frames-character.png
rename to docs/site/home/img/policy/frames-character.png
Binary files differ
diff --git a/docs/site/home/images/policy/furnace-character.png b/docs/site/home/img/policy/furnace-character.png
similarity index 100%
rename from docs/site/home/images/policy/furnace-character.png
rename to docs/site/home/img/policy/furnace-character.png
Binary files differ
diff --git a/docs/site/home/images/policy/gremlin-character.png b/docs/site/home/img/policy/gremlin-character.png
similarity index 100%
rename from docs/site/home/images/policy/gremlin-character.png
rename to docs/site/home/img/policy/gremlin-character.png
Binary files differ
diff --git a/docs/site/home/images/policy/gremlin-chickenwing.png b/docs/site/home/img/policy/gremlin-chickenwing.png
similarity index 100%
rename from docs/site/home/images/policy/gremlin-chickenwing.png
rename to docs/site/home/img/policy/gremlin-chickenwing.png
Binary files differ
diff --git a/docs/site/home/images/policy/gremlin-gremopoly.png b/docs/site/home/img/policy/gremlin-gremopoly.png
similarity index 100%
rename from docs/site/home/images/policy/gremlin-gremopoly.png
rename to docs/site/home/img/policy/gremlin-gremopoly.png
Binary files differ
diff --git a/docs/site/home/images/policy/gremlin-gremreaper.png b/docs/site/home/img/policy/gremlin-gremreaper.png
similarity index 100%
rename from docs/site/home/images/policy/gremlin-gremreaper.png
rename to docs/site/home/img/policy/gremlin-gremreaper.png
Binary files differ
diff --git a/docs/site/home/images/policy/gremlin-gremstefani.png b/docs/site/home/img/policy/gremlin-gremstefani.png
similarity index 100%
rename from docs/site/home/images/policy/gremlin-gremstefani.png
rename to docs/site/home/img/policy/gremlin-gremstefani.png
Binary files differ
diff --git a/docs/site/home/images/policy/gremlin-new-sheriff-in-town.png b/docs/site/home/img/policy/gremlin-new-sheriff-in-town.png
similarity index 100%
rename from docs/site/home/images/policy/gremlin-new-sheriff-in-town.png
rename to docs/site/home/img/policy/gremlin-new-sheriff-in-town.png
Binary files differ
diff --git a/docs/site/home/images/policy/gremlin-no-more-mr-nice-guy.png b/docs/site/home/img/policy/gremlin-no-more-mr-nice-guy.png
similarity index 100%
rename from docs/site/home/images/policy/gremlin-no-more-mr-nice-guy.png
rename to docs/site/home/img/policy/gremlin-no-more-mr-nice-guy.png
Binary files differ
diff --git a/docs/site/home/images/policy/gremlintron.png b/docs/site/home/img/policy/gremlintron.png
similarity index 100%
rename from docs/site/home/images/policy/gremlintron.png
rename to docs/site/home/img/policy/gremlintron.png
Binary files differ
diff --git a/docs/site/home/images/policy/olap-traversal.png b/docs/site/home/img/policy/olap-traversal.png
similarity index 100%
rename from docs/site/home/images/policy/olap-traversal.png
rename to docs/site/home/img/policy/olap-traversal.png
Binary files differ
diff --git a/docs/site/home/images/policy/pipes-character.png b/docs/site/home/img/policy/pipes-character.png
similarity index 100%
rename from docs/site/home/images/policy/pipes-character.png
rename to docs/site/home/img/policy/pipes-character.png
Binary files differ
diff --git a/docs/site/home/images/policy/rexster-character.png b/docs/site/home/img/policy/rexster-character.png
similarity index 100%
rename from docs/site/home/images/policy/rexster-character.png
rename to docs/site/home/img/policy/rexster-character.png
Binary files differ
diff --git a/docs/site/home/images/policy/tinkerpop-reading.png b/docs/site/home/img/policy/tinkerpop-reading.png
similarity index 100%
rename from docs/site/home/images/policy/tinkerpop-reading.png
rename to docs/site/home/img/policy/tinkerpop-reading.png
Binary files differ
diff --git a/docs/site/home/images/policy/tinkerpop3-splash.png b/docs/site/home/img/policy/tinkerpop3-splash.png
similarity index 100%
rename from docs/site/home/images/policy/tinkerpop3-splash.png
rename to docs/site/home/img/policy/tinkerpop3-splash.png
Binary files differ
diff --git a/docs/site/home/img/practical-gremlin-titled.png b/docs/site/home/img/practical-gremlin-titled.png
new file mode 100755
index 0000000..265f3a2
--- /dev/null
+++ b/docs/site/home/img/practical-gremlin-titled.png
Binary files differ
diff --git a/docs/site/home/images/resources/arxiv-article-resource.png b/docs/site/home/img/resources/arxiv-article-resource.png
similarity index 100%
rename from docs/site/home/images/resources/arxiv-article-resource.png
rename to docs/site/home/img/resources/arxiv-article-resource.png
Binary files differ
diff --git a/docs/site/home/images/resources/benefits-gremlin-machine-resource.png b/docs/site/home/img/resources/benefits-gremlin-machine-resource.png
similarity index 100%
rename from docs/site/home/images/resources/benefits-gremlin-machine-resource.png
rename to docs/site/home/img/resources/benefits-gremlin-machine-resource.png
Binary files differ
diff --git a/docs/site/home/images/resources/graph-databases-101-resource.png b/docs/site/home/img/resources/graph-databases-101-resource.png
similarity index 100%
rename from docs/site/home/images/resources/graph-databases-101-resource.png
rename to docs/site/home/img/resources/graph-databases-101-resource.png
Binary files differ
diff --git a/docs/site/home/images/resources/on-graph-computing-resource.png b/docs/site/home/img/resources/on-graph-computing-resource.png
similarity index 100%
rename from docs/site/home/images/resources/on-graph-computing-resource.png
rename to docs/site/home/img/resources/on-graph-computing-resource.png
Binary files differ
diff --git a/docs/site/home/images/resources/property-graph-resource.png b/docs/site/home/img/resources/property-graph-resource.png
similarity index 100%
rename from docs/site/home/images/resources/property-graph-resource.png
rename to docs/site/home/img/resources/property-graph-resource.png
Binary files differ
diff --git a/docs/site/home/images/resources/sql-2-gremlin-resource.png b/docs/site/home/img/resources/sql-2-gremlin-resource.png
similarity index 100%
rename from docs/site/home/images/resources/sql-2-gremlin-resource.png
rename to docs/site/home/img/resources/sql-2-gremlin-resource.png
Binary files differ
diff --git a/docs/site/home/images/resources/tables-and-graphs-resource.png b/docs/site/home/img/resources/tables-and-graphs-resource.png
similarity index 100%
rename from docs/site/home/images/resources/tables-and-graphs-resource.png
rename to docs/site/home/img/resources/tables-and-graphs-resource.png
Binary files differ
diff --git a/docs/site/home/images/resources/why-graph-databases-resource.png b/docs/site/home/img/resources/why-graph-databases-resource.png
similarity index 100%
rename from docs/site/home/images/resources/why-graph-databases-resource.png
rename to docs/site/home/img/resources/why-graph-databases-resource.png
Binary files differ
diff --git a/docs/site/home/images/rexster-handdrawn.png b/docs/site/home/img/rexster-handdrawn.png
similarity index 100%
rename from docs/site/home/images/rexster-handdrawn.png
rename to docs/site/home/img/rexster-handdrawn.png
Binary files differ
diff --git a/docs/site/home/images/tinkerblocks.png b/docs/site/home/img/tinkerblocks.png
similarity index 100%
rename from docs/site/home/images/tinkerblocks.png
rename to docs/site/home/img/tinkerblocks.png
Binary files differ
diff --git a/docs/site/home/images/tinkerpop-book.png b/docs/site/home/img/tinkerpop-book.png
similarity index 100%
rename from docs/site/home/images/tinkerpop-book.png
rename to docs/site/home/img/tinkerpop-book.png
Binary files differ
diff --git a/docs/site/home/images/tinkerpop-cityscape.png b/docs/site/home/img/tinkerpop-cityscape.png
similarity index 100%
rename from docs/site/home/images/tinkerpop-cityscape.png
rename to docs/site/home/img/tinkerpop-cityscape.png
Binary files differ
diff --git a/docs/site/home/images/tinkerpop-conference.png b/docs/site/home/img/tinkerpop-conference.png
similarity index 100%
rename from docs/site/home/images/tinkerpop-conference.png
rename to docs/site/home/img/tinkerpop-conference.png
Binary files differ
diff --git a/docs/site/home/images/tinkerpop-logo-small.png b/docs/site/home/img/tinkerpop-logo-small.png
similarity index 100%
rename from docs/site/home/images/tinkerpop-logo-small.png
rename to docs/site/home/img/tinkerpop-logo-small.png
Binary files differ
diff --git a/docs/site/home/images/tinkerpop-meeting-room.png b/docs/site/home/img/tinkerpop-meeting-room.png
similarity index 100%
rename from docs/site/home/images/tinkerpop-meeting-room.png
rename to docs/site/home/img/tinkerpop-meeting-room.png
Binary files differ
diff --git a/docs/site/home/images/tinkerpop-reading-2.png b/docs/site/home/img/tinkerpop-reading-2.png
similarity index 100%
rename from docs/site/home/images/tinkerpop-reading-2.png
rename to docs/site/home/img/tinkerpop-reading-2.png
Binary files differ
diff --git a/docs/site/home/images/tinkerpop-reading.png b/docs/site/home/img/tinkerpop-reading.png
similarity index 100%
rename from docs/site/home/images/tinkerpop-reading.png
rename to docs/site/home/img/tinkerpop-reading.png
Binary files differ
diff --git a/docs/site/home/images/tinkerpop-splash.png b/docs/site/home/img/tinkerpop-splash.png
similarity index 100%
rename from docs/site/home/images/tinkerpop-splash.png
rename to docs/site/home/img/tinkerpop-splash.png
Binary files differ
diff --git a/docs/site/home/img/tinkerpop.jpg b/docs/site/home/img/tinkerpop.jpg
new file mode 100644
index 0000000..d179102
--- /dev/null
+++ b/docs/site/home/img/tinkerpop.jpg
Binary files differ
diff --git a/docs/site/home/images/tinkerpop3-splash.png b/docs/site/home/img/tinkerpop3-splash.png
similarity index 100%
rename from docs/site/home/images/tinkerpop3-splash.png
rename to docs/site/home/img/tinkerpop3-splash.png
Binary files differ
diff --git a/docs/site/home/index.html b/docs/site/home/index.html
index 19d12ee..e67306e 100644
--- a/docs/site/home/index.html
+++ b/docs/site/home/index.html
@@ -19,7 +19,7 @@
<div class="row">
<div class="col-md-6">
<b><font size="6" face="american typewriter">Apache TinkerPop™</font></b>
- <p><img src="images/tinkerpop-splash.png" width="420" class="img-responsive" style="padding:10px;"/></p>
+ <p><img src="img/tinkerpop-splash.png" width="420" class="img-responsive" style="padding:10px;"/></p>
<p><font size="3">Apache TinkerPop™ is a graph computing framework for both graph databases (OLTP) and graph analytic systems (OLAP).</font></p>
</div>
<div class="col-md-6">
@@ -47,21 +47,21 @@
</div>
<div class="col-md-6">
<br/>
- <a href="http://tinkerpop.apache.org/docs/current/tutorials/getting-started">
- <img src="images/gremlin-gym-mini.png" width="150" class="img-responsive" align="left"/>
+ <a href="http://kelvinlawrence.net/book/Gremlin-Graph-Guide.html">
+ <img src="img/practical-gremlin-titled.png" width="150" class="img-responsive" align="left"/>
</a>
</div>
</div>
<div class="row">
<div class="col-md-5">
<div class="hovereffect">
- <img src="images/cityscape-button.png" style="width:200px;" class="img-responsive" /></a>
+ <img src="img/cityscape-button.png" style="width:200px;" class="img-responsive" /></a>
<div class="overlay"><a class="info" href="gremlin.html">Understand Gremlin</a></div>
</div>
</div>
<div class="col-md-5">
<div class="hovereffect">
- <img src="images/meeting-room-button.png" style="width:200px;" class="img-responsive" /></a>
+ <img src="img/meeting-room-button.png" style="width:200px;" class="img-responsive" /></a>
<div class="overlay"><a class="info" href="providers.html">Become TinkerPop-Enabled</a></div>
</div>
</div>
@@ -141,7 +141,7 @@
<!-- /.carousel -->
<div class="container">
<h3>The Benefits of Graph Computing</h3>
- <p><img src="images/graph-globe.png" style="float:left;width:15%;padding:10px;"> A <strong>graph</strong> is a structure composed of <strong>vertices</strong> and <strong>edges</strong>.
+ <p><img src="img/graph-globe.png" style="float:left;width:15%;padding:10px;"> A <strong>graph</strong> is a structure composed of <strong>vertices</strong> and <strong>edges</strong>.
Both vertices and edges can have an arbitrary number of key/value-pairs called <strong>properties</strong>.
Vertices denote discrete objects such as a person, a place, or an event. Edges denote relationships between vertices. For instance, a person may know
another person, have been involved in an event, and/or was recently at a particular place. Properties express non-relational information about the
@@ -149,7 +149,7 @@
graph is known as a <strong>property graph</strong> and it is the foundational data structure of Apache TinkerPop.
</p>
<br/>
- <p><img src="images/graph-vs-table.png" style="float:right;width:22%;padding:10px;">If a user's domain is composed of a heterogenous set of objects (vertices) that can be related to one another in a multitude of ways (edges),
+ <p><img src="img/graph-vs-table.png" style="float:right;width:22%;padding:10px;">If a user's domain is composed of a heterogenous set of objects (vertices) that can be related to one another in a multitude of ways (edges),
then a graph may be the right representation to use. In a graph, each vertex is seen as an atomic entity (not simply a "row in a table") that
can be linked to any other vertex or have properties added or removed at will. This empowers the data modeler to think in terms of actors within
a world of complex relations as opposed to, in relational databases, statically-typed tables joined in aggregate. Once a domain is modeled, that
@@ -159,7 +159,7 @@
effectively leverage that structure.
</p>
<br/>
- <p><a href="#"><img src="images/apache-tinkerpop-logo.png" style="float:left;width:22%;padding:10px;"/></a>Apache TinkerPop™ is an open source, vendor-agnostic, graph computing framework distributed under the commercial friendly <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache2 license</a>.
+ <p><a href="#"><img src="img/apache-tinkerpop-logo.png" style="float:left;width:22%;padding:10px;"/></a>Apache TinkerPop™ is an open source, vendor-agnostic, graph computing framework distributed under the commercial friendly <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache2 license</a>.
When a data system is <a href="providers.html">TinkerPop-enabled</a>, its users are able to model their domain as a graph and analyze that graph using the <a href="gremlin.html">Gremlin graph traversal language</a>.
Furthermore, all TinkerPop-enabled systems integrate with one another allowing them to easily expand their offerings as well as allowing users to choose the appropriate graph
technology for their application. Sometimes an application is best served by an in-memory, transactional graph database. Sometimes a multi-machine distributed graph database will do the job.
@@ -202,7 +202,7 @@
<p>To build TinkerPop from source, please review the <a href="http://tinkerpop.apache.org/docs/current/dev/developer/#building-testing">developer documentation</a>.
</div>
<div class="col-xs-4">
- <a href="http://tinkerpop.apache.org/docs/current/dev/developer/"><img src="images/gremlin-apache.png" width="250" class="img-responsive" /></a>
+ <a href="http://tinkerpop.apache.org/docs/current/dev/developer/"><img src="img/gremlin-apache.png" width="250" class="img-responsive" /></a>
</div>
</div>
<h3>Community Contributions</h3>
@@ -222,7 +222,6 @@
<li><a href="https://github.com/MartinHaeusler/chronos/tree/master/org.chronos.chronograph">ChronoGraph</a> - A versioned graph database.</li>
<li><a href="http://www.datastax.com/products/datastax-enterprise-graph">DSEGraph</a> - DataStax graph database with OLTP and OLAP support.</li>
<li><a href="https://grakn.ai/">GRAKN.AI</a> - Distributed OLTP/OLAP knowledge graph system.</li>
- <li><a href="http://tinkerpop.apache.org/docs/current/reference/#giraphgraphcomputer">Hadoop (Giraph)</a> - OLAP graph processor using Giraph.</li>
<li><a href="http://tinkerpop.apache.org/docs/current/reference/#sparkgraphcomputer">Hadoop (Spark)</a> - OLAP graph processor using Spark.</li>
<li><a href="https://github.com/rayokota/hgraphdb">HGraphDB</a> - OLTP graph database running on Apache HBase.</li>
<li><a href="https://console.ng.bluemix.net/catalog/services/ibm-graph/">IBM Graph</a> - OLTP graph database as a service.</li>
@@ -244,9 +243,11 @@
<h4 id="language-variants-compilers">Query Languages</h4>
<small>[<a href="providers.html#query-language-providers">learn more</a>]</small>
<ul>
+ <li><a href="https://github.com/opencypher/cypher-for-gremlin">cypher-for-gremlin</a> - A Cypher to Gremlin traversal transpiler.</li>
<li><a href="http://syncleus.com/Ferma/">Ferma</a> (java/dsl) - An ORM / OGM for Apache TinkerPop.</li>
<li><a href="https://github.com/davebshow/goblin">Goblin</a> (python/dsl) - Goblin OGM for the TinkerPop 3 Gremlin Server.</li>
<li><a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-DotNet">Gremlin.Net</a> (.NET - C#/variant) - Gremlin hosted in C# for use with any .NET-based VM.</li>
+ <li><a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-javascript">gremlin-javascript</a> (js) - Gremlin hosted in JavaScript for use with Node.js.</li>
<li><a href="https://github.com/gremlin-orm/gremlin-orm">gremlin-orm</a> (javascript) Gremlin ORM for Node.js.</li>
<li><a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-python">gremlin-python</a> (python/variant) - Gremlin hosted in Python for use with any Python-based VM.</li>
<li><a href="https://github.com/emehrkay/gremlinpy">gremlin-py</a> (python/variant) - Write pure Python Gremlin that can be sent to Gremlin Server.</li>
@@ -256,8 +257,8 @@
<li><a href="https://github.com/davebshow/ipython-gremlin">ipython-gremlin</a> (python/variant) - Gremlin in IPython and Jupyter.</li>
<li><a href="http://ogre.clojurewerkz.org/">ogre</a> (clojure/variant) - A Clojure language wrapper for TinkerPop3.</li>
<li><a href="http://bayofmany.github.io/">Peapod</a> (java/dsl) - An object-graph-wrapper.</li>
- <li><a href="https://github.com/LITMUS-Benchmark-Suite/sparql-to-gremlin">sparql-gremlin</a> (sparql/distinct) - A SPARQL to Gremlin traversal compiler.</li>
- <li><a href="https://github.com/twilmes/sql-gremlin">sql-gremlin</a> (sql/distinct) - An SQL to Gremlin traversal compiler.</li>
+ <li><a href="https://github.com/LITMUS-Benchmark-Suite/sparql-to-gremlin">sparql-gremlin</a> (sparql/distinct) - A SPARQL to Gremlin traversal transpiler.</li>
+ <li><a href="https://github.com/twilmes/sql-gremlin">sql-gremlin</a> (sql/distinct) - An SQL to Gremlin traversal transpiler.</li>
</ul>
<a name="language-drivers"></a>
<h4 id="language-drivers">Language Drivers</h4>
@@ -265,7 +266,6 @@
<li><a href="https://github.com/davebshow/gremlinclient">gremlinclient</a> (python) - An asynchronous Python 2/3 client for Gremlin Server that allows for flexible coroutine syntax - Trollius, Tornado, Asyncio.</li>
<li><a href="https://github.com/marcelocf/gremlin_client">gremlin_client</a> (ruby) - A Gremlin Server driver for Ruby.</li>
<li><a href="http://tinkerpop.apache.org/docs/current/reference/#connecting-via-java">gremlin-driver</a> (java) - A Gremlin Server driver for Java.</li>
- <li><a href="https://github.com/jbmusso/gremlin-javascript">gremlin-javascript</a> (js) - A Gremlin Server driver for JavaScript.</li>
<li><a href="https://github.com/qasaur/gremgo">gremgo</a> (go) - A Gremlin Server driver for Go.</li>
<li><a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-DotNet">Gremlin.Net</a> (.NET - C#) - Gremlin Server driver for .NET.</li>
<li><a href="https://github.com/PommeVerte/gremlin-php">gremlin-php</a> (php) - A Gremlin Server driver for PHP.</li>
@@ -279,12 +279,13 @@
<a name="poweredby"></a>
<h4 id="poweredby">Powered By</h4>
<ul>
+ <li><a href="https://www.exakat.io/">exakat.io</a> - Static analysis engine for PHP, powered by Gremlin.</li>
<li><a href="https://bricaud.github.io/graphexp/graphexp.html">Graphexp</a> - Interactive visualization of the Gremlin graph database with D3.js.</li>
<li><a href="http://www.pitneybowes.com/us/customer-information-management/data-integration-management/spectrum-data-hub-module.html">Pitney Bowes Spectrum Data Hub Module</a> - Uses Gremlin OLTP to query Neo4j-powered master data management based graph database.</li>
</ul>
<a name="committers"></a>
<h3 id="committers">Apache TinkerPop Committers</h3>
- <img src="images/tinkerpop-logo-small.png" style="float:right" />TinkerPop seeks committers dedicated to the art of graph computing. TinkerPop committers bring solid theoretical,
+ <img src="img/tinkerpop-logo-small.png" style="float:right" />TinkerPop seeks committers dedicated to the art of graph computing. TinkerPop committers bring solid theoretical,
development, testing, documentation, etc. skills to the group. Committers contribute to TinkerPop beyond the ever-changing requirements of their day-to-day jobs and maintain
responsibility for their contributions through time.
<p/>
diff --git a/docs/site/home/policy.html b/docs/site/home/policy.html
index ee77e7b..b1d6bee 100644
--- a/docs/site/home/policy.html
+++ b/docs/site/home/policy.html
@@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<img src="images/tinkerpop-conference.png" class="img-responsive" />
+<img src="img/tinkerpop-conference.png" class="img-responsive" />
<div class="container">
<div class="hero-unit" style="padding:10px">
<b><font size="5" face="american typewriter">Apache TinkerPop™</font></b>
@@ -60,13 +60,13 @@
</p>
<ul>
<li><strong>Character Graphics</strong>: A character graphic can be used <em>without permission</em> as long as its being used in an Apache TinkerPop related context and it is acknowledged that the graphic is a trademark of the Apache Software Foundation/Apache TinkerPop.</li>
- <img src="images/policy/pipes-character.png" style="padding:10px;width:9%;"/> <img src="images/policy/rexster-character.png" style="padding:10px;width:9%;"/> <img src="images/policy/gremlin-character.png" style="padding:10px;width:9%;"/> <img src="images/policy/blueprints-character.png" style="padding:10px;width:9%;"/> <img src="images/policy/furnace-character.png" style="padding:10px;width:9%;"/> <img src="images/policy/frames-character.png" style="padding:10px;width:9%;"/>
+ <img src="img/policy/pipes-character.png" style="padding:10px;width:9%;"/> <img src="img/policy/rexster-character.png" style="padding:10px;width:9%;"/> <img src="img/policy/gremlin-character.png" style="padding:10px;width:9%;"/> <img src="img/policy/blueprints-character.png" style="padding:10px;width:9%;"/> <img src="img/policy/furnace-character.png" style="padding:10px;width:9%;"/> <img src="img/policy/frames-character.png" style="padding:10px;width:9%;"/>
<li><strong>Character Dress-Up Graphics</strong>: A character graphic can be manipulated ("dressed up") and used <em>without permission</em> as long as it's being used in an Apache TinkerPop related context and it is acknowledged that the graphic is a trademark of the Apache Software Foundation/Apache TinkerPop.</li>
- <img src="images/policy/gremlin-gremopoly.png" style="padding:10px;width:10%;"/> <img src="images/policy/gremlin-gremreaper.png" style="padding:10px;width:14%;"/> <img src="images/policy/gremlin-chickenwing.png" style="padding:10px;width:10%;"/> <img src="images/policy/gremlin-no-more-mr-nice-guy.png" style="padding:10px;width:10%;"/> <img src="images/policy/gremlin-new-sheriff-in-town.png" style="padding:10px;width:12%;"/> <img src="images/policy/gremlin-gremstefani.png" style="padding:10px;width:10%;"/>
+ <img src="img/policy/gremlin-gremopoly.png" style="padding:10px;width:10%;"/> <img src="img/policy/gremlin-gremreaper.png" style="padding:10px;width:14%;"/> <img src="img/policy/gremlin-chickenwing.png" style="padding:10px;width:10%;"/> <img src="img/policy/gremlin-no-more-mr-nice-guy.png" style="padding:10px;width:10%;"/> <img src="img/policy/gremlin-new-sheriff-in-town.png" style="padding:10px;width:12%;"/> <img src="img/policy/gremlin-gremstefani.png" style="padding:10px;width:10%;"/>
<li><strong>Explanatory Diagrams</strong>: Explanatory diagrams can be used <em>without permission</em> as long as they are being used in an Apache TinkerPop related context, it is acknowledged that they are trademarks of the Apache Software Foundation/Apache TinkerPop, and are being used for technical explanatory purposes.</li>
- <img src="images/policy/olap-traversal.png" style="padding:10px;width:22%;"/> <img src="images/policy/cyclicpath-step.png" style="padding:10px;width:22%;"/> <img src="images/policy/flat-map-lambda.png" style="padding:10px;width:15%;"/> <img src="images/policy/adjacency-list.png" style="padding:10px;width:22%;"/>
+ <img src="img/policy/olap-traversal.png" style="padding:10px;width:22%;"/> <img src="img/policy/cyclicpath-step.png" style="padding:10px;width:22%;"/> <img src="img/policy/flat-map-lambda.png" style="padding:10px;width:15%;"/> <img src="img/policy/adjacency-list.png" style="padding:10px;width:22%;"/>
<li><strong>Character Scene Graphics</strong>: Character scene graphics <u><em>require permission</em></u> before being used. Please ask for permission on the Apache TinkerPop <a href="http://mail-archives.apache.org/mod_mbox/incubator-tinkerpop-dev/">developer mailing list</a>.</li>
- <img src="images/policy/tinkerpop-reading.png" style="padding:10px;width:20%;"/> <img src="images/policy/gremlintron.png" style="padding:10px;width:20%;"/> <img src="images/policy/business-gremlin.png" style="padding:10px;width:20%;"/> <img src="images/policy/tinkerpop3-splash.png" style="padding:10px;width:20%;"/>
+ <img src="img/policy/tinkerpop-reading.png" style="padding:10px;width:20%;"/> <img src="img/policy/gremlintron.png" style="padding:10px;width:20%;"/> <img src="img/policy/business-gremlin.png" style="padding:10px;width:20%;"/> <img src="img/policy/tinkerpop3-splash.png" style="padding:10px;width:20%;"/>
</ul>
</div>
</div>
diff --git a/docs/site/home/providers.html b/docs/site/home/providers.html
index 8de28ff..474d6f1 100644
--- a/docs/site/home/providers.html
+++ b/docs/site/home/providers.html
@@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<img src="images/tinkerpop-meeting-room.png" class="img-responsive" />
+<img src="img/tinkerpop-meeting-room.png" class="img-responsive" />
<div class="container">
<div class="hero-unit" style="padding:10px">
<b><font size="5" face="american typewriter">Apache TinkerPop™</font></b>
@@ -34,7 +34,7 @@
</p>
</div>
<div class="col-sm-2 col-md-2">
- <img src="images/peon-head.png" width="100px">
+ <img src="img/peon-head.png" width="100px">
</div>
</div>
</div>
@@ -58,7 +58,7 @@
Moreover, they only need to concern themselves with learning the Gremlin traversal language as every TinkerPop-enabled graph system supports Gremlin.
</div>
<div class="col-sm-4 col-md-4">
- <img src="images/tinkerblocks.png" style="width:100%">
+ <img src="img/tinkerblocks.png" style="width:100%">
</div>
</div>
<br/>
@@ -75,7 +75,7 @@
<br/>
<li><strong>The GraphComputer (optional)</strong>: All OLAP-based graph processors must implement the primary graph interfaces mentioned above as well as a set of parallel-processing
message-passing interfaces. However, it is possible for a data system to only implement the primary graph interfaces and still provide OLAP support to their users by integrating their
- system with an existing <code>GraphComputer</code> implementation such as, for example, <code>SparkGraphComputer</code> or <code>GiraphGraphComputer</code> (both are provided in Apache's distribution
+ system with an existing <code>GraphComputer</code> implementation such as, for example, <code>SparkGraphComputer</code> (provided in Apache's distribution
of TinkerPop).
</li>
</ol>
@@ -109,11 +109,7 @@
into a Big(Graph)Data processor via the OLAP component of the Gremlin traversal machine. Users do not have to learn Spark's data processing language as Gremlin traversals execute
over Spark. For graph system providers, they can boast Spark integration once a custom <code>InputRDD</code> (or <code>InputFormat</code>) is developed.
</li>
- <li><strong>GiraphGraphComputer</strong>: <a href="http://giraph.apache.org/">Apache Giraph</a>™ is a Big(Graph)Data processor that leverages <a href="http://hadoop.apache.org/">Apache Hadoop</a>® and
- <a href="http://zookeeper.apache.org/">Apache ZooKeeper</a>™ for executing distributed graph algorithms. <a href="http://tinkerpop.apache.org/docs/current/reference/#giraphgraphcomputer"><code>GiraphGraphComputer</code></a>
- supports Gremlin OLAP and allows users to submit Gremlin traversals to Giraph for distributed execution. Providers can immediately advertise Giraph integration once a custom <code>InputFormat</code> is developed.
- </li>
- <li><strong>Hadoop support</strong>: <a href="http://hadoop.apache.org/">Apache Hadoop</a>® has become a staple technology for Big Data applications. In TinkerPop, both <code>SparkGraphComputer</code> and <code>GiraphGraphComputer</code> can pull data
+ <li><strong>Hadoop support</strong>: <a href="http://hadoop.apache.org/">Apache Hadoop</a>® has become a staple technology for Big Data applications. In TinkerPop, <code>SparkGraphComputer</code> can pull data
from the Hadoop File System (<a href="https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsUserGuide.html">HDFS</a>). TinkerPop provides a collection of Input- and OutputFormats for different graph serialization standards as well as tooling that makes it easy for users
to <a href="http://tinkerpop.apache.org/docs/current/reference/#interacting-with-hdfs">interact with HDFS</a> from the Gremlin Console or their application.
</li>
@@ -128,74 +124,67 @@
<br/>
<div class="row">
<div class="col-sm-6 col-md-6">
- <a href="http://blazegraph.com/"><img src="images/logos/blazegraph-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
- <a href="http://blazegraph.com/">Blazegraph</a>™ is a standards-based, high-performance, scalable, open-source graph database. Written entirely in Java, the platform supports Apache TinkerPop and RDF/SPARQL 1.1 family of specifications. A commercial version includes GPU acceleration.
+ <a href="https://aws.amazon.com/neptune/"><img src="img/logos/neptune-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="https://aws.amazon.com/neptune/">Amazon Neptune</a> is a fast, reliable, fully-managed graph database service that makes it easy to build and run applications that work with highly connected datasets.
</div>
<div class="col-sm-6 col-md-6">
- <a href="https://docs.microsoft.com/en-us/azure/cosmos-db/graph-introduction"><img src="images/logos/cosmosdb-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="https://docs.microsoft.com/en-us/azure/cosmos-db/graph-introduction"><img src="img/logos/cosmosdb-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="https://docs.microsoft.com/en-us/azure/cosmos-db/graph-introduction">Azure Cosmos DB</a>™ is Microsoft's globally distributed, multi-model database service for mission-critical applications. Azure Cosmos DB provides turn-key global distribution, elastic scaling of throughput and storage worldwide, five well-defined consistency levels, and guaranteed high availability, all backed by industry-leading SLAs. It is multi-model with support for the Gremlin graph traversal language.
</div>
</div>
<br/>
<div class="row">
<div class="col-sm-6 col-md-6">
- <a href="http://datastax.com/products/datastax-enterprise-graph"><img src="images/logos/datastax-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://datastax.com/products/datastax-enterprise-graph"><img src="img/logos/datastax-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="http://datastax.com/products/datastax-enterprise-graph">DataStax Enterprise Graph</a>™, part of DataStax Enterprise's multi-model platform, is a real-time graph database built for cloud applications that need to manage complex and highly connected data. Built on the foundation of Apache Cassandra and Apache TinkerPop, DataStax Enterprise Graph delivers continuous uptime along with predictable performance and scale, while remaining operationally simple to manage.
</div>
<div class="col-sm-6 col-md-6">
- <a href="https://grakn.ai/"><img src="images/logos/grakn-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="https://grakn.ai/"><img src="img/logos/grakn-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="https://grakn.ai/">GRAKN.AI</a>™ is a distributed knowledge graph that brings knowledge ontologies and transactional data together to enable intelligent querying of data. Querying is performed through the language: Graql, a declarative, knowledge-oriented graph query language for retrieving explicitly stored and implicitly derived information, as well as to perform graph analytics and automated reasoning.
</div>
</div>
<br/>
<div class="row">
<div class="col-sm-6 col-md-6">
- <a href="http://www.ibm.com/analytics/us/en/technology/cloud-data-services/graph/"><img src="images/logos/ibmgraph-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://www.ibm.com/analytics/us/en/technology/cloud-data-services/graph/"><img src="img/logos/ibmgraph-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="http://www.ibm.com/analytics/us/en/technology/cloud-data-services/graph/">IBM Graph</a>™ is a scalable, easy-to-use, fully-managed graph database-as-a-service that is administered through IBM's Bluemix cloud platform. IBM Graph is available 24/7 and managed by a team of experts so developers can focus on building their application. Based on the Apache TinkerPop stack for building high-performance graph applications, IBM Graph provides users with a set of simplified HTTP API calls and the Gremlin graph traversal language.
</div>
<div class="col-sm-6 col-md-6">
- <a href="http://janusgraph.org/"><img src="images/logos/janusgraph-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
- <a href="http://janusgraph.org/">JanusGraph</a> is an Apache2 licensed scalable, distributed graph database optimized for storing and querying graphs containing hundreds of billions of vertices and edges distributed across a multi-machine cluster. JanusGraph is a transactional database that can support thousands of concurrent users executing complex Gremlin traversals in real time. JanusGraph also provides an in-memory, compression-based OLAP processor as well as integrates with Apache TinkerPop's Spark/Giraph OLAP processors.
+ <a href="http://janusgraph.org/"><img src="img/logos/janusgraph-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://janusgraph.org/">JanusGraph</a> is an Apache2 licensed scalable, distributed graph database optimized for storing and querying graphs containing hundreds of billions of vertices and edges distributed across a multi-machine cluster. JanusGraph is a transactional database that can support thousands of concurrent users executing complex Gremlin traversals in real time. JanusGraph also provides an in-memory, compression-based OLAP processor as well as integrates with Apache TinkerPop's Spark OLAP processors.
</div>
</div>
<br/>
<div class="row">
<div class="col-sm-6 col-md-6">
- <a href="http://cambridge-intelligence.com/keylines/"><img src="images/logos/keylines-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://cambridge-intelligence.com/keylines/"><img src="img/logos/keylines-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="http://cambridge-intelligence.com/keylines/">KeyLines</a>™ is an Apache TinkerPop and Gremlin compatible JavaScript SDK for quickly and easily building powerful, custom and scalable graph visualization applications. The KeyLines SDK offers a rich library of functionality to help you visualize and explore the data in your graph database, including graph layouts, social network analysis measures, filtering, temporal graph visualization and geospatial graph analysis. It allows the visualization of complex graph data at scale.
</div>
<div class="col-sm-6 col-md-6">
- <a href="http://linkurio.us/"><img src="images/logos/linkurious-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://linkurio.us/"><img src="img/logos/linkurious-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="http://linkurio.us/">Linkurious</a>™ is a browser-based graph visualization software to search, explore and visualize connected data. It is compatible with Apache TinkerPop and thus, any TinkerPop-enabled graph system. Linkurious provides enterprise-ready security (authentication, access rights, audit) and flexibility (API, linkurious.js JS graph visualization library) to help software architects successfully deploy graph capabilities within their organizations.
</div>
</div>
<br/>
<div class="row">
<div class="col-sm-6 col-md-6">
- <a href="http://neo4j.com/"><img src="images/logos/neo4j-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://neo4j.com/"><img src="img/logos/neo4j-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="http://neo4j.com/">Neo4j</a>™ is the most widely used open source, transactional graph database with a large active user and customer community. Because of its scalability and ease of use, Neo4j is applied in a wide variety of use cases from fraud detection, access control to recommendation and investigative journalism. Along with the openCypher graph query language, Neo4j also supports Apache TinkerPop and currently serves as its OLTP reference implementation.
</div>
<div class="col-sm-6 col-md-6">
- <a href="http://orientdb.com/"><img src="images/logos/orientdb-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://orientdb.com/"><img src="img/logos/orientdb-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="http://orientdb.com/">OrientDB</a>™ is an open source distributed graph database with native support for Apache TinkerPop and the Gremlin graph traversal language. OrientDB handles relationships by using persistent pointers, rather than expensive join runtime operations. This guarantees a fast, constant O(1) time for traversing, no matter the database size. Furthermore, OrientDB is not only a graph database, but a multi-model database able to manage documents, keys/values, objects, full-text and spatial data.
</div>
</div>
<br/>
<div class="row">
<div class="col-sm-6 col-md-6">
- <a href="http://stardog.com/"><img src="images/logos/stardog-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://stardog.com/"><img src="img/logos/stardog-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="http://stardog.com/">Stardog</a>™ is a graph database optimized for enterprise data unification. It supports both semantic graphs, via RDF, SPARQL, and OWL, as well as property graphs via Apache TinkerPop and Gremlin--it's the only graph database that supports both models over the same database, simultaneously. Stardog also supports hybrid data unification architectures, seamlessly blending data warehouse, system of record, and virtual query strategies. Stardog is suited for enterprise data silo challenges.
</div>
<div class="col-sm-6 col-md-6">
- <a href="http://titan.thinkaurelius.com/"><img src="images/logos/titan-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
- <a href="http://titan.thinkaurelius.com/">Titan</a>™ is an Apache2 licensed scalable, distributed graph database optimized for storing and querying graphs containing hundreds of billions of vertices and edges distributed across a multi-machine cluster. Titan is a transactional database that can support thousands of concurrent users executing complex Gremlin traversals in real time. Titan also provides an in-memory, compression-based OLAP processor as well as integrates with Apache TinkerPop's Spark/Giraph OLAP processors.
- </div>
- </div>
- <br/>
- <div class="row">
- <div class="col-sm-6 col-md-6">
- <a href="http://tomsawyer.com/products/perspectives/"><img src="images/logos/tomsawyer-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
- <a href="http://tomsawyer.com/products/perspectives/">Tom Sawyer Perspectives</a>™ is advanced graphics-based software for building enterprise-class data relationship visualization and analysis applications. It is a complete Software Development Kit (SDK) with a graphics-based design and preview environment. Tom Sawyer Perspectives combines visualization, layout, and analysis technology with an elegant platform architecture. Tom Sawyer Perspectives enables interaction with graph database systems via Apache TinkerPop.
+ <a href="http://tomsawyer.com/products/perspectives/"><img src="img/logos/tomsawyer-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://tomsawyer.com/products/perspectives/">Tom Sawyer Perspectives</a>™ is advanced graphics-based software for building enterprise-class data relationship visualization and analysis applications. It is a complete Software Development Kit (SDK) with a graphics-based design and preview environment. Tom Sawyer Perspectives combines visualization, layout, and analysis technology with an elegant platform architecture. Tom Sawyer Perspectives enables interaction with graph database systems via Apache TinkerPop.
</div>
</div>
</div>
@@ -206,7 +195,7 @@
<br/>
<div class="row">
<div class="col-sm-3 col-md-3">
- <img src="images/gremlin-quill.png" style="width:100%;">
+ <img src="img/gremlin-quill.png" style="width:100%;">
</div>
<div class="col-sm-9 col-md-9">
With the growth of <a href="https://en.wikipedia.org/wiki/NoSQL">NoSQL</a>, for which graph databases are a subclass, many new database query languages have been developed. SQL has
@@ -286,40 +275,44 @@
<br/>
<div class="row">
<div class="col-sm-6 col-md-6">
- <a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-console"><img src="images/logos/gremlin-groovy-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-console"><img src="img/logos/gremlin-groovy-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-console">Gremlin-Groovy</a> represents Gremlin inside the Groovy language and can be leveraged by any JVM-based project either through gmaven or its JSR-223 ScriptEngine implementation. It also serves as the Gremlin Console language.
</div>
<div class="col-sm-6 col-md-6">
- <a href="http://tinkerpop.apache.org/docs/current/reference/#_on_gremlin_language_variants"><img src="images/logos/gremlin-java-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://tinkerpop.apache.org/docs/current/reference/#_on_gremlin_language_variants"><img src="img/logos/gremlin-java-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="http://tinkerpop.apache.org/docs/current/reference/#_on_gremlin_language_variants">Gremlin-Java</a> represents Gremlin inside the Java8 language. Gremlin-Java is considered the canonical, reference implementation of Gremlin and is the primary compiler for all lambda-free bytecode due to its speed relative to other script-based, JVM variants.
</div>
</div>
<br/>
<div class="row">
<div class="col-sm-6 col-md-6">
- <a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-python"><img src="images/logos/gremlin-python-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-python"><img src="img/logos/gremlin-python-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-python">Gremlin-Python</a> represents Gremlin inside the Python language and can be used by any Python virtual machine such as CPython and Jython. Gremlin-Python traversals translate to Gremlin bytecode for RemoteConnection execution (e.g. Gremlin Server).
</div>
<div class="col-sm-6 col-md-6">
- <a href="https://github.com/mpollmeier/gremlin-scala"><img src="images/logos/gremlin-scala-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-DotNet"><img src="img/logos/gremlin-dotnet-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="http://tinkerpop.apache.org/docs/current/reference/#gremlin-DotNet">Gremlin.Net</a> represents Gremlin inside the C# language and can be used by any .NET-based project. Gremlin.Net traversals translate to Gremlin bytecode for RemoteConnection execution (e.g. Gremlin Server).
+ </div>
+ </div>
+ <br/>
+ <div class="row">
+ <div class="col-sm-6 col-md-6">
+ <a href="https://github.com/mpollmeier/gremlin-scala"><img src="img/logos/gremlin-scala-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="https://github.com/mpollmeier/gremlin-scala">Gremlin-Scala</a> is a Gremlin language variant that uses standard Scala functions, provides a convenient DSL to create vertices and edges, ensures type safe traversals, and incurrs minimal runtime overhead by only allocating instances if absolutely necessary.
</div>
+ <div class="col-sm-6 col-md-6">
+ <a href="https://github.com/clojurewerkz/ogre"><img src="img/logos/ogre-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="https://github.com/clojurewerkz/ogre">Ogre</a> is a Gremlin language variant for Clojure. It provides an API that enhances the expressivity of Gremlin within Clojure, it doesn't introduce any significant amount of performance overhead, and it can work with any TinkerPop-enabled graph database or analytic system.
+ </div>
</div>
<br/>
<div class="row">
<div class="col-sm-6 col-md-6">
- <a href="https://github.com/clojurewerkz/ogre"><img src="images/logos/ogre-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
- <a href="https://github.com/clojurewerkz/ogre">Ogre</a> is a Gremlin language variant for Clojure. It provides an API that enhances the expressivity of Gremlin within Clojure, it doesn't introduce any significant amount of performance overhead, and it can work with any TinkerPop-enabled graph database or analytic system.
- </div>
- <div class="col-sm-6 col-md-6">
- <a href="https://github.com/dkuppitz/sparql-gremlin"><img src="images/logos/sparql-gremlin-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="https://github.com/dkuppitz/sparql-gremlin"><img src="img/logos/sparql-gremlin-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="https://github.com/dkuppitz/sparql-gremlin">SPARQL-Gremlin</a> is a compiler used to transform SPARQL queries into Gremlin bytecode. It is based on the Apache Jena SPARQL processor ARQ, which provides access to a syntax tree of a SPARQL query.
</div>
- </div>
- <br/>
- <div class="row">
<div class="col-sm-6 col-md-6">
- <a href="https://github.com/twilmes/sql-gremlin"><img src="images/logos/sql-gremlin-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
+ <a href="https://github.com/twilmes/sql-gremlin"><img src="img/logos/sql-gremlin-logo.png" style="padding-right:20px;float:left;width:35%;"></a>
<a href="https://github.com/twilmes/sql-gremlin">SQL-Gremlin</a> compiles ANSI SQL to Gremlin bytecode and is useful for connecting JDBC reporting/business
intelligence tools to any TinkerPop-enabled graph system.
</div>
@@ -333,16 +326,16 @@
<div class="carousel slide" data-ride="carousel" data-type="multi" data-interval="7000" id="relatedResources">
<div class="carouselGrid-inner">
<div class="item active">
- <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="https://markorodriguez.com/2013/01/09/on-graph-computing/"><img src="images/resources/on-graph-computing-resource.png" width="100%"/></a></div>
+ <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="https://markorodriguez.com/2013/01/09/on-graph-computing/"><img src="img/resources/on-graph-computing-resource.png" width="100%"/></a></div>
</div>
<div class="item">
- <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="https://academy.datastax.com/courses/ds230-getting-started-gremlin/property-graph"><img src="images/resources/property-graph-resource.png" width="100%"/></a></div>
+ <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="https://academy.datastax.com/courses/ds230-getting-started-gremlin/property-graph"><img src="img/resources/property-graph-resource.png" width="100%"/></a></div>
</div>
<div class="item">
- <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="http://neo4j.com/why-graph-databases/"><img src="images/resources/why-graph-databases-resource.png" width="100%"/></a></div>
+ <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="http://neo4j.com/why-graph-databases/"><img src="img/resources/why-graph-databases-resource.png" width="100%"/></a></div>
</div>
<div class="item">
- <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="https://thinkaurelius.com/2012/03/22/understanding-the-world-using-tables-and-graphs/"><img src="images/resources/tables-and-graphs-resource.png" width="100%"/></a></div>
+ <div class="col-lg-3 col-md-3 col-sm-4 col-xs-6"><a href="https://thinkaurelius.com/2012/03/22/understanding-the-world-using-tables-and-graphs/"><img src="img/resources/tables-and-graphs-resource.png" width="100%"/></a></div>
</div>
</div>
<a class="left carouselGrid-control" href="#relatedResources" data-slide="prev">
@@ -373,4 +366,6 @@
});
</script>
</div>
+ <br/>
+ <br/>
</div>
diff --git a/docs/site/home/template/header-footer.html b/docs/site/home/template/header-footer.html
index 0aeb6ed..ef86a3c 100644
--- a/docs/site/home/template/header-footer.html
+++ b/docs/site/home/template/header-footer.html
@@ -41,10 +41,10 @@
<link href="css/prism.css" rel="stylesheet" type="text/css"/>
<link href="css/bootstrap-mods.css" rel="stylesheet" type="text/css"/>
<!-- Le fav and touch icons -->
- <link rel="shortcut icon" href="images/favicon.ico">
- <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
- <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
- <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
+ <link rel="shortcut icon" href="img/favicon.ico">
+ <link rel="apple-touch-icon" href="img/apple-touch-icon.png">
+ <link rel="apple-touch-icon" sizes="72x72" href="img/apple-touch-icon-72x72.png">
+ <link rel="apple-touch-icon" sizes="114x114" href="img/apple-touch-icon-114x114.png">
</head>
<body>
<script src="js/prism.js"></script>
@@ -100,6 +100,9 @@
<li><a href="http://tinkerpop.apache.org/docs/current/tutorials/the-gremlin-console/">The Gremlin Console</a></li>
<li><a href="http://tinkerpop.apache.org/docs/current/recipes/">Gremlin Recipes</a></li>
<li><a href="http://tinkerpop.apache.org/docs/current/tutorials/gremlin-language-variants/">Gremlin Language Variants</a></li>
+ <li><a href="http://tinkerpop.apache.org/docs/current/tutorials/gremlins-anatomy/">Gremlin's Anatomy</a></li>
+ <li role="separator" class="divider"></li>
+ <li><a href="http://kelvinlawrence.net/book/Gremlin-Graph-Guide.html">Book: Practical Gremlin by Kelvin Lawrence</a></li>
<li><a href="http://sql2gremlin.com/">SQL2Gremlin</a></li>
</ul>
</li>
@@ -116,7 +119,7 @@
<li><a href="index.html#committers">Project Committers</a></li>
<li><a href="policy.html">Policies</a></li>
<li role="separator" class="divider"></li>
- <li><a href="https://github.com/apache/tinkerpop/"><img src="images/gremlin-github.png" class="nav-icon"/>GitHub</a></li>
+ <li><a href="https://github.com/apache/tinkerpop/"><img src="img/gremlin-github.png" class="nav-icon"/>GitHub</a></li>
<li><a href="https://twitter.com/apachetinkerpop">Twitter</a></li>
</ul>
</li>
@@ -127,6 +130,7 @@
<ul class="dropdown-menu">
<li><a href="http://www.apache.org/">Apache Homepage</a></li>
<li><a href="http://www.apache.org/licenses/">License</a></li>
+ <li><a href="https://www.apache.org/events/current-event">Events</a></li>
<li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
<li><a href="http://www.apache.org/security/">Security</a></li>
@@ -138,7 +142,7 @@
!!!!!BODY!!!!!
<div id="footer">
<div class="container">
- <p class="muted credit">Apache TinkerPop, TinkerPop, Apache, Apache feather logo, and Apache TinkerPop project logo are either registered trademarks or trademarks of <a href="http://www.apache.org/">The Apache Software Foundation</a> in the United States and other countries.
+ <p class="muted credit">Copyright © 2018 The Apache Software Foundation.<br/>Apache TinkerPop, TinkerPop, Apache, Apache feather logo, and Apache TinkerPop project logo are either registered trademarks or trademarks of <a href="http://www.apache.org/">The Apache Software Foundation</a> in the United States and other countries.
</p>
</div>
</div>
diff --git a/docs/src/dev/future/index.asciidoc b/docs/src/dev/future/index.asciidoc
index 4a51f57..6e41cf9 100644
--- a/docs/src/dev/future/index.asciidoc
+++ b/docs/src/dev/future/index.asciidoc
@@ -31,12 +31,17 @@
sentences, or fully structured document headers and content are all acceptable. The main point is to capture ideas
for future consideration when 4.x becomes the agenda of the day for The TinkerPop.
+If adding comments sections, please "sign" comments with initials and reference those initials here:
+
+* *spm* - Stephen Mallette
+* *as* - Ashwini Singh
+
image:tp4-think.png[]
== The Main Features
-TinkerPop4 should focus on the most successful aspects of TinkerPop3 and it should avoid the traps realized in TinkerPop3.
-These items include:
+TinkerPop 4.x should focus on the most successful aspects of TinkerPop 3.x and it should avoid the traps realized in
+TinkerPop 3.x. These items include:
* The concept of Gremlin as both a virtual machine and language.
** A standard bytecode specification should be provided.
@@ -109,7 +114,7 @@
This split into two Graph APIs will enables us to make a hard boundary between what the provider (vendor) needs to
implement and what the user (developer) gets to access.
-=== Comments
+=== Comments [spm]
There is a question mark next to `ReferenceGraph.tx()` - Transactions are a bit of an open question for future versions
of TinkerPop and likely deserve their own section in this document. The model used for last three version of TinkerPop
@@ -118,6 +123,15 @@
GLVs. The idea of local subgraphs for mutations and transaction management might be good but that goes against having
just `ReferenceGraph`.
+In "hiding blueprints" we should probably consider what relevance certain components of the Structure API still have:
+
+* `io()` - this sorta fell short a few ways: API was a bit clunky, no integration with loading via OLAP, etc.
+* `variables()` - one of the problems with variables is that they were not persisted by `io()` which was generally a
+problem for TinkerGraph which relied on `io()` for flushing to file storage. This topic was discussed a bit on
+link:https://issues.apache.org/jira/browse/TINKERPOP-892[TINKERPOP-892]
+* `tx()` - as discussed in the earlier paragraph
+
+[[gremlin-language-subset]]
== Gremlin Language Subset
On link:https://issues.apache.org/jira/browse/TINKERPOP-1417[TINKERPOP-1417], it was suggested that we "Create a
@@ -136,7 +150,7 @@
* path, simplePath, cyclicPath
* groupCount, sum, group, count, max, min, etc. (reducing barriers)
-=== Comments
+=== Comments [spm]
This has an interesting potential impact on GLVs because "Little Gremlin" could be implemented within them for
client-side traversals over remote subgraphs, where the subgraph is like a remote transaction. All graph mutations
@@ -144,8 +158,56 @@
Build it locally then submit it remotely and have the server sort out the merging. It's perhaps the most natural way
to load data. With "Gremlinito" you then get the added power of being able to traverse a local subgraph.
+[[serialization]]
+== Serialization
+
+Have we yet found the appropriate serialization model? We didn't have it in 2.x at all. In 3.x we went with a use case
+based approach that made a lot of sense in the first few releases of 3.x, but the use cases couldn't have conceived
+of what was to come with the development of GLVs. GLVs rendered Gryo, the decided "network option" from the use cases,
+to be pretty useless given that it is of the JVM only and GraphSON has gone through three versions now trying to find
+the appropriate format to cover the various features we've attempted to support. While GraphSON 3.0 seems to have met
+the mark for supporting our needs, it seems bloated with Java types and doesn't perform terribly well in some cases.
+
+An ideal serialization format would be:
+
+* Compact for network transport
+* Human readable (which competes with "compact" at some level)
+* Language agnostic
+* Exposes a small set of types that makes the format easy to maintain and test
+* Extendable or perhaps built in such a way that graph providers could coerce their types to and from the types
+that TinkerPop exposes
+* Upgrade friendly so that it is possible to easily detect the version of a format and have the system act
+transparently so as to avoid the heavy configuration that users currently have to do to be sure their versions of
+TinkerPop and their version of their serializers align
+
+== Uniform Object Model
+
+On link:https://issues.apache.org/jira/browse/TINKERPOP-1909[TINKERPOP-1909], it was suggested that we are going to
+use reference (id/label) based object model. And, the direction is move towards more tidy object model contracts going
+forward. Reference model definitely provides big performance improvements especially with multi-property
+vertices/edges. One thing that we can consider is to provide a configurable object model. Enabling users to
+configure the object model (OutputFormat) as server settings (Exposing server setting is being discussed here
+link:https://issues.apache.org/jira/browse/TINKERPOP-1636[TINKERPOP-1636]). There will three types of output format.
+
+* Reference: includes id and label
+* GraphSONCompact: object reference along with properties
+* GraphSON: object reference, properties and edge details(inE/outE).
+
+=== Comments [as]
+
+This will enable the clients model based on their needs and avoid multiple query if they are sure what is expected
+from a gremlin query. If we need more details like edges/property as part of response, we can override the server
+configuration as part of the gremlin request arguments as hint.
+
+=== Comments [spm]
+
+A more full object model may be necessary as we consider implementing the options of the
+<<gremlin-language-subset,Gremlin Language Subset>>. A more robust object model, or at least the option to open up a
+more robust object model, could be necessary to support features there. We should also consider that the future is not
+necessarily a GraphSON format and could be something else as described in the <<serialization,Serialization>> section.
+
== Testing Framework
Consider a testing framework based on the Gherkin tests from 3.x and a `gremlin-test` parent module for all the test
framework modules that will potentially be needed. In 3.x, we found situation where having test modules beyond
-`gremlin-test` would have been helpful, so a parent module that held all those would probably be smart.
\ No newline at end of file
+`gremlin-test` would have been helpful, so a parent module that held all those would probably be smart.
diff --git a/docs/src/dev/provider/index.asciidoc b/docs/src/dev/provider/index.asciidoc
index b68fd63..896f85c 100644
--- a/docs/src/dev/provider/index.asciidoc
+++ b/docs/src/dev/provider/index.asciidoc
@@ -39,17 +39,17 @@
[[graph-system-provider-requirements]]
== Graph System Provider Requirements
-image:tinkerpop-enabled.png[width=140,float=left] At the core of TinkerPop3 is a Java8 API. The implementation of this
+image:tinkerpop-enabled.png[width=140,float=left] At the core of TinkerPop 3.x is a Java8 API. The implementation of this
core API and its validation via the `gremlin-test` suite is all that is required of a graph system provider wishing to
-provide a TinkerPop3-enabled graph engine. Once a graph system has a valid implementation, then all the applications
+provide a TinkerPop-enabled graph engine. Once a graph system has a valid implementation, then all the applications
provided by TinkerPop (e.g. Gremlin Console, Gremlin Server, etc.) and 3rd-party developers (e.g. Gremlin-Scala,
Gremlin-JS, etc.) will integrate properly. Finally, please feel free to use the logo on the left to promote your
-TinkerPop3 implementation.
+TinkerPop implementation.
[[graph-structure-api]]
=== Graph Structure API
-The graph structure API of TinkerPop3 provides the interfaces necessary to create a TinkerPop enabled system and
+The graph structure API of TinkerPop provides the interfaces necessary to create a TinkerPop enabled system and
exposes the basic components of a property graph to include `Graph`, `Vertex`, `Edge`, `VertexProperty` and `Property`.
The structure API can be used directly as follows:
@@ -77,11 +77,7 @@
`Graph.addVertex(Object...)` or `Vertex.addEdge(String,Vertex,Object...)`, the respective element is created along
with the provided key/value pair properties appended to it.
-Below is a sequence of basic graph mutation operations represented in Java 8. One of the major differences between
-TinkerPop2 and TinkerPop3 is that in TinkerPop3, the Java convention of using setters and getters has been abandoned
-in favor of a syntax that is more aligned with the syntax of Gremlin-Groovy in TinkerPop2. Given that Gremlin-Java8
-and Gremlin-Groovy are nearly identical due to the inclusion of Java 8 lambdas, a big effort was made to ensure that
-both languages are as similar as possible.
+Below is a sequence of basic graph mutation operations represented in Java 8.
image:basic-mutation.png[width=240,float=right]
[source,java]
@@ -160,7 +156,7 @@
package. These include interfaces like Graph, Vertex, Edge, Property, Transaction, etc. The `StructureStandardSuite`
will ensure that the semantics of the methods implemented are correct. Moreover, there are numerous `Exceptions`
classes with static exceptions that should be thrown by the graph system so that all the exceptions and their
-messages are consistent amongst all TinkerPop3 implementations.
+messages are consistent amongst all TinkerPop implementations.
[[olap-implementations]]
==== OLAP Implementations
@@ -179,9 +175,9 @@
NOTE: The VertexProgram and MapReduce interfaces in the `process/computer/` package are not required by the graph
system. Instead, these are interfaces to be implemented by application developers writing VertexPrograms and MapReduce jobs.
-IMPORTANT: TinkerPop3 provides three OLAP implementations:
+IMPORTANT: TinkerPop provides two OLAP implementations:
link:http://tinkerpop.apache.org/docs/x.y.z/reference/#tinkergraph-gremlin[TinkerGraphComputer] (TinkerGraph),
-link:http://tinkerpop.apache.org/docs/x.y.z/reference/#giraphgraphcomputer[GiraphGraphComputer] (HadoopGraph), and
+and
link:http://tinkerpop.apache.org/docs/x.y.z/reference/#sparkgraphcomputer[SparkGraphComputer] (Hadoop).
Given the complexity of the OLAP system, it is good to study and copy many of the patterns used in these reference
implementations.
@@ -219,7 +215,7 @@
===== Implementing MapReduce Emitters
-image:hadoop-logo-notext.png[width=150,float=left] The MapReduce framework in TinkerPop3 is similar to the model
+image:hadoop-logo-notext.png[width=150,float=left] The MapReduce framework in TinkerPop is similar to the model
popularized by link:http://hadoop.apache.org[Hadoop]. The primary difference is that all Mappers process the vertices
of the graph, not an arbitrary key/value pair. However, the vertices' edges can not be accessed -- only their
properties. This greatly reduces the amount of data needed to be pushed through the MapReduce engine as any edge
@@ -274,7 +270,7 @@
<1> If the MapReduce job has a reduce, then use one data structure (`reduceMap`), else use another (`mapList`). The
difference being that a reduction requires a grouping by key and therefore, the `Map<K,Queue<V>>` definition. If no
reduction/grouping is required, then a simple `Queue<KeyValue<K,V>>` can be leveraged.
-<2> If reduce is to follow, then increment the Map with a new value for the key. `MapHelper` is a TinkerPop3 class
+<2> If reduce is to follow, then increment the Map with a new value for the key. `MapHelper` is a TinkerPop class
with static methods for adding data to a Map.
<3> If no reduce is to follow, then simply append a KeyValue to the queue.
<4> When the map phase is complete, any map-result sorting required can be executed at this point.
@@ -666,6 +662,10 @@
definitions. Moreover, implementers should consider filling gaps in their own test suites, especially when
IO-related tests are being ignored.
+TIP: If it is expensive to construct a new `Graph` instance, consider implementing `GraphProvider.getStaticFeatures()`
+which can help by caching a static feature set for instances produced by that `GraphProvider` and allow the test suite
+to avoid that construction cost if the test is ignored.
+
The only test-class that requires any code investment is the `GraphProvider` implementation class. This class is a
used by the test suite to construct `Graph` configurations and instances and provides information about the
implementation itself. In most cases, it is best to simply extend `AbstractGraphProvider` as it provides many
@@ -767,7 +767,7 @@
=== Accessibility via GremlinPlugin
-image:gremlin-plugin.png[width=100,float=left] The applications distributed with TinkerPop3 do not distribute with
+image:gremlin-plugin.png[width=100,float=left] The applications distributed with TinkerPop do not distribute with
any graph system implementations besides TinkerGraph. If your implementation is stored in a Maven repository (e.g.
Maven Central Repository), then it is best to provide a <<gremlin-plugins,`GremlinPlugin`>> implementation so the respective jars can be
downloaded according and when required by the user. Neo4j's GremlinPlugin is provided below for reference.
@@ -793,7 +793,7 @@
=== In-Depth Implementations
image:gremlin-painting.png[width=200,float=right] The graph system implementation details presented thus far are
-minimum requirements necessary to yield a valid TinkerPop3 implementation. However, there are other areas that a
+minimum requirements necessary to yield a valid TinkerPop implementation. However, there are other areas that a
graph system provider can tweak to provide an implementation more optimized for their underlying graph engine. Typical
areas of focus include:
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 019db12..b80409e 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -703,7 +703,7 @@
</dependency>
----
-image:gremlin-java.png[width=175,float=left] TinkerPop3 comes equipped with a reference client for Java-based
+image:gremlin-java.png[width=175,float=left] TinkerPop comes equipped with a reference client for Java-based
applications. It is referred to as Gremlin Driver, which enables applications to send requests to Gremlin Server
and get back results.
@@ -835,7 +835,7 @@
pip install gremlinpython
----
-TinkerPop3 also includes a client for Python-based applications. It is referred to as Gremlin-Python Driver.
+TinkerPop also includes a client for Python-based applications. It is referred to as Gremlin-Python Driver.
The `Client` class implementation/interface is based on the Java Driver, with some restrictions. Most notably,
Gremlin-Python does not yet implement the `Cluster` class. Instead, `Client` is instantiated directly.
Usage is as follows:
@@ -2291,15 +2291,6 @@
NOTE: This plugin is typically only useful to the Gremlin Console and is enabled in the there by default.
-[[giraph-plugin]]
-=== Giraph Plugin
-
-image:giraph-logo.png[width=50,float=left] The Giraph Plugin installs as part of `giraph-gremlin` and provides
-a number of imports and utility functions to the environment within which it is used. Those classes and functions
-provide the basis for supporting <<graphcomputer,OLAP based traversals>> using link:http://giraph.apache.org[Giraph].
-This plugin is defined in greater detail in the <<giraphgraphcomputer,GiraphGraphComputer>> section and is typically
-installed in conjuction with the <<hadoop-plugin,Hadoop-Plugin>>.
-
[[graph-plugins]]
=== Graph Plugins
@@ -2350,13 +2341,13 @@
image:gremlin-sugar.png[width=120,float=left] In previous versions of Gremlin-Groovy, there were numerous
link:http://en.wikipedia.org/wiki/Syntactic_sugar[syntactic sugars] that users could rely on to make their traversals
more succinct. Unfortunately, many of these conventions made use of link:http://docs.oracle.com/javase/tutorial/reflect/[Java reflection]
-and thus, were not performant. In TinkerPop3, these conveniences have been removed in support of the standard
+and thus, were not performant. In TinkerPop, these conveniences have been removed in support of the standard
Gremlin-Groovy syntax being both inline with Gremlin-Java8 syntax as well as always being the most performant
representation. However, for those users that would like to use the previous syntactic sugars (as well as new ones),
there is `SugarGremlinPlugin` (a.k.a Gremlin-Groovy-Sugar).
IMPORTANT: It is important that the sugar plugin is loaded in a Gremlin Console session prior to any manipulations of
-the respective TinkerPop3 objects as Groovy will cache unavailable methods and properties.
+the respective TinkerPop objects as Groovy will cache unavailable methods and properties.
[source,groovy]
----
diff --git a/docs/src/reference/implementations-giraph.asciidoc b/docs/src/reference/implementations-giraph.asciidoc
deleted file mode 100644
index f83903d..0000000
--- a/docs/src/reference/implementations-giraph.asciidoc
+++ /dev/null
@@ -1,145 +0,0 @@
-////
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-////
-[[giraphgraphcomputer]]
-==== GiraphGraphComputer
-
-[source,xml]
-----
-<dependency>
- <groupId>org.apache.tinkerpop</groupId>
- <artifactId>giraph-gremlin</artifactId>
- <version>x.y.z</version>
-</dependency>
-----
-
-image:giraph-logo.png[width=100,float=left] link:http://giraph.apache.org[Giraph] is an Apache Software Foundation
-project focused on OLAP-based graph processing. Giraph makes use of the distributed graph computing paradigm made
-popular by Google's Pregel. In Giraph, developers write "vertex programs" that get executed at each vertex in
-parallel. These programs communicate with one another in a bulk synchronous parallel (BSP) manner. This model aligns
-with TinkerPop3's `GraphComputer` API. TinkerPop3 provides an implementation of `GraphComputer` that works for Giraph
-called `GiraphGraphComputer`. Moreover, with TinkerPop3's <<mapreduce,MapReduce>>-framework, the standard
-Giraph/Pregel model is extended to support an arbitrary number of MapReduce phases to aggregate and yield results
-from the graph. Below are examples using `GiraphGraphComputer` from the <<gremlin-console,Gremlin-Console>>.
-
-WARNING: Giraph uses a large number of Hadoop counters. The default for Hadoop is 120. In `mapred-site.xml` it is
-possible to increase the limit it via the `mapreduce.job.counters.max` property. A good value to use is 1000. This
-is a cluster-wide property so be sure to restart the cluster after updating.
-
-WARNING: The maximum number of workers can be no larger than the number of map-slots in the Hadoop cluster minus 1.
-For example, if the Hadoop cluster has 4 map slots, then `giraph.maxWorkers` can not be larger than 3. One map-slot
-is reserved for the master compute node and all other slots can be allocated as workers to execute the VertexPrograms
-on the vertices of the graph.
-
-If `GiraphGraphComputer` will be used as the `GraphComputer` for `HadoopGraph` then its `lib` directory should be
-specified in `HADOOP_GREMLIN_LIBS`.
-
-[source,shell]
-export HADOOP_GREMLIN_LIBS=$HADOOP_GREMLIN_LIBS:/usr/local/gremlin-console/ext/giraph-gremlin/lib
-
-Or, the user can specify the directory in the Gremlin Console.
-
-[source,groovy]
-System.setProperty('HADOOP_GREMLIN_LIBS',System.getProperty('HADOOP_GREMLIN_LIBS') + ':' + '/usr/local/gremlin-console/ext/giraph-gremlin/lib')
-
-[gremlin-groovy]
-----
-graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
-g = graph.traversal().withComputer(GiraphGraphComputer)
-g.V().count()
-g.V().out().out().values('name')
-----
-
-IMPORTANT: The examples above do not use lambdas (i.e. closures in Gremlin-Groovy). This makes the traversal
-serializable and thus, able to be distributed to all machines in the Hadoop cluster. If a lambda is required in a
-traversal, then the traversal must be sent as a `String` and compiled locally at each machine in the cluster. The
-following example demonstrates the `:remote` command which allows for submitting Gremlin traversals as a `String`.
-
-[gremlin-groovy]
-----
-graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
-g = graph.traversal().withComputer(GiraphGraphComputer)
-:remote connect tinkerpop.hadoop graph g
-:> g.V().group().by{it.value('name')[1]}.by('name')
-result
-result.memory.runtime
-----
-
-NOTE: If the user explicitly specifies `giraph.maxWorkers` and/or `giraph.numComputeThreads` in the configuration,
-then these values will be used by Giraph. However, if these are not specified and the user never calls
-`GraphComputer.workers()` then `GiraphGraphComputer` will try to compute the number of workers/threads to use based
-on the cluster's profile.
-
-===== Loading with BulkLoaderVertexProgram
-
-The <<bulkloadervertexprogram, BulkLoaderVertexProgram>> is a generalized bulk loader that can be used to load
-large amounts of data to and from different `Graph` implementations. The following code demonstrates how to load
-the Grateful Dead graph from HadoopGraph into TinkerGraph over Giraph:
-
-[gremlin-groovy]
-----
-hdfs.copyFromLocal('data/grateful-dead.kryo', 'grateful-dead.kryo')
-readGraph = GraphFactory.open('conf/hadoop/hadoop-grateful-gryo.properties')
-writeGraph = 'conf/tinkergraph-gryo.properties'
-blvp = BulkLoaderVertexProgram.build().
- keepOriginalIds(false).
- writeGraph(writeGraph).create(readGraph)
-readGraph.compute(GiraphGraphComputer).workers(1).program(blvp).submit().get()
-:set max-iteration 10
-graph = GraphFactory.open(writeGraph)
-g = graph.traversal()
-g.V().valueMap()
-graph.close()
-----
-
-[source,properties]
-----
-# hadoop-grateful-gryo.properties
-
-#
-# Hadoop Graph Configuration
-#
-gremlin.graph=org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph
-gremlin.hadoop.graphReader=org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoInputFormat
-gremlin.hadoop.graphWriter=org.apache.hadoop.mapreduce.lib.output.NullOutputFormat
-gremlin.hadoop.inputLocation=grateful-dead.kryo
-gremlin.hadoop.outputLocation=output
-gremlin.hadoop.jarsInDistributedCache=true
-
-#
-# GiraphGraphComputer Configuration
-#
-giraph.minWorkers=1
-giraph.maxWorkers=1
-giraph.useOutOfCoreGraph=true
-giraph.useOutOfCoreMessages=true
-mapred.map.child.java.opts=-Xmx1024m
-mapred.reduce.child.java.opts=-Xmx1024m
-giraph.numInputThreads=4
-giraph.numComputeThreads=4
-giraph.maxMessagesInMemory=100000
-----
-
-[source,properties]
-----
-# tinkergraph-gryo.properties
-
-gremlin.graph=org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph
-gremlin.tinkergraph.graphFormat=gryo
-gremlin.tinkergraph.graphLocation=/tmp/tinkergraph.kryo
-----
-
-NOTE: The path to TinkerGraph needs to be included in the `HADOOP_GREMLIN_LIBS` for the above example to work.
diff --git a/docs/src/reference/implementations-hadoop-end.asciidoc b/docs/src/reference/implementations-hadoop-end.asciidoc
index f0f0fa6..e11c542 100644
--- a/docs/src/reference/implementations-hadoop-end.asciidoc
+++ b/docs/src/reference/implementations-hadoop-end.asciidoc
@@ -170,7 +170,7 @@
==== Interacting with Spark
If a Spark context is persisted, then Spark RDDs will remain the Spark cache and accessible over subsequent jobs.
-RDDs are retrieved and saved to the `SparkContext` via `PersistedInputRDD` and `PersistedOutputRDD` respectivly.
+RDDs are retrieved and saved to the `SparkContext` via `PersistedInputRDD` and `PersistedOutputRDD` respectively.
Persisted RDDs can be accessed using `spark`.
[gremlin-groovy]
@@ -186,144 +186,4 @@
spark.head('output', 'clusterCount', PersistedInputRDD)
spark.rm('output')
spark.ls()
-----
-
-=== A Command Line Example
-
-image::pagerank-logo.png[width=300]
-
-The classic link:http://en.wikipedia.org/wiki/PageRank[PageRank] centrality algorithm can be executed over the
-TinkerPop graph from the command line using `GiraphGraphComputer`.
-
-WARNING: Be sure that the `HADOOP_GREMLIN_LIBS` references the location `lib` directory of the respective
-`GraphComputer` engine being used or else the requisite dependencies will not be uploaded to the Hadoop cluster.
-
-[source,text]
-----
-$ hdfs dfs -copyFromLocal data/tinkerpop-modern.json tinkerpop-modern.json
-$ hdfs dfs -ls
-Found 2 items
--rw-r--r-- 1 marko supergroup 2356 2014-07-28 13:00 /user/marko/tinkerpop-modern.json
-$ hadoop jar target/giraph-gremlin-x.y.z-job.jar org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphGraphComputer ../hadoop-gremlin/conf/hadoop-graphson.properties
-15/09/11 08:02:08 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
-15/09/11 08:02:11 INFO computer.GiraphGraphComputer: HadoopGremlin(Giraph): PageRankVertexProgram[alpha=0.85,iterations=30]
-15/09/11 08:02:12 INFO mapreduce.JobSubmitter: number of splits:3
-15/09/11 08:02:12 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1441915907347_0028
-15/09/11 08:02:12 INFO impl.YarnClientImpl: Submitted application application_1441915907347_0028
-15/09/11 08:02:12 INFO job.GiraphJob: Tracking URL: http://markos-macbook:8088/proxy/application_1441915907347_0028/
-15/09/11 08:02:12 INFO job.GiraphJob: Waiting for resources... Job will start only when it gets all 3 mappers
-15/09/11 08:03:54 INFO mapreduce.Job: Running job: job_1441915907347_0028
-15/09/11 08:03:55 INFO mapreduce.Job: Job job_1441915907347_0028 running in uber mode : false
-15/09/11 08:03:55 INFO mapreduce.Job: map 33% reduce 0%
-15/09/11 08:03:57 INFO mapreduce.Job: map 67% reduce 0%
-15/09/11 08:04:01 INFO mapreduce.Job: map 100% reduce 0%
-15/09/11 08:06:17 INFO mapreduce.Job: Job job_1441915907347_0028 completed successfully
-15/09/11 08:06:17 INFO mapreduce.Job: Counters: 80
- File System Counters
- FILE: Number of bytes read=0
- FILE: Number of bytes written=483918
- FILE: Number of read operations=0
- FILE: Number of large read operations=0
- FILE: Number of write operations=0
- HDFS: Number of bytes read=1465
- HDFS: Number of bytes written=1760
- HDFS: Number of read operations=39
- HDFS: Number of large read operations=0
- HDFS: Number of write operations=20
- Job Counters
- Launched map tasks=3
- Other local map tasks=3
- Total time spent by all maps in occupied slots (ms)=458105
- Total time spent by all reduces in occupied slots (ms)=0
- Total time spent by all map tasks (ms)=458105
- Total vcore-seconds taken by all map tasks=458105
- Total megabyte-seconds taken by all map tasks=469099520
- Map-Reduce Framework
- Map input records=3
- Map output records=0
- Input split bytes=132
- Spilled Records=0
- Failed Shuffles=0
- Merged Map outputs=0
- GC time elapsed (ms)=1594
- CPU time spent (ms)=0
- Physical memory (bytes) snapshot=0
- Virtual memory (bytes) snapshot=0
- Total committed heap usage (bytes)=527958016
- Giraph Stats
- Aggregate edges=0
- Aggregate finished vertices=0
- Aggregate sent message message bytes=13535
- Aggregate sent messages=186
- Aggregate vertices=6
- Current master task partition=0
- Current workers=2
- Last checkpointed superstep=0
- Sent message bytes=438
- Sent messages=6
- Superstep=31
- Giraph Timers
- Initialize (ms)=2996
- Input superstep (ms)=5209
- Setup (ms)=59
- Shutdown (ms)=9324
- Superstep 0 GiraphComputation (ms)=3861
- Superstep 1 GiraphComputation (ms)=4027
- Superstep 10 GiraphComputation (ms)=4000
- Superstep 11 GiraphComputation (ms)=4004
- Superstep 12 GiraphComputation (ms)=3999
- Superstep 13 GiraphComputation (ms)=4000
- Superstep 14 GiraphComputation (ms)=4005
- Superstep 15 GiraphComputation (ms)=4003
- Superstep 16 GiraphComputation (ms)=4001
- Superstep 17 GiraphComputation (ms)=4007
- Superstep 18 GiraphComputation (ms)=3998
- Superstep 19 GiraphComputation (ms)=4006
- Superstep 2 GiraphComputation (ms)=4007
- Superstep 20 GiraphComputation (ms)=3996
- Superstep 21 GiraphComputation (ms)=4006
- Superstep 22 GiraphComputation (ms)=4002
- Superstep 23 GiraphComputation (ms)=3998
- Superstep 24 GiraphComputation (ms)=4003
- Superstep 25 GiraphComputation (ms)=4001
- Superstep 26 GiraphComputation (ms)=4003
- Superstep 27 GiraphComputation (ms)=4005
- Superstep 28 GiraphComputation (ms)=4002
- Superstep 29 GiraphComputation (ms)=4001
- Superstep 3 GiraphComputation (ms)=3988
- Superstep 30 GiraphComputation (ms)=4248
- Superstep 4 GiraphComputation (ms)=4010
- Superstep 5 GiraphComputation (ms)=3998
- Superstep 6 GiraphComputation (ms)=3996
- Superstep 7 GiraphComputation (ms)=4005
- Superstep 8 GiraphComputation (ms)=4009
- Superstep 9 GiraphComputation (ms)=3994
- Total (ms)=138788
- File Input Format Counters
- Bytes Read=0
- File Output Format Counters
- Bytes Written=0
-$ hdfs dfs -cat output/~g/*
-{"id":1,"label":"person","properties":{"gremlin.pageRankVertexProgram.pageRank":[{"id":39,"value":0.15000000000000002}],"name":[{"id":0,"value":"marko"}],"gremlin.pageRankVertexProgram.edgeCount":[{"id":10,"value":3.0}],"age":[{"id":1,"value":29}]}}
-{"id":5,"label":"software","properties":{"gremlin.pageRankVertexProgram.pageRank":[{"id":35,"value":0.23181250000000003}],"name":[{"id":8,"value":"ripple"}],"gremlin.pageRankVertexProgram.edgeCount":[{"id":6,"value":0.0}],"lang":[{"id":9,"value":"java"}]}}
-{"id":3,"label":"software","properties":{"gremlin.pageRankVertexProgram.pageRank":[{"id":39,"value":0.4018125}],"name":[{"id":4,"value":"lop"}],"gremlin.pageRankVertexProgram.edgeCount":[{"id":10,"value":0.0}],"lang":[{"id":5,"value":"java"}]}}
-{"id":4,"label":"person","properties":{"gremlin.pageRankVertexProgram.pageRank":[{"id":39,"value":0.19250000000000003}],"name":[{"id":6,"value":"josh"}],"gremlin.pageRankVertexProgram.edgeCount":[{"id":10,"value":2.0}],"age":[{"id":7,"value":32}]}}
-{"id":2,"label":"person","properties":{"gremlin.pageRankVertexProgram.pageRank":[{"id":35,"value":0.19250000000000003}],"name":[{"id":2,"value":"vadas"}],"gremlin.pageRankVertexProgram.edgeCount":[{"id":6,"value":0.0}],"age":[{"id":3,"value":27}]}}
-{"id":6,"label":"person","properties":{"gremlin.pageRankVertexProgram.pageRank":[{"id":35,"value":0.15000000000000002}],"name":[{"id":10,"value":"peter"}],"gremlin.pageRankVertexProgram.edgeCount":[{"id":6,"value":1.0}],"age":[{"id":11,"value":35}]}}
-----
-
-Vertex 4 ("josh") is isolated below:
-
-[source,js]
-----
-{
- "id":4,
- "label":"person",
- "properties": {
- "gremlin.pageRankVertexProgram.pageRank":[{"id":39,"value":0.19250000000000003}],
- "name":[{"id":6,"value":"josh"}],
- "gremlin.pageRankVertexProgram.edgeCount":[{"id":10,"value":2.0}],
- "age":[{"id":7,"value":32}]}
- }
-}
-----
+----
\ No newline at end of file
diff --git a/docs/src/reference/implementations-hadoop-start.asciidoc b/docs/src/reference/implementations-hadoop-start.asciidoc
index 31ecf6b..4dcd13b 100644
--- a/docs/src/reference/implementations-hadoop-start.asciidoc
+++ b/docs/src/reference/implementations-hadoop-start.asciidoc
@@ -28,15 +28,14 @@
image:hadoop-logo-notext.png[width=100,float=left] link:http://hadoop.apache.org/[Hadoop] is a distributed
computing framework that is used to process data represented across a multi-machine compute cluster. When the
-data in the Hadoop cluster represents a TinkerPop3 graph, then Hadoop-Gremlin can be used to process the graph
-using both TinkerPop3's OLTP and OLAP graph computing models.
+data in the Hadoop cluster represents a TinkerPop graph, then Hadoop-Gremlin can be used to process the graph
+using both TinkerPop's OLTP and OLAP graph computing models.
IMPORTANT: This section assumes that the user has a Hadoop 2.x cluster functioning. For more information on getting
started with Hadoop, please see the
link:http://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-common/SingleCluster.html[Single Node Setup]
-tutorial. Moreover, if using `GiraphGraphComputer` or `SparkGraphComputer` it is advisable that the reader also
-familiarize their self with Giraph (link:http://giraph.apache.org/quick_start.html[Getting Started]) and Spark
-(link:http://spark.apache.org/docs/latest/quick-start.html[Quick Start]).
+tutorial. Moreover, if using `SparkGraphComputer` it is advisable that the reader also
+familiarize their self with and Spark (link:http://spark.apache.org/docs/latest/quick-start.html[Quick Start]).
=== Installing Hadoop-Gremlin
@@ -87,11 +86,7 @@
Note that the locations in `HADOOP_GREMLIN_LIBS` can be colon-separated (`:`) and all jars from all locations will
be loaded into the cluster. Locations can be local paths (e.g. `/path/to/libs`), but may also be prefixed with a file
scheme to reference files or directories in different file systems (e.g. `hdfs:///path/to/distributed/libs`).
-Typically, only the jars of the respective GraphComputer are required to be loaded (e.g. `GiraphGraphComputer` plugin lib
-directory).
-
-[source,shell]
-export HADOOP_GREMLIN_LIBS=/usr/local/gremlin-console/ext/giraph-gremlin/lib
+Typically, only the jars of the respective `GraphComputer` are required to be loaded.
=== Properties Files
@@ -113,21 +108,9 @@
spark.executor.memory=1g
spark.serializer=org.apache.tinkerpop.gremlin.spark.structure.io.gryo.GryoSerializer
gremlin.spark.persistContext=true
-#####################################
-# GiraphGraphComputer Configuration #
-#####################################
-giraph.minWorkers=2
-giraph.maxWorkers=2
-giraph.useOutOfCoreGraph=true
-giraph.useOutOfCoreMessages=true
-mapreduce.map.java.opts=-Xmx1024m
-mapreduce.reduce.java.opts=-Xmx1024m
-giraph.numInputThreads=2
-giraph.numComputeThreads=2
A review of the Hadoop-Gremlin specific properties are provided in the table below. For the respective OLAP
-engines (<<sparkgraphcomputer,`SparkGraphComputer`>> or <<giraphgraphcomputer,`GiraphGraphComputer`>>) refer
-to their respective documentation for configuration options.
+engines (<<sparkgraphcomputer,`SparkGraphComputer`>> refer to their respective documentation for configuration options.
[width="100%",cols="2,10",options="header"]
|=========================================================
@@ -145,7 +128,7 @@
can be added as needed to tune and parameterize the executed Hadoop-Gremlin job on the respective Hadoop cluster.
IMPORTANT: As the size of the graphs being processed becomes large, it is important to fully understand how the
-underlying OLAP engine (e.g. Spark, Giraph, etc.) works and understand the numerous parameterizations offered by
+underlying OLAP engine (e.g. Spark, etc.) works and understand the numerous parameterizations offered by
these systems. Such knowledge can help alleviate out of memory exceptions, slow load times, slow processing times,
garbage collection issues, etc.
@@ -177,23 +160,17 @@
`GraphComputer`. The OLTP examples presented previously are reproduced below, but using `TraversalVertexProgram`
for the execution of the Gremlin traversal.
-A `Graph` in TinkerPop3 can support any number of `GraphComputer` implementations. Out of the box, Hadoop-Gremlin
+A `Graph` in TinkerPop can support any number of `GraphComputer` implementations. Out of the box, Hadoop-Gremlin
supports the following two implementations.
-* <<sparkgraphcomputer,`SparkGraphComputer`>>: Leverages Apache Spark to execute TinkerPop3 OLAP computations.
+* <<sparkgraphcomputer,`SparkGraphComputer`>>: Leverages Apache Spark to execute TinkerPop OLAP computations.
** The graph may fit within the total RAM of the cluster (supports larger graphs). Message passing is coordinated via
Spark map/reduce/join operations on in-memory and disk-cached data (average speed traversals).
-* <<giraphgraphcomputer,`GiraphGraphComputer`>>: Leverages Apache Giraph to execute TinkerPop3 OLAP computations.
-** The graph should fit within the total RAM of the Hadoop cluster (graph size restriction), though "out-of-core"
-processing is possible. Message passing is coordinated via ZooKeeper for the in-memory graph (speedy traversals).
TIP: image:gremlin-sugar.png[width=50,float=left] For those wanting to use the <<sugar-plugin,SugarPlugin>> with
their submitted traversal, do `:remote config useSugar true` as well as `:plugin use tinkerpop.sugar` at the start of
the Gremlin Console session if it is not already activated.
-Note that `SparkGraphComputer` and `GiraphGraphComputer` are loaded via their respective plugins. Typically only
-one plugin or the other is loaded depending on the desired `GraphComputer` to use.
-
[source,text]
----
$ bin/gremlin.sh
@@ -205,8 +182,6 @@
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
plugin activated: tinkerpop.hadoop
-gremlin> :install org.apache.tinkerpop giraph-gremlin x.y.z
-==>loaded: [org.apache.tinkerpop, giraph-gremlin, x.y.z] - restart the console to use [tinkerpop.giraph]
gremlin> :install org.apache.tinkerpop spark-gremlin x.y.z
==>loaded: [org.apache.tinkerpop, spark-gremlin, x.y.z] - restart the console to use [tinkerpop.spark]
gremlin> :q
@@ -219,13 +194,10 @@
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
plugin activated: tinkerpop.hadoop
-gremlin> :plugin use tinkerpop.giraph
-==>tinkerpop.giraph activated
gremlin> :plugin use tinkerpop.spark
==>tinkerpop.spark activated
----
-WARNING: Hadoop, Spark, and Giraph all depend on many of the same libraries (e.g. ZooKeeper, Snappy, Netty, Guava,
+WARNING: Hadoop and Spark all depend on many of the same libraries (e.g. ZooKeeper, Snappy, Netty, Guava,
etc.). Unfortunately, typically these dependencies are not to the same versions of the respective libraries. As such,
-it is best to *not* have both Spark and Giraph plugins loaded in the same console session nor in the same Java
-project (though intelligent `<exclusion>`-usage can help alleviate conflicts in a Java project).
+it is may be necessary to manually cleanup dependency conflicts among different plugins.
diff --git a/docs/src/reference/implementations-neo4j.asciidoc b/docs/src/reference/implementations-neo4j.asciidoc
index b6cb546..7e05221 100644
--- a/docs/src/reference/implementations-neo4j.asciidoc
+++ b/docs/src/reference/implementations-neo4j.asciidoc
@@ -62,7 +62,7 @@
=== Indices
-Neo4j 2.x indices leverage vertex labels to partition the index space. TinkerPop3 does not provide method interfaces
+Neo4j 2.x indices leverage vertex labels to partition the index space. TinkerPop does not provide method interfaces
for defining schemas/indices for the underlying graph system. Thus, in order to create indices, it is important to
call the Neo4j API directly.
@@ -175,7 +175,7 @@
=== Multi-Label
-TinkerPop3 requires every `Element` to have a single, immutable string label (i.e. a `Vertex`, `Edge`, and
+TinkerPop requires every `Element` to have a single, immutable string label (i.e. a `Vertex`, `Edge`, and
`VertexProperty`). In Neo4j, a `Node` (vertex) can have an
link:http://neo4j.com/docs/developer-manual/current/#graphdb-neo4j-labels[arbitrary number of labels] while a `Relationship`
(edge) can have one and only one. Furthermore, in Neo4j, `Node` labels are mutable while `Relationship` labels are
diff --git a/docs/src/reference/implementations-tinkergraph.asciidoc b/docs/src/reference/implementations-tinkergraph.asciidoc
index b6b5bf4..5b04126 100644
--- a/docs/src/reference/implementations-tinkergraph.asciidoc
+++ b/docs/src/reference/implementations-tinkergraph.asciidoc
@@ -28,8 +28,8 @@
image:tinkerpop-character.png[width=100,float=left] TinkerGraph is a single machine, in-memory (with optional
persistence), non-transactional graph engine that provides both OLTP and OLAP functionality. It is deployed with
-TinkerPop3 and serves as the reference implementation for other providers to study in order to understand the
-semantics of the various methods of the TinkerPop3 API. Its status as a reference implementation does not however imply
+TinkerPop and serves as the reference implementation for other providers to study in order to understand the
+semantics of the various methods of the TinkerPop API. Its status as a reference implementation does not however imply
that it is not suitable for production. TinkerGraph has many practical use cases in production applications and their
development. Some examples of TinkerGraph use cases include:
@@ -102,7 +102,7 @@
<1> Determine the average runtime of 1000 vertex lookups when no `name`-index is defined.
<2> Determine the average runtime of 1000 vertex lookups when a `name`-index is defined.
-IMPORTANT: Each graph system will have different mechanism by which indices and schemas are defined. TinkerPop3
+IMPORTANT: Each graph system will have different mechanism by which indices and schemas are defined. TinkerPop
does not require any conformance in this area. In TinkerGraph, the only definitions are around indices. With other
graph systems, property value types, indices, edge labels, etc. may be required to be defined _a priori_ to adding
data to the graph.
diff --git a/docs/src/reference/index.asciidoc b/docs/src/reference/index.asciidoc
index decc7ef..6e81bf2 100644
--- a/docs/src/reference/index.asciidoc
+++ b/docs/src/reference/index.asciidoc
@@ -41,7 +41,6 @@
// console is to have a new asciidoc page.
include::implementations-hadoop-start.asciidoc[]
include::implementations-spark.asciidoc[]
-include::implementations-giraph.asciidoc[]
include::implementations-hadoop-end.asciidoc[]
include::gremlin-variants.asciidoc[]
diff --git a/docs/src/reference/intro.asciidoc b/docs/src/reference/intro.asciidoc
index 890034d..cc81c90 100644
--- a/docs/src/reference/intro.asciidoc
+++ b/docs/src/reference/intro.asciidoc
@@ -35,9 +35,7 @@
in 2009 (i.e. the good ol' days -- it was the best of times and it was the worst of times).
TIP: The TinkerPop graph is available with <<tinkergraph-gremlin,TinkerGraph>> via `TinkerFactory.createModern()`.
-TinkerGraph is the reference implementation of TinkerPop3 and is used in nearly all the examples in this documentation.
-Note that there also exists the classic `TinkerFactory.createClassic()` which is the graph used in TinkerPop2 and does
-not include vertex labels.
+TinkerGraph is the reference implementation of TinkerPop and is used in nearly all the examples in this documentation.
TIP: All of the toy graphs available in TinkerPop are described in
link:http://tinkerpop.apache.org/docs/x.y.z/tutorials/the-gremlin-console/#toy-graphs[The Gremlin Console] tutorial.
@@ -46,7 +44,7 @@
.TinkerPop Modern
image::tinkerpop-modern.png[width=500]
-TinkerPop3 is the third incarnation of the TinkerPop graph computing framework. Similar to computing in general, graph
+TinkerPop 3.x is the third incarnation of the TinkerPop graph computing framework. Similar to computing in general, graph
computing makes a distinction between *structure* (graph) and *process* (traversal). The structure of the graph is the
data model defined by a vertex/edge/property link:http://en.wikipedia.org/wiki/Network_topology[topology]. The process
of the graph is the means by which the structure is analyzed. The typical form of graph processing is called a
@@ -58,7 +56,7 @@
they are described in greater detail in the link:http://tinkerpop.apache.org/docs/x.y.z/tutorials/gremlins-anatomy/[Gremlin's Anatomy]
tutorial.
-.Primary components of the TinkerPop3 *structure* API
+.Primary components of the TinkerPop *structure* API
* `Graph`: maintains a set of vertices and edges, and access to database functions such as transactions.
* `Element`: maintains a collection of properties and a string label denoting the element type.
** `Vertex`: extends Element and maintains a set of incoming and outgoing edges.
@@ -66,7 +64,7 @@
* `Property<V>`: a string key associated with a `V` value.
** `VertexProperty<V>`: a string key associated with a `V` value as well as a collection of `Property<U>` properties (*vertices only*)
-.Primary components of the TinkerPop3 *process* API
+.Primary components of the TinkerPop *process* API
* `TraversalSource`: a generator of traversals for a particular graph, link:http://en.wikipedia.org/wiki/Domain-specific_language[domain specific language] (DSL), and execution engine.
** `Traversal<S,E>`: a functional data flow process transforming objects of type `S` into object of type `E`.
*** `GraphTraversal`: a traversal DSL that is oriented towards the semantics of the raw graph (i.e. vertices, edges, etc.).
@@ -74,20 +72,20 @@
** `VertexProgram`: code executed at all vertices in a logically parallel manner with intercommunication via message passing.
** `MapReduce`: a computations that analyzes all vertices in the graph in parallel and yields a single reduced result.
-IMPORTANT: TinkerPop3 is licensed under the popular link:http://www.apache.org/licenses/LICENSE-2.0.html[Apache2]
-free software license. However, note that the underlying graph engine used with TinkerPop3 may have a different
+IMPORTANT: TinkerPop is licensed under the popular link:http://www.apache.org/licenses/LICENSE-2.0.html[Apache2]
+free software license. However, note that the underlying graph engine used with TinkerPop may have a different
license. Thus, be sure to respect the license caveats of the graph system product.
-image:tinkerpop-enabled.png[width=135,float=left] When a graph system implements the TinkerPop3 structure and process
+image:tinkerpop-enabled.png[width=135,float=left] When a graph system implements the TinkerPop structure and process
link:http://en.wikipedia.org/wiki/Application_programming_interface[APIs], their technology is considered
-_TinkerPop3-enabled_ and becomes nearly indistinguishable from any other TinkerPop-enabled graph system save for
+_TinkerPop-enabled_ and becomes nearly indistinguishable from any other TinkerPop-enabled graph system save for
their respective time and space complexity. The purpose of this documentation is to describe the structure/process
-dichotomy at length and in doing so, explain how to leverage TinkerPop3 for the sole purpose of graph system-agnostic
+dichotomy at length and in doing so, explain how to leverage TinkerPop for the sole purpose of graph system-agnostic
graph computing. Before deep-diving into the various structure/process APIs, a short introductory review of both APIs
is provided.
-NOTE: The TinkerPop3 API rides a fine line between providing concise "query language" method names and respecting
-Java method naming standards. The general convention used throughout TinkerPop3 is that if a method is "user exposed,"
+NOTE: The TinkerPop API rides a fine line between providing concise "query language" method names and respecting
+Java method naming standards. The general convention used throughout TinkerPop is that if a method is "user exposed,"
then a concise name is provided (e.g. `out()`, `path()`, `repeat()`). If the method is primarily for graph systems
providers, then the standard Java naming convention is followed (e.g. `getNextStep()`, `getSteps()`,
`getElementComputeKeys()`).
@@ -107,7 +105,7 @@
== The Graph Process
image:gremlin-running.png[width=125,float=left] The primary way in which graphs are processed are via graph
-traversals. The TinkerPop3 process API is focused on allowing users to create graph traversals in a
+traversals. The TinkerPop process API is focused on allowing users to create graph traversals in a
syntactically-friendly way over the structures defined in the previous section. A traversal is an algorithmic walk
across the elements of a graph according to the referential structure explicit within the graph data structure.
For example: _"What software does vertex 1's friends work on?"_ This English-statement can be represented in the
@@ -191,8 +189,8 @@
image::traversal-mechanics.png[width=500]
-In TinkerPop3, the objects propagating through the traversal are wrapped in a `Traverser<T>`. The traverser concept
-is new to TinkerPop3 and provides the means by which steps remain stateless. A traverser maintains all the metadata
+In TinkerPop, the objects propagating through the traversal are wrapped in a `Traverser<T>`. The traverser concept
+is new to TinkerPop and provides the means by which steps remain stateless. A traverser maintains all the metadata
about the traversal -- e.g., how many times the traverser has gone through a loop, the path history of the traverser,
the current object being traversed, etc. Traverser metadata may be accessed by a step. A classic example is the
<<path-step,`path()`>>-step.
@@ -215,13 +213,13 @@
----
WARNING: A Traversal's result are never ordered unless explicitly by means of <<order-step,`order()`>>-step. Thus,
-never rely on the iteration order between TinkerPop3 releases and even within a release (as traversal optimizations
+never rely on the iteration order between TinkerPop releases and even within a release (as traversal optimizations
may alter the flow).
== On Gremlin Language Variants
Gremlin is written in Java 8. There are various language variants of Gremlin such as Gremlin-Groovy (packaged with
-TinkerPop3), Gremlin-Python (packaged with TinkerPop3), link:https://github.com/mpollmeier/gremlin-scala[Gremlin-Scala],
+TinkerPop), Gremlin-Python (packaged with TinkerPop), link:https://github.com/mpollmeier/gremlin-scala[Gremlin-Scala],
Gremlin-JavaScript, Gremlin-Clojure (known as link:https://github.com/clojurewerkz/ogre[Ogre]), etc.
It is best to think of Gremlin as a style of graph traversing that is not bound to a particular programming language per se.
Within a programming language familiar to the developer, there is a Gremlin variant that they can use that leverages
@@ -232,7 +230,7 @@
Throughout the documentation, the examples provided are primarily written in Gremlin-Groovy. The reason for this is
the <<gremlin-console,Gremlin Console>> -- an interactive programming environment exists that does not require
-code compilation. For learning TinkerPop3 and interacting with a live graph system in an ad hoc manner, the Gremlin
+code compilation. For learning TinkerPop and interacting with a live graph system in an ad hoc manner, the Gremlin
Console is invaluable. However, for developers interested in working with Gremlin-Java, a few Groovy-to-Java patterns
are presented below.
@@ -264,7 +262,7 @@
== Graph System Integration
image:provider-integration.png[width=395,float=right] TinkerPop is a framework composed of various interoperable
-components. At the foundation there is the <<graph,core TinkerPop3 API>> which defines what a `Graph`, `Vertex`,
+components. At the foundation there is the <<graph,core TinkerPop API>> which defines what a `Graph`, `Vertex`,
`Edge`, etc. are. At minimum a graph system provider must implement the core API. Once implemented, the Gremlin
<<traversal,traversal language>> is available to the graph system's users. However, the provider can go further and
develop specific <<traversalstrategy,`TraversalStrategy`>> optimizations that allow the graph system to inspect a
diff --git a/docs/src/reference/preface.asciidoc b/docs/src/reference/preface.asciidoc
index f54e168..4776a75 100644
--- a/docs/src/reference/preface.asciidoc
+++ b/docs/src/reference/preface.asciidoc
@@ -15,7 +15,7 @@
limitations under the License.
////
[[preface]]
-= TinkerPop3 Documentation
+= TinkerPop Documentation
In the beginning...
@@ -74,7 +74,7 @@
more efficient, more expressive, better capable of reasoning upon his thoughts. Faster, quickly, now towards the
world's end, where there would be forever currently, emanatingly engulfing that which is -- The TinkerPop.
-== TinkerPop3
+== TinkerPop
image::tinkerpop3-splash.png[width=450]
@@ -86,7 +86,5 @@
image::gremlintron.png[width=400]
-NOTE: TinkerPop2 and below made a sharp distinction between the various TinkerPop projects: Blueprints, Pipes,
-Gremlin, Frames, Furnace, and Rexster. With TinkerPop3, all of these projects have been merged and are generally
-known as Gremlin. *Blueprints* -> Gremlin Structure API : *Pipes* -> `GraphTraversal` : *Frames* -> `Traversal` :
-*Furnace* -> `GraphComputer` and `VertexProgram` : *Rexster* -> GremlinServer.
+NOTE: For more information about differences between TinkerPop 3.x and earlier versions, please see the
+link:http://tinkerpop.apache.org/docs/x.y.z/upgrade/#appendix
diff --git a/docs/src/reference/the-graph.asciidoc b/docs/src/reference/the-graph.asciidoc
index baa9f25..1bcc96f 100644
--- a/docs/src/reference/the-graph.asciidoc
+++ b/docs/src/reference/the-graph.asciidoc
@@ -53,7 +53,7 @@
[[vertex-properties]]
== Vertex Properties
-image:vertex-properties.png[width=215,float=left] TinkerPop3 introduces the concept of a `VertexProperty<V>`. All the
+image:vertex-properties.png[width=215,float=left] TinkerPop introduces the concept of a `VertexProperty<V>`. All the
properties of a `Vertex` are a `VertexProperty`. A `VertexProperty` implements `Property` and as such, it has a
key/value pair. However, `VertexProperty` also implements `Element` and thus, can have a collection of key/value
pairs. Moreover, while an `Edge` can only have one property of key "name" (for example), a `Vertex` can have multiple
@@ -120,7 +120,7 @@
associated vertex).
[[the-crew-toy-graph]]
-TIP: A toy graph demonstrating all of the new TinkerPop3 graph structure features is available at
+TIP: A toy graph demonstrating all of the new TinkerPop graph structure features is available at
`TinkerFactory.createTheCrew()` and `data/tinkerpop-crew*`. This graph demonstrates multi-properties and meta-properties.
.TinkerPop Crew
@@ -140,9 +140,8 @@
== Graph Variables
-TinkerPop3 introduces the concept of `Graph.Variables`. Variables are key/value pairs associated with the graph
-itself -- in essence, a `Map<String,Object>`. These variables are intended to store metadata about the graph. Example
-use cases include:
+`Graph.Variables` are key/value pairs associated with the graph itself -- in essence, a `Map<String,Object>`. These
+variables are intended to store metadata about the graph. Example use cases include:
* *Schema information*: What do the namespace prefixes resolve to and when was the schema last modified?
* *Global permissions*: What are the access rights for particular groups?
@@ -426,37 +425,14 @@
}
----
-GraphML was a supported format in TinkerPop 2.x, but there were several issues that made it inconsistent with the
-specification that were corrected for 3.x. As a result, attempting to read a GraphML file generated by 2.x with the
-3.x `GraphMLReader` will result in error. To help with this problem, an XSLT file is provided as a resource in
-`gremlin-core` which will transform 2.x GraphML to 3.x GraphML. It can be used as follows:
-
-[source,java]
-----
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-
-InputStream stylesheet = Thread.currentThread().getContextClassLoader().getResourceAsStream("tp2-to-tp3-graphml.xslt");
-File datafile = new File('/tmp/tp2-graphml.xml');
-File outfile = new File('/tmp/tp3-graphml.xml');
-
-TransformerFactory tFactory = TransformerFactory.newInstance();
-StreamSource stylesource = new StreamSource(stylesheet);
-Transformer transformer = tFactory.newTransformer(stylesource);
-
-StreamSource source = new StreamSource(datafile);
-StreamResult result = new StreamResult(new FileWriter(outfile));
-transformer.transform(source, result);
-----
+NOTE: If using GraphML generated from TinkerPop 2.x, you can read more about its incompatibilities in the
+link:http://tinkerpop.apache.org/docs/x.y.z/upgrade/#graphml-format[Upgrade Documentation].
[[graphson-reader-writer]]
=== GraphSON Reader/Writer
image:gremlin-graphson.png[width=350,float=left] GraphSON is a link:http://json.org/[JSON]-based format extended
-from earlier versions of TinkerPop. It is important to note that TinkerPop3's GraphSON is not backwards compatible
+from earlier versions of TinkerPop. It is important to note that TinkerPop's GraphSON is not backwards compatible
with prior TinkerPop GraphSON versions. GraphSON has some support from graph-related application outside of TinkerPop,
but it is generally best used in two cases:
@@ -736,56 +712,8 @@
NOTE: The preferred extension for files names produced by Gryo is `.kryo`.
-=== TinkerPop2 Data Migration
-
-image:data-migration.png[width=300,float=right] For those using TinkerPop2, migrating to TinkerPop3 will mean a number
-of programming changes, but may also require a migration of the data depending on the graph implementation. For
-example, trying to open `TinkerGraph` data from TinkerPop2 with TinkerPop3 code will not work, however opening a
-TinkerPop2 `Neo4jGraph` with a TinkerPop3 `Neo4jGraph` should work provided there aren't Neo4j version compatibility
-mismatches preventing the read.
-
-If such a situation arises that a particular TinkerPop2 `Graph` can not be read by TinkerPop3, a "legacy" data
-migration approach exists. The migration involves writing the TinkerPop2 `Graph` to GraphSON, then reading it to
-TinkerPop3 with the `LegacyGraphSONReader` (a limited implementation of the `GraphReader` interface).
-
-The following represents an example migration of the "classic" toy graph. In this example, the "classic" graph is
-saved to GraphSON using TinkerPop2.
-
-[source,groovy]
-----
-gremlin> Gremlin.version()
-==>2.5.z
-gremlin> graph = TinkerGraphFactory.createTinkerGraph()
-==>tinkergraph[vertices:6 edges:6]
-gremlin> GraphSONWriter.outputGraph(graph,'/tmp/tp2.json',GraphSONMode.EXTENDED)
-==>null
-----
-
-The above console session uses the `gremlin-groovy` distribution from TinkerPop2. It is important to generate the
-`tp2.json` file using the `EXTENDED` mode as it will include data types when necessary which will help limit
-"lossiness" on the TinkerPop3 side when imported. Once `tp2.json` is created, it can then be imported to a TinkerPop3
-`Graph`.
-
-[source,groovy]
-----
-gremlin> Gremlin.version()
-==>x.y.z
-gremlin> graph = TinkerGraph.open()
-==>tinkergraph[vertices:0 edges:0]
-gremlin> r = LegacyGraphSONReader.build().create()
-==>org.apache.tinkerpop.gremlin.structure.io.graphson.LegacyGraphSONReader@64337702
-gremlin> r.readGraph(new FileInputStream('/tmp/tp2.json'), graph)
-==>null
-gremlin> g = graph.traversal()
-==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
-gremlin> g.E()
-==>e[11][4-created->3]
-==>e[12][6-created->3]
-==>e[7][1-knows->2]
-==>e[8][1-knows->4]
-==>e[9][1-created->3]
-==>e[10][4-created->5]
-----
+NOTE: Data migrations from TinkerPop 2.x are discussed in the Appendix of the
+link:http://tinkerpop.apache.org/docs/x.y.z/upgrade/#appendix[Upgrade Documentation].
== Namespace Conventions
diff --git a/docs/src/reference/the-graphcomputer.asciidoc b/docs/src/reference/the-graphcomputer.asciidoc
index af599eb..4bf39d0 100644
--- a/docs/src/reference/the-graphcomputer.asciidoc
+++ b/docs/src/reference/the-graphcomputer.asciidoc
@@ -17,7 +17,7 @@
[[graphcomputer]]
= The GraphComputer
-image:graphcomputer-puffers.png[width=350,float=right] TinkerPop3 provides two primary means of interacting with a
+image:graphcomputer-puffers.png[width=350,float=right] TinkerPop provides two primary means of interacting with a
graph: link:http://en.wikipedia.org/wiki/Online_transaction_processing[online transaction processing] (OLTP) and
link:http://en.wikipedia.org/wiki/Online_analytical_processing[online analytical processing] (OLAP). OLTP-based
graph systems allow the user to query the graph in real-time. However, typically, real-time performance is only
@@ -39,7 +39,7 @@
`VertexProgram`. The programs send messages to one another with the topological structure of the graph acting as the
communication network (though random message passing possible). In many respects, the messages passed are like
the OLTP traversers moving from vertex-to-vertex. However, all messages are moving independent of one another, in
-parallel. Once a vertex program is finished computing, TinkerPop3's OLAP engine supports any number
+parallel. Once a vertex program is finished computing, TinkerPop's OLAP engine supports any number
link:http://en.wikipedia.org/wiki/MapReduce[`MapReduce`] jobs over the resultant graph.
IMPORTANT: `GraphComputer` was designed from the start to be used within a multi-JVM, distributed environment --
@@ -87,7 +87,7 @@
NOTE: This model of "vertex-centric graph computing" was made popular by Google's
link:http://googleresearch.blogspot.com/2009/06/large-scale-graph-computing-at-google.html[Pregel] graph engine.
In the open source world, this model is found in OLAP graph computing systems such as link:https://giraph.apache.org/[Giraph],
-link:https://hama.apache.org/[Hama]. TinkerPop3 extends the
+link:https://hama.apache.org/[Hama]. TinkerPop extends the
popularized model with integrated post-processing <<mapreduce,MapReduce>> jobs over the vertex set.
[[mapreduce]]
@@ -97,7 +97,7 @@
elements in the graph. In many situations, it is necessary to aggregate those resultant properties into a single
result set (i.e. a statistic). For instance, assume a VertexProgram that computes a nominal cluster for each vertex
(i.e. link:http://en.wikipedia.org/wiki/Community_structure[a graph clustering algorithm]). At the end of the
-computation, each vertex will have a property denoting the cluster it was assigned to. TinkerPop3 provides the
+computation, each vertex will have a property denoting the cluster it was assigned to. TinkerPop provides the
ability to answer global questions about the clusters. For instance, in order to answer the following questions,
`MapReduce` jobs are required:
@@ -106,7 +106,7 @@
* What is the average age of each vertex in each cluster?
* What is the degree distribution of the vertices in each cluster?
-A compressed representation of the `MapReduce` API in TinkerPop3 is provided below. The key idea is that the
+A compressed representation of the `MapReduce` API in TinkerPop is provided below. The key idea is that the
`map`-stage processes all vertices to emit key/value pairs. Those values are aggregated on their respective key
for the `reduce`-stage to do its processing to ultimately yield more key/value pairs.
@@ -155,14 +155,15 @@
result.memory().clusterCount
----
-IMPORTANT: The MapReduce model of TinkerPop3 does not support MapReduce chaining. Thus, the order in which the
+IMPORTANT: The MapReduce model of TinkerPop does not support MapReduce chaining. Thus, the order in which the
MapReduce jobs are executed is irrelevant. This is made apparent when realizing that the `map()`-stage takes a
`Vertex` as its input and the `reduce()`-stage yields key/value pairs. Thus, the results of reduce can not fed back
into a `map()`.
== A Collection of VertexPrograms
-TinkerPop3 provides a collection of VertexPrograms that implement common algorithms. This section discusses the various implementations.
+TinkerPop provides a collection of VertexPrograms that implement common algorithms. This section discusses the various
+implementations.
IMPORTANT: The vertex programs presented are what are provided as of TinkerPop x.y.z. Over time, with future releases,
more algorithms will be added.
@@ -416,7 +417,7 @@
image:batch-graph.png[width=220,float=left] The `BulkLoaderVertexProgram` provides a generalized way for loading
graphs of any size into a persistent `Graph`. It is especially useful for large graphs (i.e. hundreds of millions
or billions of edges) as it can take advantage of the parallel processing offered by `GraphComputer` instances. The
-input can be any existing `Graph` database supporting TinkerPop3 or any of the Hadoop GraphInputFormats (e.g.
+input can be any existing `Graph` database supporting TinkerPop or any of the Hadoop GraphInputFormats (e.g.
`GraphSONInputFormat`, `GryoInputFormat` or `ScriptInputFormat`). The following example demonstrates how to load data
from one TinkerGraph to another:
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 2e325d6..f845cd3 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -44,7 +44,7 @@
A `GraphTraversal<S,E>` is spawned from a `GraphTraversalSource`. It can also be spawned anonymously (i.e. empty)
via `__`. A graph traversal is composed of an ordered list of steps. All the steps provided by `GraphTraversal`
inherit from the more general forms diagrammed above. A list of all the steps (and their descriptions) are provided
-in the TinkerPop3 link:http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html[GraphTraversal JavaDoc].
+in the TinkerPop link:http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html[GraphTraversal JavaDoc].
The following subsections will demonstrate the GraphTraversal steps using the <<gremlin-console,Gremlin Console>>.
IMPORTANT: The basics for starting a traversal are described in <<the-graph-process,The Graph Process>> section as
@@ -1024,8 +1024,8 @@
image::inject-step.png[width=800]
-One of the major features of TinkerPop3 is "injectable steps." This makes it possible to insert objects arbitrarily
-into a traversal stream. In general, `inject()`-step (*sideEffect*) exists and a few examples are provided below.
+The concept of "injectable steps" makes it possible to insert objects arbitrarily into a traversal stream. In general,
+`inject()`-step (*sideEffect*) exists and a few examples are provided below.
[gremlin-groovy,modern]
----
@@ -1471,16 +1471,17 @@
[[max-step]]
=== Max Step
-The `max()`-step (*map*) operates on a stream of numbers and determines which is the largest number in the stream.
+The `max()`-step (*map*) operates on a stream of comparable objects and determines which is the last object according to its natural order in the stream.
[gremlin-groovy,modern]
----
g.V().values('age').max()
g.V().repeat(both()).times(3).values('age').max()
+g.V().values('name').max()
----
IMPORTANT: `max(local)` determines the max of the current, local object (not the objects in the traversal stream).
-This works for `Collection` and `Number`-type objects. For any other object, a max of `Double.NaN` is returned.
+This works for `Collection` and `Comparable`-type objects.
*Additional References*
@@ -1504,7 +1505,7 @@
thus altering the average.
IMPORTANT: `mean(local)` determines the mean of the current, local object (not the objects in the traversal stream).
-This works for `Collection` and `Number`-type objects. For any other object, a mean of `Double.NaN` is returned.
+This works for `Collection` and `Number`-type objects.
*Additional References*
@@ -1515,16 +1516,17 @@
[[min-step]]
=== Min Step
-The `min()`-step (*map*) operates on a stream of numbers and determines which is the smallest number in the stream.
+The `min()`-step (*map*) operates on a stream of comparable objects and determines which is the first object according to its natural order in the stream.
[gremlin-groovy,modern]
----
g.V().values('age').min()
g.V().repeat(both()).times(3).values('age').min()
+g.V().values('name').min()
----
IMPORTANT: `min(local)` determines the min of the current, local object (not the objects in the traversal stream).
-This works for `Collection` and `Number`-type objects. For any other object, a min of `Double.NaN` is returned.
+This works for `Collection` and `Comparable`-type objects.
*Additional References*
@@ -1703,11 +1705,14 @@
g.V().pageRank().by('pageRank').values('pageRank')
g.V().hasLabel('person').
pageRank().
- by(outE('knows')).
- by('friendRank').
+ with(PageRank.edges, __.outE('knows')).
+ with(PageRank.propertyName, 'friendRank').
order().by('friendRank',desc).valueMap('name','friendRank')
----
+Note the use of the `with()` modulating step which provides configuration options to the algorithm. It takes
+configuration keys from the `PageRank` and is automatically imported to the Gremlin Console.
+
The <<explain-step,`explain()`>>-step can be used to understand how the traversal is compiled into multiple `GraphComputer` jobs.
[gremlin-groovy,modern]
@@ -1715,8 +1720,8 @@
g = graph.traversal().withComputer()
g.V().hasLabel('person').
pageRank().
- by(outE('knows')).
- by('friendRank').
+ with(PageRank.edges, __.outE('knows')).
+ with(PageRank.propertyName, 'friendRank').
order().by('friendRank',desc).valueMap('name','friendRank').explain()
----
@@ -1810,10 +1815,16 @@
g = graph.traversal().withComputer()
g.V().peerPressure().by('cluster').values('cluster')
g.V().hasLabel('person').
- peerPressure().by('cluster').
- group().by('cluster').by('name')
+ peerPressure().
+ with(PeerPressure.propertyName, 'cluster').
+ group().
+ by('cluster').
+ by('name')
----
+Note the use of the `with()` modulating step which provides configuration options to the algorithm. It takes
+configuration keys from the `PeerPressure` class and is automatically imported to the Gremlin Console.
+
*Additional References*
link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#peerPressure--++[`peerPressure()`]
@@ -2579,7 +2590,7 @@
[[sum-step]]
=== Sum Step
-The `sum()`-step (*map*) operates on a stream of numbers and sums the numbers together to yield a double. Note that
+The `sum()`-step (*map*) operates on a stream of numbers and sums the numbers together to yield a result. Note that
the current traverser number is multiplied by the traverser bulk to determine how many such numbers are being
represented.
@@ -2590,7 +2601,7 @@
----
IMPORTANT: `sum(local)` determines the sum of the current, local object (not the objects in the traversal stream).
-This works for `Collection`-type objects. For any other object, a sum of `Double.NaN` is returned.
+This works for `Collection`-type objects.
*Additional References*
@@ -2826,7 +2837,7 @@
----
It is important to note that the map of a vertex maintains a list of values for each key. The map of an edge or
-vertex-property represents a single property (not a list). The reason is that vertices in TinkerPop3 leverage
+vertex-property represents a single property (not a list). The reason is that vertices in TinkerPop leverage
<<vertex-properties,vertex properties>> which are support multiple values per key. Using the <<the-crew-toy-graph,
"The Crew">> toy graph, the point is made explicit.
@@ -2978,7 +2989,7 @@
WARNING: The anonymous traversal of `where()` processes the current object "locally". In OLAP, where the atomic unit
of computing is the vertex and its local "star graph," it is important that the anonymous traversal does not leave
the confines of the vertex's star graph. In other words, it can not traverse to an adjacent vertex's properties or
-edges.
+edges.
*Additional References*
@@ -2987,6 +2998,13 @@
link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#where-org.apache.tinkerpop.gremlin.process.traversal.Traversal-++[`where(Traversal)`],
link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/P.html++[`P`]
+[[with-step]]
+=== With Step
+
+The `with()`-step is not an actual step, but is instead a "step modulator" which modifies the behavior of the step
+prior to it. The `with()`-step provides additional "configuration" information to steps that implement the `Configuring`
+interface. Steps that allow for this type of modulation will explicitly state so in their documentation.
+
[[a-note-on-predicates]]
== A Note on Predicates
@@ -3173,7 +3191,7 @@
of the Gremlin traversal machine's compiler. There are 5 categories of strategies which are itemized below:
* There is an application-level feature that can be embedded into the traversal logic (*decoration*).
- * There is a more efficient way to express the traversal at the TinkerPop3 level (*optimization*).
+ * There is a more efficient way to express the traversal at the TinkerPop level (*optimization*).
* There is a more efficient way to express the traversal at the graph system/language/driver level (*provider optimization*).
* There are some final adjustments/cleanups/analyses required before executing the traversal (*finalization*).
* There are certain traversals that are not legal for the application or traversal engine (*verification*).
@@ -3273,7 +3291,7 @@
The traversal is redefined by simply taking a chain of `has()`-steps after `g.V()` (`TinkerGraphStep`) and providing
their `HasContainers` to `TinkerGraphStep`. Then its up to `TinkerGraphStep` to determine if an appropriate index exists.
-Given that the strategy uses non-TinkerPop3 provided steps, it should go into the `ProviderOptimizationStrategy` category
+Given that the strategy uses non-TinkerPop provided steps, it should go into the `ProviderOptimizationStrategy` category
to ensure the added step does not interfere with the assumptions of the `OptimizationStrategy` strategies.
[gremlin-groovy,modern]
@@ -3285,11 +3303,11 @@
----
WARNING: The reason that `OptimizationStrategy` and `ProviderOptimizationStrategy` are two different categories is
-that optimization strategies should only rewrite the traversal using TinkerPop3 steps. This ensures that the
-optimizations executed at the end of the optimization strategy round are TinkerPop3 compliant. From there, provider
+that optimization strategies should only rewrite the traversal using TinkerPop steps. This ensures that the
+optimizations executed at the end of the optimization strategy round are TinkerPop compliant. From there, provider
optimizations can analyze the traversal and rewrite the traversal as desired using graph system specific steps (e.g.
replacing `GraphStep.HasStep...HasStep` with `TinkerGraphStep`). If provider optimizations use graph system specific
-steps and implement `OptimizationStrategy`, then other TinkerPop3 optimizations may fail to optimize the traversal or
+steps and implement `OptimizationStrategy`, then other TinkerPop optimizations may fail to optimize the traversal or
mis-understand the graph system specific step behaviors (e.g. `ProviderVertexStep extends VertexStep`) and yield
incorrect semantics.
@@ -3321,7 +3339,7 @@
<8> `PathRetractionStrategy` will remove paths from the traversers and increase the likelihood of bulking as path data is not required after `select('b')`.
<9> `AdjacentToIncidentStrategy` will turn `out()` into `outE()` to increase data access locality.
-A collection of useful `DecorationStrategy` strategies are provided with TinkerPop3 and are generally useful to
+A collection of useful `DecorationStrategy` strategies are provided with TinkerPop and are generally useful to
end-users. The following sub-sections detail these strategies:
=== ElementIdStrategy
diff --git a/docs/src/tutorials/getting-started/index.asciidoc b/docs/src/tutorials/getting-started/index.asciidoc
index af3aebc..622c596 100644
--- a/docs/src/tutorials/getting-started/index.asciidoc
+++ b/docs/src/tutorials/getting-started/index.asciidoc
@@ -465,13 +465,13 @@
TinkerPop has always had the vision of being an abstraction over different graph databases. That much
is not new and dates back to TinkerPop 1.x. It is in TinkerPop 3.x however that we see the introduction of the notion
-that TinkerPop is also an abstraction over different graph processors like link:http://spark.apache.org[Spark] and
-link:http://giraph.apache.org/[Giraph]. The scope of this tutorial does not permit it to delve into
-"graph processors", but the short story is that the same Gremlin statement we wrote in the examples above can be
-executed to run in distributed fashion over Spark or Hadoop. The changes required to the code to do this are not
-in the traversal itself, but in the definition of the `TraversalSource`. You can again see why we encourage, graph
-operations to be executed through that class as opposed to just using `Graph`. You can read more about these
-features in this section on link:http://tinkerpop.apache.org/docs/x.y.z/reference/#hadoop-gremlin[hadoop-gremlin].
+that TinkerPop is also an abstraction over different graph processors like link:http://spark.apache.org[Spark]. The
+scope of this tutorial does not permit it to delve into "graph processors", but the short story is that the same
+Gremlin statement we wrote in the examples above can be executed to run in distributed fashion over Spark or Hadoop.
+The changes required to the code to do this are not in the traversal itself, but in the definition of the
+`TraversalSource`. You can again see why we encourage, graph operations to be executed through that class as opposed
+to just using `Graph`. You can read more about these features in this section on
+link:http://tinkerpop.apache.org/docs/x.y.z/reference/#hadoop-gremlin[hadoop-gremlin].
TIP: To maintain an abstraction over `Graph` creation use `GraphFactory.open()` to construct new instances. See
the documentation for individual `Graph` implementations to learn about the configuration options to provide.
diff --git a/docs/src/tutorials/the-gremlin-console/index.asciidoc b/docs/src/tutorials/the-gremlin-console/index.asciidoc
index cc090d9..09ce30b 100644
--- a/docs/src/tutorials/the-gremlin-console/index.asciidoc
+++ b/docs/src/tutorials/the-gremlin-console/index.asciidoc
@@ -98,8 +98,8 @@
* `createModern()` - The TinkerPop 3.x representation of the "classic" graph, where the main difference is that vertex
labels are defined and the "weight" edge property is a `double` rather than a `float`
(link:http://tinkerpop.apache.org/docs/x.y.z/images/tinkerpop-modern.png[diagram]).
-* `createTheCrew()` - A graph that demonstrates usage of the new structural features of TinkerPop 3.x (as compared to
-2.x) such as link:http://tinkerpop.apache.org/docs/x.y.z/reference/#vertex-properties[vertex properties and multi-properties]
+* `createTheCrew()` - A graph that demonstrates usage of the new structural features of TinkerPop 3.x such as
+link:http://tinkerpop.apache.org/docs/x.y.z/reference/#vertex-properties[vertex meta-properties and multi-properties]
(link:http://tinkerpop.apache.org/docs/x.y.z/images/the-crew-graph.png[diagram]).
[gremlin-groovy]
diff --git a/docs/src/upgrade/appendix.asciidoc b/docs/src/upgrade/appendix.asciidoc
new file mode 100644
index 0000000..a9df0e4
--- /dev/null
+++ b/docs/src/upgrade/appendix.asciidoc
@@ -0,0 +1,113 @@
+////
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+////
+
+[[appendix]]
+= Appendix
+
+== TinkerPop 2.x
+
+This section contains a few notes that reference differences between TinkerPop 2.x and 3.x.
+
+One of the major differences between TinkerPop 2.x and TinkerPop 3.x is that in TinkerPop 3.x, the Java convention of
+using setters and getters was abandoned in favor of a syntax that is more aligned with the syntax of Gremlin-Groovy in
+TinkerPop2. Given that Gremlin-Java8 and Gremlin-Groovy are nearly identical due to the inclusion of Java 8 lambdas, a
+big effort was made to ensure that both languages were as similar as possible.
+
+In addition, TinkerPop2 and below made a sharp distinction between the various TinkerPop projects: Blueprints, Pipes,
+Gremlin, Frames, Furnace, and Rexster. With TinkerPop 3.x, all of these projects have been merged and are generally
+known as Gremlin. *Blueprints* -> Gremlin Structure API : *Pipes* -> `GraphTraversal` : *Frames* -> `Traversal` :
+*Furnace* -> `GraphComputer` and `VertexProgram` : *Rexster* -> GremlinServer.
+
+[[graphml-format]]
+=== GraphML Format
+
+GraphML was a supported format in TinkerPop 2.x, but there were several issues that made it inconsistent with the
+specification that were corrected for 3.x. As a result, attempting to read a GraphML file generated by 2.x with the
+3.x `GraphMLReader` will result in error. To help with this problem, an XSLT file is provided as a resource in
+`gremlin-core` which will transform 2.x GraphML to 3.x GraphML. It can be used as follows:
+
+[source,java]
+----
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.transform.stream.StreamResult;
+
+InputStream stylesheet = Thread.currentThread().getContextClassLoader().getResourceAsStream("tp2-to-tp3-graphml.xslt");
+File datafile = new File('/tmp/tp2-graphml.xml');
+File outfile = new File('/tmp/tp3-graphml.xml');
+
+TransformerFactory tFactory = TransformerFactory.newInstance();
+StreamSource stylesource = new StreamSource(stylesheet);
+Transformer transformer = tFactory.newTransformer(stylesource);
+
+StreamSource source = new StreamSource(datafile);
+StreamResult result = new StreamResult(new FileWriter(outfile));
+transformer.transform(source, result);
+----
+
+=== TinkerPop2 Data Migration
+
+image:data-migration.png[width=300,float=right] For those using TinkerPop 2.x, migrating to TinkerPop 3.x will mean a
+number of programming changes, but may also require a migration of the data depending on the graph implementation. For
+example, trying to open `TinkerGraph` data from TinkerPop 2.x with TinkerPop 3.x code will not work, however opening a
+TinkerPop2 `Neo4jGraph` with a TinkerPop 3.x `Neo4jGraph` should work provided there aren't Neo4j version compatibility
+mismatches preventing the read.
+
+If such a situation arises that a particular TinkerPop 2.x `Graph` can not be read by TinkerPop 3.x, a "legacy" data
+migration approach exists. The migration involves writing the TinkerPop2 `Graph` to GraphSON, then reading it to
+TinkerPop 3.x with the `LegacyGraphSONReader` (a limited implementation of the `GraphReader` interface).
+
+The following represents an example migration of the "classic" toy graph. In this example, the "classic" graph is
+saved to GraphSON using TinkerPop 2.x.
+
+[source,groovy]
+----
+gremlin> Gremlin.version()
+==>2.5.z
+gremlin> graph = TinkerGraphFactory.createTinkerGraph()
+==>tinkergraph[vertices:6 edges:6]
+gremlin> GraphSONWriter.outputGraph(graph,'/tmp/tp2.json',GraphSONMode.EXTENDED)
+==>null
+----
+
+The above console session uses the `gremlin-groovy` distribution from TinkerPop2. It is important to generate the
+`tp2.json` file using the `EXTENDED` mode as it will include data types when necessary which will help limit
+"lossiness" on the TinkerPop 3.x side when imported. Once `tp2.json` is created, it can then be imported to a
+TinkerPop 3.x `Graph`.
+
+[source,groovy]
+----
+gremlin> Gremlin.version()
+==>x.y.z
+gremlin> graph = TinkerGraph.open()
+==>tinkergraph[vertices:0 edges:0]
+gremlin> r = LegacyGraphSONReader.build().create()
+==>org.apache.tinkerpop.gremlin.structure.io.graphson.LegacyGraphSONReader@64337702
+gremlin> r.readGraph(new FileInputStream('/tmp/tp2.json'), graph)
+==>null
+gremlin> g = graph.traversal()
+==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
+gremlin> g.E()
+==>e[11][4-created->3]
+==>e[12][6-created->3]
+==>e[7][1-knows->2]
+==>e[8][1-knows->4]
+==>e[9][1-created->3]
+==>e[10][4-created->5]
+----
\ No newline at end of file
diff --git a/docs/src/upgrade/index.asciidoc b/docs/src/upgrade/index.asciidoc
index 670ce31..65a1c88 100644
--- a/docs/src/upgrade/index.asciidoc
+++ b/docs/src/upgrade/index.asciidoc
@@ -41,3 +41,5 @@
include::release-3.1.x-incubating.asciidoc[]
include::release-3.0.x-incubating.asciidoc[]
+
+include::appendix.asciidoc[]
diff --git a/docs/src/upgrade/release-3.4.x.asciidoc b/docs/src/upgrade/release-3.4.x.asciidoc
new file mode 100644
index 0000000..8829569
--- /dev/null
+++ b/docs/src/upgrade/release-3.4.x.asciidoc
@@ -0,0 +1,348 @@
+////
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+////
+
+= TinkerPop 3.4.0
+
+image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/images/avant-gremlin.png[width=225]
+
+*Avant-Gremlin Construction #3 for Theremin and Flowers*
+
+== TinkerPop 3.4.0
+
+*NOT OFFICIALLY RELEASED YET*
+
+Please see the link:https://github.com/apache/tinkerpop/blob/3.4.0/CHANGELOG.asciidoc#release-3-4-0[changelog] for a complete list of all the modifications that are part of this release.
+
+=== Upgrading for Users
+
+==== with() Step
+
+This version of TinkerPop introduces the `with()` step to Gremlin. It isn't really a step but is instead a step
+modulator. This modulator allows the step it is modifying to accept configurations that can be used to alter the
+behavior of the step itself. A good example of its usage is shown with the revised syntax of the `pageRank()` step
+which now uses `with()` to replace the old `by()` options:
+
+[groovy]
+----
+g.V().hasLabel('person').
+ pageRank().
+ with(PageRank.edges, __.outE('knows')).
+ with(PageRank.propertyName, 'friendRank').
+ order().
+ by('friendRank',desc).
+ valueMap('name','friendRank')
+----
+
+A similar change was made for `peerPressure()` step:
+
+[groovy]
+----
+g.V().hasLabel('person').
+ peerPressure().
+ with(PeerPressure.propertyName, 'cluster').
+ group().
+ by('cluster').
+ by('name')
+----
+
+Note that the `by()` modulators still work, but should be considered deprecated and open for removal in a future
+release where breaking changes are allowed.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1975[TINKERPOP-1975],
+link:http://tinkerpop.apache.org/docs/3.4.0/reference/#with-step[Reference Documentation]
+
+==== Removal of Giraph Support
+
+Support for Giraph has been removed as of this version. There were a number of reasons for this decision which were
+discussed in the community prior to taking this step. Users should switch to Spark for their OLAP based graph-computing
+needs.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1930[TINKERPOP-1930]
+
+==== Removal of Rebindings Options
+
+The "rebindings" option is no longer supported for clients. It was deprecated long ago at 3.1.0. The server will not
+respond to them on any channel - websockets, nio or HTTP. Use the "aliases" option instead.
+
+link:https://issues.apache.org/jira/browse/TINKERPOP-1705[TINKERPOP-1705]
+
+==== Improvements in `min()` and `max()`
+
+Previously `min()` and `max()` were only working for numeric values. This has been changed and these steps can now operate over any `Comparable` value. The common workaround was the combination
+of `order().by()` and `limit()` as shown here:
+
+[source,groovy]
+----
+gremlin> g.V().values('name').order().by().limit(1) // workaround for min()
+==>josh
+gremlin> g.V().values('name').order().by(decr).limit(1) // workaround for max()
+==>vadas
+----
+
+Any attempt to use `min()` or `max()` on non-numeric values lead to an exception:
+
+[source,groovy]
+----
+gremlin> g.V().values('name').min()
+java.lang.String cannot be cast to java.lang.Number
+Type ':help' or ':h' for help.
+Display stack trace? [yN]
+----
+
+With the changes in this release these kind of queries became a lot easier:
+
+[source,groovy]
+----
+gremlin> g.V().values('name').min()
+==>josh
+gremlin> g.V().values('name').max()
+==>vadas
+----
+
+==== EventStrategy API
+
+There were some minor modifications to how `EventStrategy` is constructed and what can be expected from events raised
+from the addition of new properties.
+
+With respect to the change in terms of `EventStrategy` construction, the `detach()` builder method formerly took a
+`Class` as an argument and that `Class` was meant to be one of the various "detachment factories" or `null`. That
+approach was a bit confusing, so that signature has changed to `detach(EventStrategy.Detachment)` where the argument
+is a more handy enum of detachment options.
+
+As for the changes related to events themselves, it is first worth noting that the previously deprecated
+`vertexPropertyChanged(Vertex, Property, Object, Object...)` on `MutationListener` has been removed for what should
+have originally been the correct signature of `vertexPropertyChanged(Vertex, VertexProperty, Object, Object...)`. In
+prior versions when this method and its related `edgePropertyChanged()` and `vertexPropertyPropertyChanged()` were
+triggered by way of the addition of a new property a "fake" property was included with a `null` value for the
+"oldValue" argument to these methods (as it did not exist prior to this event). That was a bit awkward to reason about
+when dealing with that event. To make this easier, the event now raises with a `KeyedVertexProperty` or
+`KeyedProperty` instance, which only contains a property key and no value in them.
+
+link:https://issues.apache.org/jira/browse/TINKERPOP-1831[TINKERPOP-1831]
+
+==== Deprecation Removal
+
+The following deprecated classes, methods or fields have been removed in this version:
+
+* `gremlin-core`
+** `org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine`
+** `org.apache.tinkerpop.gremlin.process.traversal.engine.*`
+** `org.apache.tinkerpop.gremlin.process.traversal.step.map.LambdaCollectingBarrierStep.Consumers`
+** `org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer#makeHasContainers(String, P)`
+** `org.apache.tinkerpop.gremlin.process.traversal.step.util.event.MutationListener#vertexPropertyChanged(Vertex, Property, Object, Object...)`
+** `org.apache.tinkerpop.gremlin.structure.Element.Exceptions#elementAlreadyRemoved(Class, Object)`
+** `org.apache.tinkerpop.gremlin.structure.Graph.Exceptions#elementNotFound(Class, Object)`
+** `org.apache.tinkerpop.gremlin.structure.Graph.Exceptions#elementNotFound(Class, Object, Exception)`
+* `gremlin-driver`
+** `org.apache.tinkerpop.gremlin.driver.Client#rebind(String)`
+** `org.apache.tinkerpop.gremlin.driver.Client.ReboundClusterdClient`
+** `org.apache.tinkerpop.gremlin.driver.Tokens#ARGS_REBINDINGS`
+* `gremlin-groovy`
+** `org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.close()` - no longer implements `AutoCloseable`
+* `gremlin-server`
+** `org.apache.tinkerpop.gremlin.server.GraphManager#getGraphs()`
+** `org.apache.tinkerpop.gremlin.server.GraphManager#getTraversalSources()`
+** `org.apache.tinkerpop.gremlin.server.Settings#serializedResponseTimeout`
+** `org.apache.tinkerpop.gremlin.server.Settings.AuthenticationSettings#className`
+** `org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler(Settings, GraphManager, GremlinExecutor, ScheduledExecutorService)`
+** `org.apache.tinkerpop.gremlin.server.op.AbstractOpProcessor#makeFrame(ChannelHandlerContext, RequestMessage, MessageSerializer serializer, boolean, List, ResponseStatusCode code)`
+* `hadoop-graph`
+** `org.apache.tinkerpop.gremlin.hadoop.structure.HadoopConfiguration#getGraphInputFormat()`
+** `org.apache.tinkerpop.gremlin.hadoop.structure.HadoopConfiguration#getGraphOutputFormat()`
+
+Please see the javadoc deprecation notes or upgrade documentation specific to when the deprecation took place to
+understand how to resolve this breaking change.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1143[TINKERPOP-1143],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1296[TINKERPOP-1296],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1705[TINKERPOP-1705],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1707[TINKERPOP-1707],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1954[TINKERPOP-1954]
+
+==== Modifications to reducing barrier steps
+
+The behavior of `min()`, `max()`, `mean()` and `sum()` has been modified to return no result if there's no input. Previously these steps yielded the internal seed value:
+
+[source,groovy]
+----
+gremlin> g.V().values('foo').min()
+==>NaN
+gremlin> g.V().values('foo').max()
+==>NaN
+gremlin> g.V().values('foo').mean()
+==>NaN
+gremlin> g.V().values('foo').sum()
+==>0
+----
+
+These traversals will no longer emit a result. Note, that this also affects more complex scenarios, e.g. if these steps are used in `by()` modulators:
+
+[source,groovy]
+----
+gremlin> g.V().group().
+......1> by(label).
+......2> by(outE().values("weight").sum())
+==>[software:0,person:3.5]
+----
+
+Since software vertices have no outgoing edges and thus no weight values to sum, `software` will no longer show up in the result. In order to get the same result as before, one would
+have to add a `coalesce()`-step:
+
+[source,groovy]
+----
+gremlin> g.V().group().
+......1> by(label).
+......2> by(outE().values("weight").sum())
+==>[person:3.5]
+gremlin> g.V().group().
+......1> by(label).
+......2> by(coalesce(outE().values("weight"), constant(0)).sum())
+==>[software:0,person:3.5]
+----
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1777[TINKERPOP-1777]
+
+==== Change in order of select() scopes
+
+The order of select scopes has been changed to: maps, side-effects, paths
+Previously the order was: side-effects, maps, paths - which made it almost impossible to select a specific map entry if a side-effect with the same name existed.
+
+The following snippets illustrate the changed behavior:
+
+[source,groovy]
+----
+gremlin> g.V(1).
+......1> group("a").
+......2> by(__.constant("a")).
+......3> by(__.values("name")).
+......4> select("a")
+==>[a:marko]
+gremlin> g.V(1).
+......1> group("a").
+......2> by(__.constant("a")).
+......3> by(__.values("name")).
+......4> select("a").select("a")
+==>[a:marko]
+----
+
+Above is the old behavior; the second `select("a")` has no effect, it selects the side-effect `a` again, although one would expect to get the map entry `a`. What follows is the new behavior:
+
+[source,groovy]
+----
+gremlin> g.V(1).
+......1> group("a").
+......2> by(__.constant("a")).
+......3> by(__.values("name")).
+......4> select("a")
+==>[a:marko]
+gremlin> g.V(1).
+......1> group("a").
+......2> by(__.constant("a")).
+......3> by(__.values("name")).
+......4> select("a").select("a")
+==>marko
+----
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1522[TINKERPOP-1522]
+
+=== Upgrading for Providers
+
+==== Graph Database Providers
+
+===== Caching Graph Features
+
+For graph implementations that have expensive creation times, it can be time consuming to run the TinkerPop test suite
+as each test run requires a `Graph` instance even if the test is ultimately ignored becaue it doesn't pass the feature
+checks. To possibly help alleviate this problem, the `GraphProvider` interface now includes this method:
+
+[source,java]
+----
+public default Optional<Graph.Features> getStaticFeatures() {
+ return Optional.empty();
+}
+----
+
+This method can be implemented to return a cacheable set of features for a `Graph` generated from that `GraphProvider`.
+Assuming this method is faster than the cost of creating a new `Graph` instance, the test suite should execute
+significantly faster depending on how many tests end up being ignored.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1518[TINKERPOP-1518]
+
+===== Configuring Interface
+
+There were some changes to interfaces that were related to `Step`. A new `Configuring` interface was added that was
+helpful in the implementation of the `with()` step modulator. This new interface extends the `Parameterizing` interface
+(which moved to the `org.apache.tinkerpop.gremlin.process.traversal.step` package with the other step interfaces) and
+in turn is extended by the `Mutating` interface. Making this change meant that the `Mutating.addPropertyMutations()`
+method could be removed in favor of the new `Configuring.configure()` method.
+
+All of the changes above basically mean, that if the `Mutating` interface was being used in prior versions, the
+`addPropertyMutations()` method simply needs to be changed to `configure()`.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1975[TINKERPOP-1975]
+
+===== Removed hadoop-gremlin Test Artifact
+
+The `hadoop-gremlin` module no longer generates a test jar that can be used as a test dependency in other modules.
+Generally speaking, that approach tends to be a bad practice and can cause build problems with Maven that aren't always
+obvious to troubleshoot. With the removal of `giraph-gremlin` for 3.4.0, it seemed even less useful to have this
+test artifact present. All tests are still present. The follow provides a basic summary of how this refactoring
+occurred:
+
+* A new `AbstractFileGraphProvider` was created in `gremlin-test` which provided a lot of the features that
+`HadoopGraphProvider` was exposing. Both `HadoopGraphProvider` and `SparkHadoopGraphProvider` extend from that class
+now.
+* `ToyIoRegistry` and related classes were moved to `gremlin-test`.
+* The various tests that validated capabilities of `Storage` have been moved to `spark-gremlin` and are part of those
+tests now. Obviously, that makes those tests specific to Spark testing now. If that location creates a problem for some
+reason, that decision can be revisited at some point.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1410[TINKERPOP-1410]
+
+===== TraversalEngine Moved
+
+The `TraversalEngine` interface was deprecated in 3.2.0 along with all related methods that used it and classes that
+implemented it. It was replaced by the `Computer` interface and provided a much nicer way to plug different
+implementations of `Computer` into a traversal. `TraversalEngine` was never wholly removed however as it had some deep
+dependencies in the inner workings of the test suite. That infrastructure has largely remained as is until now.
+
+As of 3.4.0, `TraversalEngine` is no longer in `gremlin-core` and can instead be found in `gremlin-test` as it is
+effectively a "test-only" component and serves no other real function. As explained in the javadocs going back to
+3.2.0, providers should implement the `Computer` class and use that instead. At this point, graph providers should have
+long ago moved to the `Computer` infrastructure as methods for constructing a `TraversalSource` with a
+`TraversalEngine` were long ago removed.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1143[TINKERPOP-1143]
+
+==== Upsert Graph Feature
+
+Some `Graph` implementations may be able to offer upsert functionality for vertices and edges, which can help improve
+usability and performance. To help make it clear to users that a graph operates in this fashion, the `supportsUpsert()`
+feature has been added to both `Graph.VertexFeatures` and `Graph.EdgeFeatures`. By default, both of these methods will
+return `false`.
+
+Should a provider wish to support this feature, the behavior of `addV()` and/or `addE()` should change such that when
+a vertex or edge with the same identifier is provided, the respective step will insert the new element if that value
+is not present or update an existing element if it is found. The method by which the provider "identifies" an element
+is completely up to the capabilities of that provider. In the most simple fashion, a graph could simply check the
+value of the supplied `T.id`, however graphs that support some form of schema will likely have other methods for
+determining whether or not an existing element is present.
+
+The extent to which TinkerPop tests "upsert" is fairly narrow. Graph providers that choose to support this feature
+should consider their own test suites carefully to ensure appropriate coverage.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1685[TINKERPOP-1685]
diff --git a/docs/static/images/avant-gremlin-simple.png b/docs/static/images/avant-gremlin-simple.png
new file mode 100644
index 0000000..350af11
--- /dev/null
+++ b/docs/static/images/avant-gremlin-simple.png
Binary files differ
diff --git a/docs/static/images/avant-gremlin.png b/docs/static/images/avant-gremlin.png
new file mode 100644
index 0000000..08659b7
--- /dev/null
+++ b/docs/static/images/avant-gremlin.png
Binary files differ
diff --git a/giraph-gremlin/pom.xml b/giraph-gremlin/pom.xml
deleted file mode 100644
index 3cca330..0000000
--- a/giraph-gremlin/pom.xml
+++ /dev/null
@@ -1,258 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tinkerpop</groupId>
- <artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
- </parent>
- <artifactId>giraph-gremlin</artifactId>
- <name>Apache TinkerPop :: Giraph Gremlin</name>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <!-- see: https://github.com/apache/hadoop/pull/84 -->
- <groupId>io.netty</groupId>
- <artifactId>netty</artifactId>
- <version>3.7.1.Final</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.apache.tinkerpop</groupId>
- <artifactId>gremlin-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tinkerpop</groupId>
- <artifactId>hadoop-gremlin</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.thoughtworks.paranamer</groupId>
- <artifactId>paranamer</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- GIRAPH -->
- <dependency>
- <groupId>org.apache.giraph</groupId>
- <artifactId>giraph-core</artifactId>
- <version>1.1.0-hadoop2</version>
- <exclusions>
- <!-- self conflicts -->
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <!-- conflicts with hadoop-gremlin -->
- <exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </exclusion>
- <!-- uses an older version that conflicts with spark 2.0 -->
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-core-asl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-mapper-asl</artifactId>
- </exclusion>
- <!-- conflicts with gremlin-groovy -->
- <exclusion>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </exclusion>
- <!-- conflicts with gremlin-core -->
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <!-- gremlin-groovy conflicts -->
- <exclusion>
- <groupId>jline</groupId>
- <artifactId>jline</artifactId>
- </exclusion>
- <!-- conflicts with spark (a hack so both can be loaded in parallel) -->
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- consistent dependencies -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.1.0</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- <version>2.6.5</version>
- </dependency>
- <!-- TEST -->
- <dependency>
- <groupId>org.apache.tinkerpop</groupId>
- <artifactId>gremlin-test</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </exclusion>
- </exclusions>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tinkerpop</groupId>
- <artifactId>hadoop-gremlin</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.thoughtworks.paranamer</groupId>
- <artifactId>paranamer</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.tinkerpop</groupId>
- <artifactId>tinkergraph-gremlin</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <directory>${basedir}/target</directory>
- <finalName>${project.artifactId}-${project.version}</finalName>
- <resources>
- <resource>
- <directory>${basedir}/src/main/resources</directory>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <directory>${basedir}/src/test/resources</directory>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>build-detached-assemblies</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <attach>false</attach>
- <descriptors>
- <descriptor>src/assembly/standalone.xml</descriptor>
- <descriptor>src/assembly/hadoop-job.xml</descriptor>
- </descriptors>
- <finalName>${project.artifactId}-${project.version}</finalName>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.gmavenplus</groupId>
- <artifactId>gmavenplus-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>addSources</goal>
- <goal>addTestSources</goal>
- <goal>generateStubs</goal>
- <goal>compile</goal>
- <goal>generateTestStubs</goal>
- <goal>compileTests</goal>
- <goal>removeStubs</goal>
- <goal>removeTestStubs</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestEntries>
- <Gremlin-Plugin-Dependencies>org.apache.hadoop:hadoop-client:${hadoop.version}
- </Gremlin-Plugin-Dependencies>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
diff --git a/giraph-gremlin/src/assembly/hadoop-job.xml b/giraph-gremlin/src/assembly/hadoop-job.xml
deleted file mode 100644
index 65233e9..0000000
--- a/giraph-gremlin/src/assembly/hadoop-job.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-<assembly>
- <id>job</id>
- <formats>
- <format>jar</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <unpack>false</unpack>
- <scope>runtime</scope>
- <outputDirectory>lib</outputDirectory>
- <excludes>
- <exclude>${groupId}:${artifactId}</exclude>
- </excludes>
- </dependencySet>
- <dependencySet>
- <unpack>true</unpack>
- <includes>
- <include>${groupId}:${artifactId}</include>
- </includes>
- </dependencySet>
- </dependencySets>
-</assembly>
\ No newline at end of file
diff --git a/giraph-gremlin/src/assembly/standalone.xml b/giraph-gremlin/src/assembly/standalone.xml
deleted file mode 100644
index 82b8514..0000000
--- a/giraph-gremlin/src/assembly/standalone.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-<assembly>
- <id>standalone</id>
- <formats>
- <format>dir</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
-
- <fileSets>
- <fileSet>
- <directory>src/main/bin</directory>
- <outputDirectory>/bin</outputDirectory>
- <fileMode>0755</fileMode>
- </fileSet>
- <fileSet>
- <directory>target/*.jar</directory>
- <outputDirectory>/lib</outputDirectory>
- </fileSet>
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>/lib</outputDirectory>
- <unpack>false</unpack>
- <scope>compile</scope>
- </dependencySet>
- <dependencySet>
- <outputDirectory>/lib</outputDirectory>
- <unpack>false</unpack>
- <scope>provided</scope>
- </dependencySet>
- </dependencySets>
-</assembly>
\ No newline at end of file
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/jsr223/GiraphGremlinPlugin.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/jsr223/GiraphGremlinPlugin.java
deleted file mode 100644
index c512335..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/jsr223/GiraphGremlinPlugin.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.jsr223;
-
-import org.apache.tinkerpop.gremlin.giraph.process.computer.EmptyOutEdges;
-import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphComputation;
-import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphGraphComputer;
-import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphMemory;
-import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphMessageCombiner;
-import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphMessenger;
-import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphVertex;
-import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphWorkerContext;
-import org.apache.tinkerpop.gremlin.giraph.process.computer.MemoryAggregator;
-import org.apache.tinkerpop.gremlin.giraph.process.computer.PassThroughMemory;
-import org.apache.tinkerpop.gremlin.jsr223.AbstractGremlinPlugin;
-import org.apache.tinkerpop.gremlin.jsr223.DefaultImportCustomizer;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public final class GiraphGremlinPlugin extends AbstractGremlinPlugin {
- private static final String MODULE_NAME = "tinkerpop.giraph";
- private static final GiraphGremlinPlugin instance = new GiraphGremlinPlugin();
-
- public GiraphGremlinPlugin() {
- super(MODULE_NAME, DefaultImportCustomizer.build().addClassImports(
- EmptyOutEdges.class,
- GiraphComputation.class,
- GiraphGraphComputer.class,
- GiraphMemory.class,
- GiraphMessageCombiner.class,
- GiraphMessenger.class,
- GiraphVertex.class,
- GiraphWorkerContext.class,
- MemoryAggregator.class,
- PassThroughMemory.class).create());
- }
-
- public static GiraphGremlinPlugin instance() {
- return instance;
- }
-}
\ No newline at end of file
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/EmptyOutEdges.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/EmptyOutEdges.java
deleted file mode 100644
index 4df4835..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/EmptyOutEdges.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.process.computer;
-
-import org.apache.giraph.edge.Edge;
-import org.apache.giraph.edge.OutEdges;
-import org.apache.hadoop.io.NullWritable;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritable;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Iterator;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class EmptyOutEdges implements OutEdges<ObjectWritable, NullWritable> {
-
- private static final EmptyOutEdges INSTANCE = new EmptyOutEdges();
-
- public static EmptyOutEdges instance() {
- return INSTANCE;
- }
-
- @Override
- public void initialize(final Iterable<Edge<ObjectWritable, NullWritable>> edges) {
- }
-
- @Override
- public void initialize(final int capacity) {
- }
-
- @Override
- public void initialize() {
- }
-
- @Override
- public void add(final Edge<ObjectWritable, NullWritable> edge) {
- }
-
- @Override
- public void remove(final ObjectWritable targetVertexId) {
- }
-
- @Override
- public int size() {
- return 0;
- }
-
- @Override
- public Iterator<Edge<ObjectWritable, NullWritable>> iterator() {
- return Collections.emptyIterator();
- }
-
- @Override
- public void write(final DataOutput dataOutput) throws IOException {
- }
-
- @Override
- public void readFields(final DataInput dataInput) throws IOException {
- }
-}
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphComputation.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphComputation.java
deleted file mode 100644
index 1d52566..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphComputation.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tinkerpop.gremlin.giraph.process.computer;
-
-import org.apache.giraph.graph.BasicComputation;
-import org.apache.giraph.graph.Vertex;
-import org.apache.hadoop.io.NullWritable;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritable;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
-import org.apache.tinkerpop.gremlin.process.computer.VertexProgram;
-import org.apache.tinkerpop.gremlin.process.computer.util.ComputerGraph;
-
-import java.io.IOException;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GiraphComputation extends BasicComputation<ObjectWritable, VertexWritable, NullWritable, ObjectWritable> {
-
- public GiraphComputation() {
- }
-
- @Override
- public void compute(final Vertex<ObjectWritable, VertexWritable, NullWritable> vertex, final Iterable<ObjectWritable> messages) throws IOException {
- final GiraphWorkerContext workerContext = this.getWorkerContext();
- final VertexProgram<?> vertexProgram = workerContext.getVertexProgramPool().take();
- vertexProgram.execute(ComputerGraph.vertexProgram(vertex.getValue().get(), vertexProgram), workerContext.getMessenger((GiraphVertex) vertex, this, messages.iterator()), workerContext.getMemory());
- workerContext.getVertexProgramPool().offer(vertexProgram);
- }
-}
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphGraphComputer.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphGraphComputer.java
deleted file mode 100644
index 6392618..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphGraphComputer.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.process.computer;
-
-import org.apache.commons.configuration.BaseConfiguration;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.FileConfiguration;
-import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.commons.lang.exception.ExceptionUtils;
-import org.apache.giraph.conf.GiraphConfiguration;
-import org.apache.giraph.conf.GiraphConstants;
-import org.apache.giraph.job.GiraphJob;
-import org.apache.hadoop.filecache.DistributedCache;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.mapreduce.Cluster;
-import org.apache.hadoop.mapreduce.InputFormat;
-import org.apache.hadoop.mapreduce.OutputFormat;
-import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
-import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
-import org.apache.hadoop.util.Tool;
-import org.apache.hadoop.util.ToolRunner;
-import org.apache.tinkerpop.gremlin.giraph.structure.io.GiraphVertexInputFormat;
-import org.apache.tinkerpop.gremlin.giraph.structure.io.GiraphVertexOutputFormat;
-import org.apache.tinkerpop.gremlin.hadoop.Constants;
-import org.apache.tinkerpop.gremlin.hadoop.process.computer.AbstractHadoopGraphComputer;
-import org.apache.tinkerpop.gremlin.hadoop.process.computer.util.ComputerSubmissionHelper;
-import org.apache.tinkerpop.gremlin.hadoop.process.computer.util.MapReduceHelper;
-import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.FileSystemStorage;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.GraphFilterAware;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.HadoopPoolShimService;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.InputOutputHelper;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritable;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritableIterator;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
-import org.apache.tinkerpop.gremlin.hadoop.structure.util.ConfUtil;
-import org.apache.tinkerpop.gremlin.process.computer.ComputerResult;
-import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
-import org.apache.tinkerpop.gremlin.process.computer.MapReduce;
-import org.apache.tinkerpop.gremlin.process.computer.MemoryComputeKey;
-import org.apache.tinkerpop.gremlin.process.computer.VertexProgram;
-import org.apache.tinkerpop.gremlin.process.computer.util.DefaultComputerResult;
-import org.apache.tinkerpop.gremlin.process.computer.util.MapMemory;
-import org.apache.tinkerpop.gremlin.structure.io.Storage;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShimServiceLoader;
-import org.apache.tinkerpop.gremlin.util.Gremlin;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.NotSerializableException;
-import java.net.URI;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.Executor;
-import java.util.concurrent.Future;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GiraphGraphComputer extends AbstractHadoopGraphComputer implements GraphComputer, Tool {
-
- protected GiraphConfiguration giraphConfiguration = new GiraphConfiguration();
- private MapMemory memory = new MapMemory();
- private boolean useWorkerThreadsInConfiguration;
- private Set<String> vertexProgramConfigurationKeys = new HashSet<>();
-
- public GiraphGraphComputer(final HadoopGraph hadoopGraph) {
- super(hadoopGraph);
- final Configuration configuration = hadoopGraph.configuration();
- configuration.getKeys().forEachRemaining(key -> this.giraphConfiguration.set(key, configuration.getProperty(key).toString()));
- this.giraphConfiguration.setMasterComputeClass(GiraphMemory.class);
- this.giraphConfiguration.setVertexClass(GiraphVertex.class);
- this.giraphConfiguration.setComputationClass(GiraphComputation.class);
- this.giraphConfiguration.setWorkerContextClass(GiraphWorkerContext.class);
- this.giraphConfiguration.setOutEdgesClass(EmptyOutEdges.class);
- this.giraphConfiguration.setClass(GiraphConstants.VERTEX_ID_CLASS.getKey(), ObjectWritable.class, ObjectWritable.class);
- this.giraphConfiguration.setClass(GiraphConstants.VERTEX_VALUE_CLASS.getKey(), VertexWritable.class, VertexWritable.class);
- this.giraphConfiguration.setBoolean(GiraphConstants.STATIC_GRAPH.getKey(), true);
- this.giraphConfiguration.setVertexInputFormatClass(GiraphVertexInputFormat.class);
- this.giraphConfiguration.setVertexOutputFormatClass(GiraphVertexOutputFormat.class);
- this.useWorkerThreadsInConfiguration = this.giraphConfiguration.getInt(GiraphConstants.MAX_WORKERS, -666) != -666 || this.giraphConfiguration.getInt(GiraphConstants.NUM_COMPUTE_THREADS.getKey(), -666) != -666;
- }
-
- @Override
- public GraphComputer workers(final int workers) {
- this.useWorkerThreadsInConfiguration = false;
- return super.workers(workers);
- }
-
- @Override
- public GraphComputer configure(final String key, final Object value) {
- this.giraphConfiguration.set(key, value.toString());
- this.useWorkerThreadsInConfiguration = this.giraphConfiguration.getInt(GiraphConstants.MAX_WORKERS, -666) != -666 || this.giraphConfiguration.getInt(GiraphConstants.NUM_COMPUTE_THREADS.getKey(), -666) != -666;
- return this;
- }
-
- @Override
- public GraphComputer program(final VertexProgram vertexProgram) {
- super.program(vertexProgram);
- this.memory.addVertexProgramMemoryComputeKeys(this.vertexProgram);
- final BaseConfiguration apacheConfiguration = new BaseConfiguration();
- apacheConfiguration.setDelimiterParsingDisabled(true);
- vertexProgram.storeState(apacheConfiguration);
- IteratorUtils.fill(apacheConfiguration.getKeys(), this.vertexProgramConfigurationKeys);
- ConfUtil.mergeApacheIntoHadoopConfiguration(apacheConfiguration, this.giraphConfiguration);
- this.vertexProgram.getMessageCombiner().ifPresent(combiner -> this.giraphConfiguration.setMessageCombinerClass(GiraphMessageCombiner.class));
- return this;
- }
-
- @Override
- public Future<ComputerResult> submit() {
- super.validateStatePriorToExecution();
- return ComputerSubmissionHelper.runWithBackgroundThread(this::submitWithExecutor, "GiraphSubmitter");
- }
-
- private Future<ComputerResult> submitWithExecutor(final Executor exec) {
- final long startTime = System.currentTimeMillis();
- final Configuration apacheConfiguration = ConfUtil.makeApacheConfiguration(this.giraphConfiguration);
- return CompletableFuture.<ComputerResult>supplyAsync(() -> {
- try {
- this.loadJars(giraphConfiguration);
- ToolRunner.run(this, new String[]{});
- } catch (final Exception e) {
- //e.printStackTrace();
- throw new IllegalStateException(e.getMessage(), e);
- }
- this.memory.setRuntime(System.currentTimeMillis() - startTime);
- // clear properties that should not be propagated in an OLAP chain
- apacheConfiguration.clearProperty(Constants.GREMLIN_HADOOP_GRAPH_FILTER);
- apacheConfiguration.clearProperty(Constants.GREMLIN_HADOOP_VERTEX_PROGRAM_INTERCEPTOR);
- this.vertexProgramConfigurationKeys.forEach(apacheConfiguration::clearProperty); // clear out vertex program specific configurations
- return new DefaultComputerResult(InputOutputHelper.getOutputGraph(apacheConfiguration, this.resultGraph, this.persist), this.memory.asImmutable());
- }, exec);
- }
-
- @Override
- public int run(final String[] args) {
- final Storage storage = FileSystemStorage.open(this.giraphConfiguration);
- storage.rm(this.giraphConfiguration.get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION));
- this.giraphConfiguration.setBoolean(Constants.GREMLIN_HADOOP_GRAPH_WRITER_HAS_EDGES, this.persist.equals(Persist.EDGES));
- try {
- // store vertex and edge filters (will propagate down to native InputFormat or else GiraphVertexInputFormat will process)
- final BaseConfiguration apacheConfiguration = new BaseConfiguration();
- apacheConfiguration.setDelimiterParsingDisabled(true);
- GraphFilterAware.storeGraphFilter(apacheConfiguration, this.giraphConfiguration, this.graphFilter);
-
- // it is possible to run graph computer without a vertex program (and thus, only map reduce jobs if they exist)
- if (null != this.vertexProgram) {
- // a way to verify in Giraph whether the traversal will go over the wire or not
- try {
- VertexProgram.createVertexProgram(this.hadoopGraph, ConfUtil.makeApacheConfiguration(this.giraphConfiguration));
- } catch (final IllegalStateException e) {
- // NumberFormatException is likely no longer a possibility here after 3.2.9 as the internal
- // serialization format for traversals changed from a delimited list of bytes as a string to a
- // base64 encoded string. under the base64 model we shouldn't see NumberFormatException anymore
- // but i left it here for now, just in case there's something i'm not seeing. see
- // VertexProgramHelper.deserialize() for more information related to this handling
- final Throwable root = ExceptionUtils.getRootCause(e);
- if (root instanceof NumberFormatException || root instanceof IOException || root instanceof ClassNotFoundException)
- throw new NotSerializableException("The provided traversal is not serializable and thus, can not be distributed across the cluster");
- }
- // remove historic combiners in configuration propagation (this occurs when job chaining)
- if (!this.vertexProgram.getMessageCombiner().isPresent())
- this.giraphConfiguration.unset(GiraphConstants.MESSAGE_COMBINER_CLASS.getKey());
- // split required workers across system (open map slots + max threads per machine = total amount of TinkerPop workers)
- if (!this.useWorkerThreadsInConfiguration) {
- final Cluster cluster = new Cluster(GiraphGraphComputer.this.giraphConfiguration);
- int totalMappers = cluster.getClusterStatus().getMapSlotCapacity() - 1; // 1 is needed for master
- cluster.close();
- if (this.workers <= totalMappers) {
- this.giraphConfiguration.setWorkerConfiguration(this.workers, this.workers, 100.0F);
- this.giraphConfiguration.setNumComputeThreads(1);
- } else {
- if (totalMappers == 0) totalMappers = 1; // happens in local mode
- int threadsPerMapper = Long.valueOf(Math.round((double) this.workers / (double) totalMappers)).intValue(); // TODO: need to find least common denominator
- this.giraphConfiguration.setWorkerConfiguration(totalMappers, totalMappers, 100.0F);
- this.giraphConfiguration.setNumComputeThreads(threadsPerMapper);
- }
- }
- // prepare the giraph vertex-centric computing job
- final GiraphJob job = new GiraphJob(this.giraphConfiguration, Constants.GREMLIN_HADOOP_GIRAPH_JOB_PREFIX + this.vertexProgram);
- job.getInternalJob().setJarByClass(GiraphGraphComputer.class);
- this.logger.info(Constants.GREMLIN_HADOOP_GIRAPH_JOB_PREFIX + this.vertexProgram);
- // handle input paths (if any)
- String inputLocation = this.giraphConfiguration.get(Constants.GREMLIN_HADOOP_INPUT_LOCATION, null);
- if (null != inputLocation && FileInputFormat.class.isAssignableFrom(this.giraphConfiguration.getClass(Constants.GREMLIN_HADOOP_GRAPH_READER, InputFormat.class))) {
- inputLocation = Constants.getSearchGraphLocation(inputLocation, storage).orElse(this.giraphConfiguration.get(Constants.GREMLIN_HADOOP_INPUT_LOCATION));
- FileInputFormat.setInputPaths(job.getInternalJob(), new Path(inputLocation));
- }
- // handle output paths (if any)
- String outputLocation = this.giraphConfiguration.get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, null);
- if (null != outputLocation && FileOutputFormat.class.isAssignableFrom(this.giraphConfiguration.getClass(Constants.GREMLIN_HADOOP_GRAPH_WRITER, OutputFormat.class))) {
- outputLocation = Constants.getGraphLocation(this.giraphConfiguration.get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION));
- FileOutputFormat.setOutputPath(job.getInternalJob(), new Path(outputLocation));
- }
- // execute the job and wait until it completes (if it fails, throw an exception)
- if (!job.run(true))
- throw new IllegalStateException("The GiraphGraphComputer job failed -- aborting all subsequent MapReduce jobs: " + job.getInternalJob().getStatus().getFailureInfo());
- // add vertex program memory values to the return memory
- for (final MemoryComputeKey memoryComputeKey : this.vertexProgram.getMemoryComputeKeys()) {
- if (!memoryComputeKey.isTransient() && storage.exists(Constants.getMemoryLocation(this.giraphConfiguration.get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION), memoryComputeKey.getKey()))) {
- final ObjectWritableIterator iterator = new ObjectWritableIterator(this.giraphConfiguration, new Path(Constants.getMemoryLocation(this.giraphConfiguration.get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION), memoryComputeKey.getKey())));
- if (iterator.hasNext()) {
- this.memory.set(memoryComputeKey.getKey(), iterator.next().getValue());
- }
- // vertex program memory items are not stored on disk
- storage.rm(Constants.getMemoryLocation(this.giraphConfiguration.get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION), memoryComputeKey.getKey()));
- }
- }
- final Path path = new Path(Constants.getMemoryLocation(this.giraphConfiguration.get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION), Constants.HIDDEN_ITERATION));
- this.memory.setIteration((Integer) new ObjectWritableIterator(this.giraphConfiguration, path).next().getValue());
- storage.rm(Constants.getMemoryLocation(this.giraphConfiguration.get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION), Constants.HIDDEN_ITERATION));
- }
- // do map reduce jobs
- this.giraphConfiguration.setBoolean(Constants.GREMLIN_HADOOP_GRAPH_READER_HAS_EDGES, this.giraphConfiguration.getBoolean(Constants.GREMLIN_HADOOP_GRAPH_WRITER_HAS_EDGES, true));
- for (final MapReduce mapReduce : this.mapReducers) {
- this.memory.addMapReduceMemoryKey(mapReduce);
- MapReduceHelper.executeMapReduceJob(mapReduce, this.memory, this.giraphConfiguration);
- }
-
- // if no persistence, delete the graph and memory output
- if (this.persist.equals(Persist.NOTHING))
- storage.rm(this.giraphConfiguration.get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION));
- } catch (final Exception e) {
- throw new IllegalStateException(e.getMessage(), e);
- }
- return 0;
- }
-
- @Override
- public void setConf(final org.apache.hadoop.conf.Configuration configuration) {
- // TODO: is this necessary to implement?
- }
-
- @Override
- public org.apache.hadoop.conf.Configuration getConf() {
- return this.giraphConfiguration;
- }
-
- @Override
- protected void loadJar(final org.apache.hadoop.conf.Configuration hadoopConfiguration, final File file, final Object... params)
- throws IOException {
- final FileSystem defaultFileSystem = FileSystem.get(hadoopConfiguration);
- try {
- final Path jarFile = new Path(defaultFileSystem.getHomeDirectory() + "/hadoop-gremlin-" + Gremlin.version() + "-libs/" + file.getName());
- if (!defaultFileSystem.exists(jarFile)) {
- final Path sourcePath = new Path(file.getPath());
- final URI sourceUri = sourcePath.toUri();
- final FileSystem fs = FileSystem.get(sourceUri, hadoopConfiguration);
- fs.copyFromLocalFile(sourcePath, jarFile);
- }
- try {
- DistributedCache.addArchiveToClassPath(jarFile, this.giraphConfiguration, defaultFileSystem);
- } catch (final Exception e) {
- throw new RuntimeException(e.getMessage(), e);
- }
- } catch (final Exception e) {
- throw new IllegalStateException(e.getMessage(), e);
- }
- }
-
- public static void main(final String[] args) throws Exception {
- final FileConfiguration configuration = new PropertiesConfiguration(args[0]);
- new GiraphGraphComputer(HadoopGraph.open(configuration)).program(VertexProgram.createVertexProgram(HadoopGraph.open(configuration), configuration)).submit().get();
- }
-
- public Features features() {
- return new Features();
- }
-
- public class Features extends AbstractHadoopGraphComputer.Features {
-
- @Override
- public int getMaxWorkers() {
- if (GiraphGraphComputer.this.giraphConfiguration.getLocalTestMode())
- return Runtime.getRuntime().availableProcessors();
- else {
- return Integer.MAX_VALUE;
- /*try {
- final Cluster cluster = new Cluster(GiraphGraphComputer.this.giraphConfiguration);
- int maxWorkers = (cluster.getClusterStatus().getMapSlotCapacity() - 1) * 16; // max 16 threads per machine hardcoded :|
- cluster.close();
- return maxWorkers;
-
- } catch (final IOException | InterruptedException e) {
- throw new IllegalStateException(e.getMessage(), e);
- }*/
- }
- }
- }
-}
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMemory.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMemory.java
deleted file mode 100644
index 56428f3..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMemory.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.process.computer;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.giraph.master.MasterCompute;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.io.SequenceFile;
-import org.apache.tinkerpop.gremlin.hadoop.Constants;
-import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritable;
-import org.apache.tinkerpop.gremlin.hadoop.structure.util.ConfUtil;
-import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
-import org.apache.tinkerpop.gremlin.process.computer.Memory;
-import org.apache.tinkerpop.gremlin.process.computer.MemoryComputeKey;
-import org.apache.tinkerpop.gremlin.process.computer.VertexProgram;
-import org.apache.tinkerpop.gremlin.process.computer.util.MemoryHelper;
-import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.javatuples.Pair;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.function.BinaryOperator;
-import java.util.stream.Collectors;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GiraphMemory extends MasterCompute implements Memory {
-
- private VertexProgram<?> vertexProgram;
- private GiraphWorkerContext worker;
- private Map<String, MemoryComputeKey> memoryComputeKeys;
- private boolean inExecute = false;
- private long startTime = System.currentTimeMillis();
-
- public GiraphMemory() {
- // Giraph ReflectionUtils requires this to be public at minimum
- }
-
- public GiraphMemory(final GiraphWorkerContext worker, final VertexProgram<?> vertexProgram) {
- this.worker = worker;
- this.vertexProgram = vertexProgram;
- this.memoryComputeKeys = new HashMap<>();
- this.vertexProgram.getMemoryComputeKeys().forEach(key -> this.memoryComputeKeys.put(key.getKey(), key));
- this.inExecute = true;
- }
-
-
- @Override
- public void initialize() {
- // do not initialize aggregators here because the getConf() configuration is not available at this point
- // use compute() initial iteration instead
- }
-
- @Override
- public void compute() {
- this.inExecute = false;
- if (0 == this.getSuperstep()) { // setup
- final Configuration apacheConfiguration = ConfUtil.makeApacheConfiguration(this.getConf());
- this.vertexProgram = VertexProgram.createVertexProgram(HadoopGraph.open(apacheConfiguration), apacheConfiguration);
- this.memoryComputeKeys = new HashMap<>();
- this.vertexProgram.getMemoryComputeKeys().forEach(key -> this.memoryComputeKeys.put(key.getKey(), key));
- try {
- for (final MemoryComputeKey key : this.memoryComputeKeys.values()) {
- this.registerPersistentAggregator(key.getKey(), MemoryAggregator.class);
- }
- } catch (final Exception e) {
- throw new IllegalStateException(e.getMessage(), e);
- }
- this.vertexProgram.setup(this);
- } else {
- // a hack to get the last iteration memory values to stick
- final PassThroughMemory memory = new PassThroughMemory(this);
- if (this.vertexProgram.terminate(memory)) { // terminate
- final String outputLocation = this.getConf().get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, null);
- if (null != outputLocation) {
- try {
- for (final String key : this.keys()) {
- if (!this.memoryComputeKeys.get(key).isTransient()) { // do not write transient memory keys to disk
- final SequenceFile.Writer writer = SequenceFile.createWriter(FileSystem.get(this.getConf()), this.getConf(), new Path(outputLocation + "/" + key), ObjectWritable.class, ObjectWritable.class);
- writer.append(ObjectWritable.getNullObjectWritable(), new ObjectWritable<>(memory.get(key)));
- writer.close();
- }
- }
- // written for GiraphGraphComputer to read and then is deleted by GiraphGraphComputer
- final SequenceFile.Writer writer = SequenceFile.createWriter(FileSystem.get(this.getConf()), this.getConf(), new Path(outputLocation + "/" + Constants.HIDDEN_ITERATION), ObjectWritable.class, ObjectWritable.class);
- writer.append(ObjectWritable.getNullObjectWritable(), new ObjectWritable<>(memory.getIteration()));
- writer.close();
- } catch (final Exception e) {
- throw new IllegalStateException(e.getMessage(), e);
- }
- }
- this.haltComputation();
- }
- }
- }
-
- @Override
- public int getIteration() {
- if (this.inExecute) {
- return (int) this.worker.getSuperstep();
- } else {
- final int temp = (int) this.getSuperstep();
- return temp == 0 ? temp : temp - 1;
- }
- }
-
- @Override
- public long getRuntime() {
- return System.currentTimeMillis() - this.startTime;
- }
-
- @Override
- public Set<String> keys() {
- return this.memoryComputeKeys.values().stream().filter(key -> this.exists(key.getKey())).map(MemoryComputeKey::getKey).collect(Collectors.toSet());
- }
-
- @Override
- public boolean exists(final String key) {
- if (this.inExecute && this.memoryComputeKeys.containsKey(key) && !this.memoryComputeKeys.get(key).isBroadcast())
- return false;
- final ObjectWritable value = this.inExecute ? this.worker.getAggregatedValue(key) : this.getAggregatedValue(key);
- return null != value && !value.isEmpty();
- }
-
- @Override
- public <R> R get(final String key) throws IllegalArgumentException {
- if (!this.memoryComputeKeys.containsKey(key))
- throw Memory.Exceptions.memoryDoesNotExist(key);
- if (this.inExecute && !this.memoryComputeKeys.get(key).isBroadcast())
- throw Memory.Exceptions.memoryDoesNotExist(key);
- final ObjectWritable<Pair<BinaryOperator, Object>> value = this.inExecute ?
- this.worker.<ObjectWritable<Pair<BinaryOperator, Object>>>getAggregatedValue(key) :
- this.<ObjectWritable<Pair<BinaryOperator, Object>>>getAggregatedValue(key);
- if (null == value || value.isEmpty())
- throw Memory.Exceptions.memoryDoesNotExist(key);
- else
- return (R) value.get().getValue1();
- }
-
- @Override
- public void set(final String key, final Object value) {
- this.checkKeyValue(key, value);
- if (this.inExecute)
- throw Memory.Exceptions.memorySetOnlyDuringVertexProgramSetUpAndTerminate(key);
- this.setAggregatedValue(key, new ObjectWritable<>(new Pair<>(this.memoryComputeKeys.get(key).getReducer(), value)));
- }
-
- @Override
- public void add(final String key, final Object value) {
- this.checkKeyValue(key, value);
- if (!this.inExecute)
- throw Memory.Exceptions.memoryAddOnlyDuringVertexProgramExecute(key);
- this.worker.aggregate(key, new ObjectWritable<>(new Pair<>(this.memoryComputeKeys.get(key).getReducer(), value)));
- }
-
- @Override
- public void write(final DataOutput output) {
- // all aggregator data is propagated through writables
- }
-
- @Override
- public void readFields(final DataInput input) {
- // all aggregator data is propagated through writables
- }
-
- @Override
- public String toString() {
- return StringFactory.memoryString(this);
- }
-
- private void checkKeyValue(final String key, final Object value) {
- if (!this.memoryComputeKeys.containsKey(key))
- throw GraphComputer.Exceptions.providedKeyIsNotAMemoryComputeKey(key);
- MemoryHelper.validateValue(value);
- }
-}
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMessageCombiner.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMessageCombiner.java
deleted file mode 100644
index 4d725b2..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMessageCombiner.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.process.computer;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.giraph.conf.ImmutableClassesGiraphConfigurable;
-import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
-import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritable;
-import org.apache.tinkerpop.gremlin.hadoop.structure.util.ConfUtil;
-import org.apache.tinkerpop.gremlin.process.computer.MessageCombiner;
-import org.apache.tinkerpop.gremlin.process.computer.VertexProgram;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GiraphMessageCombiner extends org.apache.giraph.combiner.MessageCombiner<ObjectWritable, ObjectWritable> implements ImmutableClassesGiraphConfigurable {
-
- private MessageCombiner messageCombiner;
- private ImmutableClassesGiraphConfiguration configuration;
-
- @Override
- public void combine(final ObjectWritable vertexIndex, final ObjectWritable originalMessage, final ObjectWritable messageToCombine) {
- originalMessage.set(originalMessage.isEmpty() ?
- messageToCombine.get() :
- this.messageCombiner.combine(originalMessage.get(), messageToCombine.get()));
- }
-
- @Override
- public ObjectWritable createInitialMessage() {
- return ObjectWritable.empty();
- }
-
- @Override
- public void setConf(final ImmutableClassesGiraphConfiguration configuration) {
- this.configuration = configuration;
- final Configuration apacheConfiguration = ConfUtil.makeApacheConfiguration(configuration);
- this.messageCombiner = (MessageCombiner) VertexProgram.createVertexProgram(HadoopGraph.open(apacheConfiguration), apacheConfiguration).getMessageCombiner().get();
- }
-
- @Override
- public ImmutableClassesGiraphConfiguration getConf() {
- return this.configuration;
- }
-}
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMessenger.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMessenger.java
deleted file mode 100644
index 36e641e..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMessenger.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.process.computer;
-
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritable;
-import org.apache.tinkerpop.gremlin.process.computer.MessageScope;
-import org.apache.tinkerpop.gremlin.process.computer.Messenger;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep;
-import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
-import org.apache.tinkerpop.gremlin.structure.Direction;
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-
-import java.util.Iterator;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GiraphMessenger<M> implements Messenger<M> {
-
- private GiraphVertex giraphVertex;
- private GiraphComputation giraphComputation;
- private Iterator<ObjectWritable<M>> messages;
-
- public GiraphMessenger(final GiraphVertex giraphVertex, final GiraphComputation giraphComputation, final Iterator<ObjectWritable<M>> messages) {
- this.giraphVertex = giraphVertex;
- this.giraphComputation = giraphComputation;
- this.messages = messages;
- }
-
- @Override
- public Iterator<M> receiveMessages() {
- return IteratorUtils.map(this.messages, ObjectWritable::get);
- }
-
- @Override
- public void sendMessage(final MessageScope messageScope, final M message) {
- if (messageScope instanceof MessageScope.Local) {
- final MessageScope.Local<M> localMessageScope = (MessageScope.Local) messageScope;
- final Traversal.Admin<Vertex, Edge> incidentTraversal = GiraphMessenger.setVertexStart(localMessageScope.getIncidentTraversal().get().asAdmin(), this.giraphVertex.getValue().get());
- final Direction direction = GiraphMessenger.getOppositeDirection(incidentTraversal);
-
- // handle processing for BOTH given TINKERPOP-1862 where the target of the message is the one opposite
- // the current vertex
- incidentTraversal.forEachRemaining(edge -> {
- if (direction.equals(Direction.IN) || direction.equals(Direction.OUT))
- this.giraphComputation.sendMessage(
- new ObjectWritable<>(edge.vertices(direction).next().id()),
- new ObjectWritable<>(localMessageScope.getEdgeFunction().apply(message, edge)));
- else
- this.giraphComputation.sendMessage(
- new ObjectWritable<>(edge instanceof StarGraph.StarOutEdge ? edge.inVertex().id() : edge.outVertex().id()),
- new ObjectWritable<>(localMessageScope.getEdgeFunction().apply(message, edge)));
- });
- } else {
- final MessageScope.Global globalMessageScope = (MessageScope.Global) messageScope;
- globalMessageScope.vertices().forEach(vertex ->
- this.giraphComputation.sendMessage(new ObjectWritable<>(vertex.id()), new ObjectWritable<>(message)));
- }
- }
-
- private static <T extends Traversal.Admin<Vertex, Edge>> T setVertexStart(final Traversal.Admin<Vertex, Edge> incidentTraversal, final Vertex vertex) {
- incidentTraversal.asAdmin().addStart(incidentTraversal.getTraverserGenerator().generate(vertex, incidentTraversal.getStartStep(), 1l));
- return (T) incidentTraversal;
- }
-
- private static Direction getOppositeDirection(final Traversal.Admin<Vertex, Edge> incidentTraversal) {
- final VertexStep step = TraversalHelper.getLastStepOfAssignableClass(VertexStep.class, incidentTraversal).get();
- return step.getDirection().opposite();
- }
-}
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphVertex.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphVertex.java
deleted file mode 100644
index 3a95fae..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphVertex.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.process.computer;
-
-import org.apache.giraph.graph.DefaultVertex;
-import org.apache.hadoop.io.NullWritable;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritable;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GiraphVertex extends DefaultVertex<ObjectWritable, VertexWritable, NullWritable> {
-
- public GiraphVertex() {
- }
-
- public GiraphVertex(final VertexWritable vertexWritable) {
- final VertexWritable newWritable = new VertexWritable();
- newWritable.set(vertexWritable.get());
- this.initialize(new ObjectWritable<>(newWritable.get().id()), newWritable, EmptyOutEdges.instance());
- }
-}
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphWorkerContext.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphWorkerContext.java
deleted file mode 100644
index 0122ab4..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphWorkerContext.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.process.computer;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.giraph.conf.GiraphConstants;
-import org.apache.giraph.worker.WorkerContext;
-import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.HadoopPools;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritable;
-import org.apache.tinkerpop.gremlin.hadoop.structure.util.ConfUtil;
-import org.apache.tinkerpop.gremlin.process.computer.VertexProgram;
-import org.apache.tinkerpop.gremlin.process.computer.util.ImmutableMemory;
-import org.apache.tinkerpop.gremlin.process.computer.util.VertexProgramPool;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShimServiceLoader;
-
-import java.util.Iterator;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GiraphWorkerContext extends WorkerContext {
-
- private VertexProgramPool vertexProgramPool;
- private GiraphMemory memory;
-
- public GiraphWorkerContext() {
- // Giraph ReflectionUtils requires this to be public at minimum
- }
-
- public void preApplication() throws InstantiationException, IllegalAccessException {
- final Configuration apacheConfiguration = ConfUtil.makeApacheConfiguration(this.getContext().getConfiguration());
- KryoShimServiceLoader.applyConfiguration(apacheConfiguration);
- final VertexProgram vertexProgram = VertexProgram.createVertexProgram(HadoopGraph.open(apacheConfiguration), apacheConfiguration);
- this.vertexProgramPool = new VertexProgramPool(vertexProgram, this.getContext().getConfiguration().getInt(GiraphConstants.NUM_COMPUTE_THREADS.getKey(), 1));
- this.memory = new GiraphMemory(this, vertexProgram);
- }
-
- public void postApplication() {
-
- }
-
- public void preSuperstep() {
- this.vertexProgramPool.workerIterationStart(new ImmutableMemory(this.memory));
- }
-
- public void postSuperstep() {
- this.vertexProgramPool.workerIterationEnd(new ImmutableMemory(this.memory));
- }
-
- public VertexProgramPool getVertexProgramPool() {
- return this.vertexProgramPool;
- }
-
- public GiraphMemory getMemory() {
- return this.memory;
- }
-
- public GiraphMessenger getMessenger(final GiraphVertex giraphVertex, final GiraphComputation giraphComputation, final Iterator<ObjectWritable> messages) {
- return new GiraphMessenger(giraphVertex, giraphComputation, messages);
- }
-}
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/MemoryAggregator.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/MemoryAggregator.java
deleted file mode 100644
index 4929546..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/MemoryAggregator.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.process.computer;
-
-import org.apache.giraph.aggregators.Aggregator;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritable;
-import org.javatuples.Pair;
-
-import java.util.function.BinaryOperator;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class MemoryAggregator implements Aggregator<ObjectWritable<Pair<BinaryOperator, Object>>> {
-
- private ObjectWritable<Pair<BinaryOperator, Object>> currentObject = ObjectWritable.<Pair<BinaryOperator, Object>>empty();
-
- public MemoryAggregator() { // for Giraph serialization
-
- }
-
- @Override
- public ObjectWritable<Pair<BinaryOperator, Object>> getAggregatedValue() {
- return this.currentObject;
- }
-
- @Override
- public void setAggregatedValue(final ObjectWritable<Pair<BinaryOperator, Object>> object) {
- if (null != object)
- this.currentObject = object;
- }
-
- @Override
- public void aggregate(final ObjectWritable<Pair<BinaryOperator, Object>> object) {
- if (null == object)
- return;
- else if (this.currentObject.isEmpty())
- this.currentObject = object;
- else if (!object.isEmpty())
- this.currentObject.set(new Pair<>(object.get().getValue0(), object.get().getValue0().apply(this.currentObject.get().getValue1(), object.get().getValue1())));
- }
-
- @Override
- public void reset() {
- this.currentObject = ObjectWritable.<Pair<BinaryOperator, Object>>empty();
- }
-
- @Override
- public ObjectWritable<Pair<BinaryOperator, Object>> createInitialValue() {
- return ObjectWritable.<Pair<BinaryOperator, Object>>empty();
- }
-}
\ No newline at end of file
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/PassThroughMemory.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/PassThroughMemory.java
deleted file mode 100644
index dc40e7b..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/PassThroughMemory.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tinkerpop.gremlin.giraph.process.computer;
-
-import org.apache.tinkerpop.gremlin.process.computer.Memory;
-import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class PassThroughMemory implements Memory.Admin {
-
- private final GiraphMemory giraphMemory;
- private long runtime = 0l;
- private int iteration = -1;
- private final Map<String, Object> memoryMap = new HashMap<>();
-
- public PassThroughMemory(final GiraphMemory giraphMemory) {
- this.giraphMemory = giraphMemory;
- giraphMemory.keys().forEach(key -> this.memoryMap.put(key, giraphMemory.get(key)));
- this.iteration = giraphMemory.getIteration();
- }
-
- @Override
- public Set<String> keys() {
- return this.memoryMap.keySet();
- }
-
- @Override
- public <R> R get(final String key) throws IllegalArgumentException {
- final R r = (R) this.memoryMap.get(key);
- if (null == r)
- throw Memory.Exceptions.memoryDoesNotExist(key);
- else
- return r;
- }
-
- @Override
- public void set(final String key, Object value) {
- this.memoryMap.put(key, value);
- this.giraphMemory.set(key, value);
- }
-
- @Override
- public int getIteration() {
- return this.iteration;
- }
-
- @Override
- public long getRuntime() {
- return this.runtime;
- }
-
- @Override
- public void add(final String key, final Object value) {
- this.giraphMemory.add(key, value);
- }
-
- @Override
- public String toString() {
- return StringFactory.memoryString(this);
- }
-
- @Override
- public void incrIteration() {
- this.iteration = this.iteration + 1;
- }
-
- @Override
- public void setIteration(final int iteration) {
- this.iteration = iteration;
- }
-
- @Override
- public void setRuntime(long runtime) {
- this.runtime = runtime;
- }
-}
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphVertexInputFormat.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphVertexInputFormat.java
deleted file mode 100644
index 5900663..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphVertexInputFormat.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.structure.io;
-
-import org.apache.giraph.io.VertexInputFormat;
-import org.apache.giraph.io.VertexReader;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.tinkerpop.gremlin.hadoop.process.computer.GraphFilterInputFormat;
-
-import java.io.IOException;
-import java.util.List;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GiraphVertexInputFormat extends VertexInputFormat {
-
- @Override
- public void checkInputSpecs(final Configuration configuration) {
-
- }
-
- @Override
- public List<InputSplit> getSplits(final JobContext context, final int minSplitCountHint) throws IOException, InterruptedException {
- return new GraphFilterInputFormat().getSplits(context);
- }
-
- @Override
- public VertexReader createVertexReader(final InputSplit split, final TaskAttemptContext context) throws IOException {
- try {
- final GiraphVertexReader reader = new GiraphVertexReader();
- reader.initialize(split, context);
- return reader;
- } catch (final InterruptedException e) {
- throw new IOException(e.getMessage(), e);
- }
- }
-
-}
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphVertexOutputFormat.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphVertexOutputFormat.java
deleted file mode 100644
index 9881c77..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphVertexOutputFormat.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.structure.io;
-
-import org.apache.giraph.io.VertexOutputFormat;
-import org.apache.giraph.io.VertexWriter;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.OutputCommitter;
-import org.apache.hadoop.mapreduce.OutputFormat;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.hadoop.util.ReflectionUtils;
-import org.apache.tinkerpop.gremlin.hadoop.Constants;
-
-import java.io.IOException;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GiraphVertexOutputFormat extends VertexOutputFormat {
-
- @Override
- public VertexWriter createVertexWriter(final TaskAttemptContext context) throws IOException, InterruptedException {
- return new GiraphVertexWriter();
- }
-
- @Override
- public void checkOutputSpecs(final JobContext context) throws IOException, InterruptedException {
- final Configuration configuration = context.getConfiguration();
- ReflectionUtils.newInstance(configuration.getClass(Constants.GREMLIN_HADOOP_GRAPH_WRITER, OutputFormat.class, OutputFormat.class), configuration).checkOutputSpecs(context);
- }
-
- @Override
- public OutputCommitter getOutputCommitter(final TaskAttemptContext context) throws IOException, InterruptedException {
- final Configuration configuration = context.getConfiguration();
- return ReflectionUtils.newInstance(configuration.getClass(Constants.GREMLIN_HADOOP_GRAPH_WRITER, OutputFormat.class, OutputFormat.class), configuration).getOutputCommitter(context);
- }
-
-}
\ No newline at end of file
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphVertexReader.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphVertexReader.java
deleted file mode 100644
index 5335980..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphVertexReader.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.structure.io;
-
-import org.apache.giraph.graph.Vertex;
-import org.apache.giraph.io.VertexReader;
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.RecordReader;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphVertex;
-import org.apache.tinkerpop.gremlin.hadoop.process.computer.GraphFilterRecordReader;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
-
-import java.io.IOException;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GiraphVertexReader extends VertexReader {
-
- private RecordReader<NullWritable, VertexWritable> recordReader;
-
- public GiraphVertexReader() {
- this.recordReader = new GraphFilterRecordReader();
- }
-
- @Override
- public void initialize(final InputSplit inputSplit, final TaskAttemptContext context) throws IOException, InterruptedException {
- this.recordReader.initialize(inputSplit, context);
- }
-
- @Override
- public boolean nextVertex() throws IOException, InterruptedException {
- return this.recordReader.nextKeyValue();
- }
-
- @Override
- public Vertex getCurrentVertex() throws IOException, InterruptedException {
- return new GiraphVertex(this.recordReader.getCurrentValue());
- }
-
- @Override
- public void close() throws IOException {
- this.recordReader.close();
- }
-
- @Override
- public float getProgress() throws IOException, InterruptedException {
- return this.recordReader.getProgress();
- }
-}
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphVertexWriter.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphVertexWriter.java
deleted file mode 100644
index 3c94137..0000000
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphVertexWriter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.structure.io;
-
-import org.apache.giraph.graph.Vertex;
-import org.apache.giraph.io.VertexWriter;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.mapreduce.OutputFormat;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.hadoop.util.ReflectionUtils;
-import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphVertex;
-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.process.computer.VertexComputeKey;
-import org.apache.tinkerpop.gremlin.process.computer.VertexProgram;
-import org.apache.tinkerpop.gremlin.process.computer.util.VertexProgramHelper;
-import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
-
-import java.io.IOException;
-import java.util.stream.Collectors;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GiraphVertexWriter extends VertexWriter {
- private RecordWriter<NullWritable, VertexWritable> recordWriter;
- private String[] transientComputeKeys;
-
- public GiraphVertexWriter() {
-
- }
-
- @Override
- public void initialize(final TaskAttemptContext context) throws IOException, InterruptedException {
- final Configuration configuration = context.getConfiguration();
- this.recordWriter = ReflectionUtils.newInstance(configuration.getClass(Constants.GREMLIN_HADOOP_GRAPH_WRITER, OutputFormat.class, OutputFormat.class), configuration).getRecordWriter(context);
- this.transientComputeKeys = VertexProgramHelper.vertexComputeKeysAsArray(((VertexProgram<?>) VertexProgram.createVertexProgram(EmptyGraph.instance(), ConfUtil.makeApacheConfiguration(configuration))).getVertexComputeKeys().stream().
- filter(VertexComputeKey::isTransient).
- collect(Collectors.toSet()));
- }
-
- @Override
- public void close(final TaskAttemptContext context) throws IOException, InterruptedException {
- this.recordWriter.close(context);
- }
-
- @Override
- public void writeVertex(final Vertex vertex) throws IOException, InterruptedException {
- ((GiraphVertex) vertex).getValue().get().dropVertexProperties(this.transientComputeKeys); // remove all transient compute keys before writing to OutputFormat
- this.recordWriter.write(NullWritable.get(), ((GiraphVertex) vertex).getValue());
- }
-}
diff --git a/giraph-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin b/giraph-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
deleted file mode 100644
index 9a92905..0000000
--- a/giraph-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.tinkerpop.gremlin.giraph.jsr223.GiraphGremlinPlugin
\ No newline at end of file
diff --git a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinIntegrateTest.java b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinIntegrateTest.java
deleted file mode 100644
index 955649c..0000000
--- a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinIntegrateTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tinkerpop.gremlin.giraph;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphHadoopGraphProvider;
-import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
-import org.junit.runner.RunWith;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@RunWith(GiraphGremlinSuite.class)
-@GraphProviderClass(provider = GiraphHadoopGraphProvider.class, graph = HadoopGraph.class)
-public class GiraphGremlinIntegrateTest {
-}
\ No newline at end of file
diff --git a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinSuite.java b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinSuite.java
deleted file mode 100644
index 2fe0e4f..0000000
--- a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinSuite.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tinkerpop.gremlin.giraph;
-
-import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
-import org.apache.tinkerpop.gremlin.giraph.structure.io.GiraphIoRegistryCheck;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
-import org.junit.runners.model.InitializationError;
-import org.junit.runners.model.RunnerBuilder;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GiraphGremlinSuite extends AbstractGremlinSuite {
- public GiraphGremlinSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
- super(klass, builder, new Class<?>[]{GiraphIoRegistryCheck.class}, new Class<?>[]{GiraphIoRegistryCheck.class}, true, TraversalEngine.Type.COMPUTER);
- }
-}
diff --git a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphHadoopGremlinIntegrateTest.java b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphHadoopGremlinIntegrateTest.java
deleted file mode 100644
index ba9e12d..0000000
--- a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphHadoopGremlinIntegrateTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphHadoopGraphProvider;
-import org.apache.tinkerpop.gremlin.hadoop.HadoopGremlinSuite;
-import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
-import org.junit.runner.RunWith;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@RunWith(HadoopGremlinSuite.class)
-@GraphProviderClass(provider = GiraphHadoopGraphProvider.class, graph = HadoopGraph.class)
-public class GiraphHadoopGremlinIntegrateTest {
-}
diff --git a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphGraphComputerProcessIntegrateTest.java b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphGraphComputerProcessIntegrateTest.java
deleted file mode 100644
index b6da750..0000000
--- a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphGraphComputerProcessIntegrateTest.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.process.computer;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
-import org.apache.tinkerpop.gremlin.process.ProcessComputerSuite;
-import org.junit.runner.RunWith;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@RunWith(ProcessComputerSuite.class)
-@GraphProviderClass(provider = GiraphHadoopGraphProvider.class, graph = HadoopGraph.class)
-public class GiraphGraphComputerProcessIntegrateTest {
-}
diff --git a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphHadoopGraphProvider.java b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphHadoopGraphProvider.java
deleted file mode 100644
index 8eae4f1..0000000
--- a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphHadoopGraphProvider.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.giraph.process.computer;
-
-import org.apache.giraph.conf.GiraphConstants;
-import org.apache.tinkerpop.gremlin.GraphProvider;
-import org.apache.tinkerpop.gremlin.LoadGraphWith;
-import org.apache.tinkerpop.gremlin.hadoop.HadoopGraphProvider;
-import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@GraphProvider.Descriptor(computer = GiraphGraphComputer.class)
-public final class GiraphHadoopGraphProvider extends HadoopGraphProvider {
-
- @Override
- public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, final LoadGraphWith.GraphData loadGraphWith) {
- final Map<String, Object> config = super.getBaseConfiguration(graphName, test, testMethodName, loadGraphWith);
- config.put("mapreduce.job.reduces", 2);
- /// giraph configuration
- config.put(GiraphConstants.LOCAL_TEST_MODE.getKey(), true); // local testing can only spawn one worker
- config.put(GiraphConstants.MIN_WORKERS, 1);
- config.put(GiraphConstants.MAX_WORKERS, 1);
- config.put(GiraphConstants.SPLIT_MASTER_WORKER.getKey(), false);
- config.put(GiraphConstants.ZOOKEEPER_IS_EXTERNAL.getKey(), false);
- config.put(GiraphConstants.NETTY_SERVER_USE_EXECUTION_HANDLER.getKey(), false); // this prevents so many integration tests running out of threads
- config.put(GiraphConstants.NETTY_CLIENT_USE_EXECUTION_HANDLER.getKey(), false); // this prevents so many integration tests running out of threads
- config.put(GiraphConstants.NETTY_USE_DIRECT_MEMORY.getKey(), true);
- config.put(GiraphConstants.NUM_INPUT_THREADS.getKey(), 2);
- config.put(GiraphConstants.NUM_COMPUTE_THREADS.getKey(), 2);
- config.put(GiraphConstants.MAX_MASTER_SUPERSTEP_WAIT_MSECS.getKey(), TimeUnit.MINUTES.toMillis(60L));
- config.put(GiraphConstants.VERTEX_OUTPUT_FORMAT_THREAD_SAFE.getKey(), false);
- config.put(GiraphConstants.NUM_OUTPUT_THREADS.getKey(), 1);
- return config;
- }
-
- @Override
- public GraphTraversalSource traversal(final Graph graph) {
- return graph.traversal().withComputer(GiraphGraphComputer.class);
- }
-
- @Override
- public GraphComputer getGraphComputer(final Graph graph) {
- return graph.compute(GiraphGraphComputer.class);
- }
-}
diff --git a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphIoRegistryCheck.java b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphIoRegistryCheck.java
deleted file mode 100644
index 0a9dc81..0000000
--- a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphIoRegistryCheck.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tinkerpop.gremlin.giraph.structure.io;
-
-import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphGraphComputer;
-import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.AbstractIoRegistryCheck;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.HadoopPools;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShimServiceLoader;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public class GiraphIoRegistryCheck extends AbstractIoRegistryCheck {
-
- @Before
- public void setup() throws Exception {
- super.setup();
- KryoShimServiceLoader.close();
- HadoopPools.close();
- }
-
- @After
- public void tearDown() throws Exception {
- super.tearDown();
- KryoShimServiceLoader.close();
- HadoopPools.close();
- }
-
- @Test
- public void shouldSupportGryoV1d0IoRegistry() throws Exception {
- super.checkGryoV1d0IoRegistryCompliance((HadoopGraph) graph, GiraphGraphComputer.class);
- }
-
- @Test
- public void shouldSupportGryoV3d0IoRegistry() throws Exception {
- super.checkGryoV3d0IoRegistryCompliance((HadoopGraph) graph, GiraphGraphComputer.class);
- }
-
- @Test
- public void shouldSupportGraphSONIoRegistry() throws Exception {
- super.checkGraphSONIoRegistryCompliance((HadoopGraph) graph, GiraphGraphComputer.class);
- }
-}
diff --git a/giraph-gremlin/src/test/resources/giraph-site.xml b/giraph-gremlin/src/test/resources/giraph-site.xml
deleted file mode 100644
index 9862296..0000000
--- a/giraph-gremlin/src/test/resources/giraph-site.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
-<configuration>
- <property>
- <name>giraph.zkServerlistPollMsecs</name>
- <value>500</value>
- </property>
- <property>
- <name>giraph.logLevel</name>
- <value>info</value>
- </property>
-</configuration>
diff --git a/giraph-gremlin/src/test/resources/log4j-silent.properties b/giraph-gremlin/src/test/resources/log4j-silent.properties
deleted file mode 100644
index 1825bb0..0000000
--- a/giraph-gremlin/src/test/resources/log4j-silent.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# this file should always have logging set to OFF. it seems, however, that an appender of some sort is
-# required or else some logs throw error and use other log4j.properties files on the path.
-log4j.rootLogger=OFF, stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
\ No newline at end of file
diff --git a/giraph-gremlin/src/test/resources/log4j-test.properties b/giraph-gremlin/src/test/resources/log4j-test.properties
deleted file mode 100644
index a3e679c..0000000
--- a/giraph-gremlin/src/test/resources/log4j-test.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-log4j.rootLogger=WARN, stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
-
-log4j.logger.org.apache.hadoop=ERROR
\ No newline at end of file
diff --git a/gremlin-archetype/gremlin-archetype-dsl/pom.xml b/gremlin-archetype/gremlin-archetype-dsl/pom.xml
index 535bd43..99994e6 100644
--- a/gremlin-archetype/gremlin-archetype-dsl/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-dsl/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-archetype</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-archetype-dsl</artifactId>
diff --git a/gremlin-archetype/gremlin-archetype-server/pom.xml b/gremlin-archetype/gremlin-archetype-server/pom.xml
index e237da7..7addc03 100644
--- a/gremlin-archetype/gremlin-archetype-server/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-server/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-archetype</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-archetype-server</artifactId>
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
index f5613ef..fb5e140 100644
--- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
@@ -20,7 +20,6 @@
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
graphs: {
graph: conf/tinkergraph-empty.properties}
scriptEngines: {
diff --git a/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml b/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
index 70391f6..dc2c591 100644
--- a/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-archetype</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-archetype-tinkergraph</artifactId>
diff --git a/gremlin-archetype/pom.xml b/gremlin-archetype/pom.xml
index 93bb813..137808f 100644
--- a/gremlin-archetype/pom.xml
+++ b/gremlin-archetype/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>tinkerpop</artifactId>
<groupId>org.apache.tinkerpop</groupId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-archetype</artifactId>
diff --git a/gremlin-console/bin/gremlin.sh b/gremlin-console/bin/gremlin.sh
index ec5a25b..197a398 120000
--- a/gremlin-console/bin/gremlin.sh
+++ b/gremlin-console/bin/gremlin.sh
@@ -1 +1 @@
-../target/apache-tinkerpop-gremlin-console-3.3.4-SNAPSHOT-standalone/bin/gremlin.sh
\ No newline at end of file
+../target/apache-tinkerpop-gremlin-console-3.4.0-SNAPSHOT-standalone/bin/gremlin.sh
\ No newline at end of file
diff --git a/gremlin-console/pom.xml b/gremlin-console/pom.xml
index d9fc35f..3b650ee 100644
--- a/gremlin-console/pom.xml
+++ b/gremlin-console/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>tinkerpop</artifactId>
<groupId>org.apache.tinkerpop</groupId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-console</artifactId>
<name>Apache TinkerPop :: Gremlin Console</name>
diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml
index db723f4..fb4d2ee 100644
--- a/gremlin-core/pom.xml
+++ b/gremlin-core/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-core</artifactId>
<name>Apache TinkerPop :: Gremlin Core</name>
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java
index 8839dcd..558d6ca 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java
@@ -48,6 +48,8 @@
import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgram;
import org.apache.tinkerpop.gremlin.process.computer.traversal.MemoryTraversalSideEffects;
import org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram;
+import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.PageRank;
+import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.PeerPressure;
import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy;
import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.optimization.GraphFilterStrategy;
import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
@@ -257,7 +259,9 @@
CLASS_IMPORTS.add(ClusterCountMapReduce.class);
CLASS_IMPORTS.add(ClusterPopulationMapReduce.class);
CLASS_IMPORTS.add(MemoryTraversalSideEffects.class);
+ CLASS_IMPORTS.add(PeerPressure.class);
CLASS_IMPORTS.add(PeerPressureVertexProgram.class);
+ CLASS_IMPORTS.add(PageRank.class);
CLASS_IMPORTS.add(PageRankMapReduce.class);
CLASS_IMPORTS.add(PageRankVertexProgram.class);
CLASS_IMPORTS.add(GraphFilterStrategy.class);
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/GremlinPlugin.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/GremlinPlugin.java
index 99e6bd9..8f0ce9d 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/GremlinPlugin.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/GremlinPlugin.java
@@ -30,8 +30,8 @@
/**
* The name of the module. This name should be unique (use a namespaced approach) as naming clashes will
* prevent proper module operations. Modules developed by TinkerPop will be prefixed with "tinkerpop."
- * For example, TinkerPop's implementation of Giraph would be named "tinkerpop.giraph". If Facebook were
- * to do their own implementation the implementation might be called "facebook.giraph".
+ * For example, TinkerPop's implementation of Spark would be named "tinkerpop.spark". If Facebook were
+ * to do their own implementation the implementation might be called "facebook.spark".
*/
public String getName();
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
index 508af3e..c637880 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
@@ -460,12 +460,6 @@
}
@Override
- public void vertexPropertyChanged(final Vertex element, final Property oldValue, final Object setValue,
- final Object... vertexPropertyKeyValues) {
- // do nothing - deprecated
- }
-
- @Override
public void vertexPropertyRemoved(final VertexProperty vertexProperty) {
this.counter++;
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/ComputerResultStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/ComputerResultStep.java
index b5fd8e8..95e572d 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/ComputerResultStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/ComputerResultStep.java
@@ -66,7 +66,9 @@
return this.currentIterator.next();
else {
final ComputerResult result = this.starts.next().get();
- this.currentIterator = attach(result.memory().<TraverserSet<S>>get(TraversalVertexProgram.HALTED_TRAVERSERS).iterator(), result.graph());
+ this.currentIterator = attach(result.memory().exists(TraversalVertexProgram.HALTED_TRAVERSERS)
+ ? result.memory().<TraverserSet<S>>get(TraversalVertexProgram.HALTED_TRAVERSERS).iterator()
+ : EmptyIterator.instance(), result.graph());
}
}
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRank.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRank.java
new file mode 100644
index 0000000..5f9a956
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRank.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.process.computer.traversal.step.map;
+
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+
+/**
+ * Configuration options to be passed to the {@link GraphTraversal#with(String, Object)} step on
+ * {@link GraphTraversal#pageRank()}.
+ */
+public final class PageRank {
+ /**
+ * Configures number of iterations that the algorithm should run.
+ */
+ public static final String times = Graph.Hidden.hide("tinkerpop.pageRank.times");
+
+ /**
+ * Configures the edge to traverse when calculating the pagerank.
+ */
+ public static final String edges = Graph.Hidden.hide("tinkerpop.pageRank.edges");
+
+ /**
+ * Configures the name of the property within which to store the pagerank value.
+ */
+ public static final String propertyName = Graph.Hidden.hide("tinkerpop.pageRank.propertyName");
+}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java
index 2f67aeb..277b4c6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java
@@ -23,12 +23,14 @@
import org.apache.tinkerpop.gremlin.process.computer.Memory;
import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgram;
import org.apache.tinkerpop.gremlin.process.computer.traversal.lambda.HaltedTraversersCountTraversal;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Configuring;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.process.traversal.step.ByModulating;
import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating;
import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
import org.apache.tinkerpop.gremlin.process.traversal.util.PureTraversal;
import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -42,9 +44,12 @@
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
*/
-public final class PageRankVertexProgramStep extends VertexProgramStep implements TraversalParent, ByModulating, TimesModulating {
+public final class PageRankVertexProgramStep extends VertexProgramStep
+ implements TraversalParent, ByModulating, TimesModulating, Configuring {
+ private Parameters parameters = new Parameters();
private PureTraversal<Vertex, Edge> edgeTraversal;
private String pageRankProperty = PageRankVertexProgram.PAGE_RANK;
private int times = 20;
@@ -53,23 +58,59 @@
public PageRankVertexProgramStep(final Traversal.Admin traversal, final double alpha) {
super(traversal);
this.alpha = alpha;
- this.modulateBy(__.<Vertex>outE().asAdmin());
+ this.configure(PageRank.edges, __.<Vertex>outE().asAdmin());
}
@Override
+ public void configure(final Object... keyValues) {
+ if (keyValues[0].equals(PageRank.edges)) {
+ if (!(keyValues[1] instanceof Traversal))
+ throw new IllegalArgumentException("PageRank.edges requires a Traversal as its argument");
+ this.edgeTraversal = new PureTraversal<>(((Traversal<Vertex,Edge>) keyValues[1]).asAdmin());
+ this.integrateChild(this.edgeTraversal.get());
+ } else if (keyValues[0].equals(PageRank.propertyName)) {
+ if (!(keyValues[1] instanceof String))
+ throw new IllegalArgumentException("PageRank.propertyName requires a String as its argument");
+ this.pageRankProperty = (String) keyValues[1];
+ } else if (keyValues[0].equals(PageRank.times)) {
+ if (!(keyValues[1] instanceof Integer))
+ throw new IllegalArgumentException("PageRank.times requires an Integer as its argument");
+ this.times = (int) keyValues[1];
+ }else {
+ this.parameters.set(this, keyValues);
+ }
+ }
+
+ @Override
+ public Parameters getParameters() {
+ return parameters;
+ }
+
+ /**
+ * @deprecated As of release 3.4.0, replaced by {@link #configure(Object...)}
+ */
+ @Deprecated
+ @Override
public void modulateBy(final Traversal.Admin<?, ?> edgeTraversal) {
- this.edgeTraversal = new PureTraversal<>((Traversal.Admin<Vertex, Edge>) edgeTraversal);
- this.integrateChild(this.edgeTraversal.get());
+ configure(PageRank.edges, edgeTraversal);
}
+ /**
+ * @deprecated As of release 3.4.0, replaced by {@link #configure(Object...)}
+ */
+ @Deprecated
@Override
public void modulateBy(final String pageRankProperty) {
- this.pageRankProperty = pageRankProperty;
+ configure(PageRank.propertyName, pageRankProperty);
}
+ /**
+ * @deprecated As of release 3.4.0, replaced by {@link #configure(Object...)}
+ */
+ @Deprecated
@Override
public void modulateTimes(int times) {
- this.times = times;
+ configure(PageRank.times, times);
}
@Override
@@ -118,4 +159,5 @@
public int hashCode() {
return super.hashCode() ^ this.edgeTraversal.hashCode() ^ this.pageRankProperty.hashCode() ^ this.times;
}
+
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PeerPressure.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PeerPressure.java
new file mode 100644
index 0000000..c0051f2
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PeerPressure.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.process.computer.traversal.step.map;
+
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+
+/**
+ * Configuration options to be passed to the {@link GraphTraversal#with(String, Object)} step on
+ * {@link GraphTraversal#peerPressure()}.
+ */
+public final class PeerPressure {
+ /**
+ * Configures number of iterations that the algorithm should run.
+ */
+ public static final String times = Graph.Hidden.hide("tinkerpop.peerPressure.times");
+
+ /**
+ * Configures the edge to traverse when determining clusters.
+ */
+ public static final String edges = Graph.Hidden.hide("tinkerpop.peerPressure.edges");
+
+ /**
+ * Configures the name of the property within which to store the cluster value.
+ */
+ public static final String propertyName = Graph.Hidden.hide("tinkerpop.peerPressure.propertyName");
+}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PeerPressureVertexProgramStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PeerPressureVertexProgramStep.java
index 47d4160..e1cba60 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PeerPressureVertexProgramStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PeerPressureVertexProgramStep.java
@@ -27,8 +27,10 @@
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.process.traversal.step.ByModulating;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Configuring;
import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating;
import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
import org.apache.tinkerpop.gremlin.process.traversal.util.PureTraversal;
import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -42,16 +44,44 @@
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
*/
-public final class PeerPressureVertexProgramStep extends VertexProgramStep implements TraversalParent, ByModulating, TimesModulating {
+public final class PeerPressureVertexProgramStep extends VertexProgramStep
+ implements TraversalParent, ByModulating, TimesModulating, Configuring {
+ private Parameters parameters = new Parameters();
private PureTraversal<Vertex, Edge> edgeTraversal;
private String clusterProperty = PeerPressureVertexProgram.CLUSTER;
private int times = 30;
public PeerPressureVertexProgramStep(final Traversal.Admin traversal) {
super(traversal);
- this.modulateBy(__.<Vertex>outE().asAdmin());
+ this.configure(PeerPressure.edges, __.<Vertex>outE().asAdmin());
+ }
+
+ @Override
+ public void configure(final Object... keyValues) {
+ if (keyValues[0].equals(PeerPressure.edges)) {
+ if (!(keyValues[1] instanceof Traversal))
+ throw new IllegalArgumentException("PeerPressure.edges requires a Traversal as its argument");
+ this.edgeTraversal = new PureTraversal<>(((Traversal<Vertex,Edge>) keyValues[1]).asAdmin());
+ this.integrateChild(this.edgeTraversal.get());
+ } else if (keyValues[0].equals(PeerPressure.propertyName)) {
+ if (!(keyValues[1] instanceof String))
+ throw new IllegalArgumentException("PeerPressure.propertyName requires a String as its argument");
+ this.clusterProperty = (String) keyValues[1];
+ } else if (keyValues[0].equals(PeerPressure.times)) {
+ if (!(keyValues[1] instanceof Integer))
+ throw new IllegalArgumentException("PeerPressure.times requires an Integer as its argument");
+ this.times = (int) keyValues[1];
+ }else {
+ this.parameters.set(this, keyValues);
+ }
+ }
+
+ @Override
+ public Parameters getParameters() {
+ return parameters;
}
@Override
@@ -59,20 +89,31 @@
return super.hashCode() ^ this.edgeTraversal.hashCode() ^ this.clusterProperty.hashCode() ^ this.times;
}
+ /**
+ * @deprecated As of release 3.4.0, replaced by {@link #configure(Object...)}
+ */
+ @Deprecated
@Override
public void modulateBy(final Traversal.Admin<?, ?> edgeTraversal) {
- this.edgeTraversal = new PureTraversal<>((Traversal.Admin<Vertex, Edge>) edgeTraversal);
- this.integrateChild(this.edgeTraversal.get());
+ configure(PeerPressure.edges, edgeTraversal);
}
+ /**
+ * @deprecated As of release 3.4.0, replaced by {@link #configure(Object...)}
+ */
+ @Deprecated
@Override
public void modulateBy(final String clusterProperty) {
- this.clusterProperty = clusterProperty;
+ configure(PeerPressure.propertyName, clusterProperty);
}
+ /**
+ * @deprecated As of release 3.4.0, replaced by {@link #configure(Object...)}
+ */
+ @Deprecated
@Override
public void modulateTimes(int times) {
- this.times = times;
+ configure(PeerPressure.times, times);
}
@Override
@@ -115,4 +156,5 @@
super.setTraversal(parentTraversal);
this.integrateChild(this.edgeTraversal.get());
}
+
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Operator.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Operator.java
index 04e7130..4fada2f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Operator.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Operator.java
@@ -82,7 +82,7 @@
*/
min {
public Object apply(final Object a, final Object b) {
- return NumberHelper.min((Number) a, (Number) b);
+ return NumberHelper.min((Comparable) a, (Comparable) b);
}
},
@@ -93,7 +93,7 @@
*/
max {
public Object apply(final Object a, final Object b) {
- return NumberHelper.max((Number) a, (Number) b);
+ return NumberHelper.max((Comparable) a, (Comparable) b);
}
},
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalEngine.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalEngine.java
deleted file mode 100644
index d58c988..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalEngine.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.process.traversal;
-
-import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-
-/**
- * A TraversalEngine is reponsible for executing a {@link Traversal}. There are two {@link Type}s of TraversalEngines.
- * {@link Type#STANDARD} is the OLTP, iterator-based model of graph traversal.
- * {@link Type#COMPUTER} is the OLAP, message passing model of graph traversal.
- * Every {@link TraversalSource} should be provided a {@link TraversalEngine.Builder} so it can construct an engine for each spawned {@link Traversal}.
- *
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @deprecated As of release 3.2.0, replaced by {@link org.apache.tinkerpop.gremlin.process.computer.Computer}.
- */
-@Deprecated
-public interface TraversalEngine extends Serializable {
-
- public enum Type {STANDARD, COMPUTER}
-
- /**
- * Get the type of the engine: {@link Type#STANDARD} or {@link Type#COMPUTER}.
- *
- * @return the traversal engine type
- */
- public Type getType();
-
- /**
- * If the traversal engine is of type {@link Type#COMPUTER}, then it should have the {@link GraphComputer} used for executing the traversal.
- *
- * @return an optional of containing the graph computer to be used for execution.
- */
- public Optional<GraphComputer> getGraphComputer();
-
- /**
- * Whether or not the type is {@link Type#STANDARD}.
- *
- * @return whether the engine type is standard (OLTP).
- */
- public default boolean isStandard() {
- return this.getType().equals(Type.STANDARD);
- }
-
- /**
- * Whether or not the type is {@link Type#COMPUTER}.
- *
- * @return whether the engine type is computer (OLAP).
- */
- public default boolean isComputer() {
- return this.getType().equals(Type.COMPUTER);
- }
-
- ///////////
-
- @Deprecated
- public interface Builder extends Serializable {
-
- /**
- * A list of {@link TraversalStrategy} instances that should be applied to the ultimate {@link Traversal}.
- *
- * @return strategies to apply (if any).
- */
- public default List<TraversalStrategy> getWithStrategies() {
- return Collections.emptyList();
- }
-
- /**
- * A list of {@link TraversalStrategy} classes that should not be applied to the ultimate {@link Traversal}.
- *
- * @return strategies to not apply (if any).
- */
- public default List<Class<? extends TraversalStrategy>> getWithoutStrategies() {
- return Collections.emptyList();
- }
-
- /**
- * Create the {@link TraversalEngine}.
- *
- * @param graph the graph to ultimately have the {@link Traversal} execute over.
- * @return a {@link TraversalEngine} that is particular to a {@link Traversal}.
- */
- public TraversalEngine create(final Graph graph);
- }
-}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
index 31738b0..ef3e841 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
@@ -83,8 +83,8 @@
}
/**
- * Apply all the {@link TraversalStrategy} optimizers to the {@link Traversal} for the stated {@link TraversalEngine}.
- * This method must ensure that the strategies are sorted prior to application.
+ * Apply all the {@link TraversalStrategy} optimizers to the {@link Traversal}. This method must ensure that the
+ * strategies are sorted prior to application.
*
* @param traversal the traversal to apply the strategies to
*/
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
index 01c03f9..7d1e7e4 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
@@ -36,6 +36,7 @@
import org.apache.tinkerpop.gremlin.process.traversal.lambda.PredicateTraverser;
import org.apache.tinkerpop.gremlin.process.traversal.lambda.TrueTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.step.ByModulating;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Configuring;
import org.apache.tinkerpop.gremlin.process.traversal.step.FromToModulating;
import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating;
@@ -875,7 +876,7 @@
* @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#max-step" target="_blank">Reference Documentation - Max Step</a>
* @since 3.0.0-incubating
*/
- public default <E2 extends Number> GraphTraversal<S, E2> max() {
+ public default <E2 extends Comparable> GraphTraversal<S, E2> max() {
this.asAdmin().getBytecode().addStep(Symbols.max);
return this.asAdmin().addStep(new MaxGlobalStep<>(this.asAdmin()));
}
@@ -887,7 +888,7 @@
* @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#max-step" target="_blank">Reference Documentation - Max Step</a>
* @since 3.0.0-incubating
*/
- public default <E2 extends Number> GraphTraversal<S, E2> max(final Scope scope) {
+ public default <E2 extends Comparable> GraphTraversal<S, E2> max(final Scope scope) {
this.asAdmin().getBytecode().addStep(Symbols.max, scope);
return this.asAdmin().addStep(scope.equals(Scope.global) ? new MaxGlobalStep<>(this.asAdmin()) : new MaxLocalStep<>(this.asAdmin()));
}
@@ -899,7 +900,7 @@
* @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#min-step" target="_blank">Reference Documentation - Min Step</a>
* @since 3.0.0-incubating
*/
- public default <E2 extends Number> GraphTraversal<S, E2> min() {
+ public default <E2 extends Comparable> GraphTraversal<S, E2> min() {
this.asAdmin().getBytecode().addStep(Symbols.min);
return this.asAdmin().addStep(new MinGlobalStep<>(this.asAdmin()));
}
@@ -911,7 +912,7 @@
* @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#min-step" target="_blank">Reference Documentation - Min Step</a>
* @since 3.0.0-incubating
*/
- public default <E2 extends Number> GraphTraversal<S, E2> min(final Scope scope) {
+ public default <E2 extends Comparable> GraphTraversal<S, E2> min(final Scope scope) {
this.asAdmin().getBytecode().addStep(Symbols.min, scope);
return this.asAdmin().addStep(scope.equals(Scope.global) ? new MinGlobalStep<E2>(this.asAdmin()) : new MinLocalStep<>(this.asAdmin()));
}
@@ -2074,10 +2075,10 @@
final Step endStep = this.asAdmin().getEndStep();
if ((endStep instanceof AddVertexStep || endStep instanceof AddEdgeStep || endStep instanceof AddVertexStartStep || endStep instanceof AddEdgeStartStep) &&
keyValues.length == 0 && null == cardinality) {
- ((Mutating) endStep).addPropertyMutations(key, value);
+ ((Mutating) endStep).configure(key, value);
} else {
this.asAdmin().addStep(new AddPropertyStep(this.asAdmin(), cardinality, key, value));
- ((AddPropertyStep) this.asAdmin().getEndStep()).addPropertyMutations(keyValues);
+ ((AddPropertyStep) this.asAdmin().getEndStep()).configure(keyValues);
}
return this;
}
@@ -2496,6 +2497,24 @@
return this.asAdmin().addStep(new LambdaCollectingBarrierStep<>(this.asAdmin(), (Consumer) barrierConsumer, Integer.MAX_VALUE));
}
+ //// WITH-MODULATOR
+
+ /**
+ * Provides a configuration to a step in the form of a key and value pair. The key of the configuration must be
+ * step specific and therefore a configuration could be supplied that is not known to be valid until execution.
+ *
+ * @param key the key of the configuration to apply to a step
+ * @param value the value of the configuration to apply to a step
+ * @return the traversal with a modulated step
+ * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#with-step" target="_blank">Reference Documentation - With Step</a>
+ * @since 3.4.0
+ */
+ public default GraphTraversal<S,E> with(final String key, final Object value) {
+ this.asAdmin().getBytecode().addStep(Symbols.with, key, value);
+ final Object[] configPair = { key, value };
+ ((Configuring) this.asAdmin().getEndStep()).configure(configPair);
+ return this;
+ }
//// BY-MODULATORS
@@ -2801,6 +2820,7 @@
public static final String program = "program";
public static final String by = "by";
+ public static final String with = "with";
public static final String times = "times";
public static final String as = "as";
public static final String option = "option";
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java
index 5cbfe87..2c73ce1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java
@@ -417,28 +417,28 @@
/**
* @see GraphTraversal#min()
*/
- public static <A, B extends Number> GraphTraversal<A, B> min() {
+ public static <A, B extends Comparable> GraphTraversal<A, B> min() {
return __.<A>start().min();
}
/**
* @see GraphTraversal#min(Scope)
*/
- public static <A, B extends Number> GraphTraversal<A, B> min(final Scope scope) {
+ public static <A, B extends Comparable> GraphTraversal<A, B> min(final Scope scope) {
return __.<A>start().min(scope);
}
/**
* @see GraphTraversal#max()
*/
- public static <A, B extends Number> GraphTraversal<A, B> max() {
+ public static <A, B extends Comparable> GraphTraversal<A, B> max() {
return __.<A>start().max();
}
/**
* @see GraphTraversal#max(Scope)
*/
- public static <A, B extends Number> GraphTraversal<A, B> max(final Scope scope) {
+ public static <A, B extends Comparable> GraphTraversal<A, B> max(final Scope scope) {
return __.<A>start().max(scope);
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/ComputerTraversalEngine.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/ComputerTraversalEngine.java
deleted file mode 100644
index 3786280..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/ComputerTraversalEngine.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.process.traversal.engine;
-
-import org.apache.tinkerpop.gremlin.process.computer.Computer;
-import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
-@Deprecated
-public final class ComputerTraversalEngine implements TraversalEngine {
-
- private final transient GraphComputer graphComputer;
-
- private ComputerTraversalEngine(final GraphComputer graphComputer) {
- this.graphComputer = graphComputer;
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- @Override
- public Type getType() {
- return Type.COMPUTER;
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- @Override
- public String toString() {
- return this.getClass().getSimpleName().toLowerCase();
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- @Override
- public Optional<GraphComputer> getGraphComputer() {
- return Optional.ofNullable(this.graphComputer);
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- public static Builder build() {
- return new Builder();
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- public final static class Builder implements TraversalEngine.Builder {
-
- private Class<? extends GraphComputer> graphComputerClass;
- private int workers = -1;
- private Traversal<Vertex, Vertex> vertexFilter = null;
- private Traversal<Vertex, Edge> edgeFilter = null;
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- @Override
- public List<TraversalStrategy> getWithStrategies() {
- return Collections.emptyList();
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- public Builder workers(final int workers) {
- this.workers = workers;
- return this;
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- public Builder computer(final Class<? extends GraphComputer> graphComputerClass) {
- this.graphComputerClass = graphComputerClass;
- return this;
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- public Builder vertices(final Traversal<Vertex, Vertex> vertexFilter) {
- this.vertexFilter = vertexFilter;
- return this;
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- public Builder edges(final Traversal<Vertex, Edge> edgeFilter) {
- this.edgeFilter = edgeFilter;
- return this;
- }
-
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- public ComputerTraversalEngine create(final Graph graph) {
- GraphComputer graphComputer = null == this.graphComputerClass ? graph.compute() : graph.compute(this.graphComputerClass);
- if (-1 != this.workers)
- graphComputer = graphComputer.workers(this.workers);
- if (null != this.vertexFilter)
- graphComputer = graphComputer.vertices(this.vertexFilter);
- if (null != this.edgeFilter)
- graphComputer = graphComputer.edges(this.edgeFilter);
- return new ComputerTraversalEngine(graphComputer);
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- public TraversalSource create(final GraphTraversalSource traversalSource) {
- Computer computer = null == this.graphComputerClass ? Computer.compute() : Computer.compute(this.graphComputerClass);
- if (-1 != this.workers)
- computer = computer.workers(this.workers);
- if (null != this.vertexFilter)
- computer = computer.vertices(this.vertexFilter);
- if (null != this.edgeFilter)
- computer = computer.edges(this.edgeFilter);
- return traversalSource.withComputer(computer);
- }
- }
-}
\ No newline at end of file
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/StandardTraversalEngine.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/StandardTraversalEngine.java
deleted file mode 100644
index 1dbd8e7..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/StandardTraversalEngine.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.process.traversal.engine;
-
-import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-
-import java.util.Optional;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
-@Deprecated
-public final class StandardTraversalEngine implements TraversalEngine {
-
- private static final StandardTraversalEngine INSTANCE = new StandardTraversalEngine();
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- private StandardTraversalEngine() {
-
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- @Override
- public Type getType() {
- return Type.STANDARD;
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- @Override
- public Optional<GraphComputer> getGraphComputer() {
- return Optional.empty();
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- public static Builder build() {
- return Builder.INSTANCE;
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- public static StandardTraversalEngine instance() {
- return INSTANCE;
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- @Override
- public String toString() {
- return this.getClass().getSimpleName().toLowerCase();
- }
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- public final static class Builder implements TraversalEngine.Builder {
-
- private static final Builder INSTANCE = new Builder();
-
- /**
- * @deprecated As of release 3.2.0. Please use {@link Graph#traversal(Class)}.
- */
- @Deprecated
- @Override
- public TraversalEngine create(final Graph graph) {
- return StandardTraversalEngine.INSTANCE;
- }
- }
-}
\ No newline at end of file
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Configuring.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Configuring.java
new file mode 100644
index 0000000..4ac6280
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Configuring.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.process.traversal.step;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Step;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
+
+/**
+ * Identifies a {@link Step} as one that can accept configurations via the {@link GraphTraversal#with(String, Object)}
+ * step modulator. The nature of the configuration allowed is specific to the implementation.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public interface Configuring extends Parameterizing {
+
+ /**
+ * Accept a configuration to the {@link Step}. Note that this interface extends {@link Parameterizing} and so
+ * there is an expectation that the {@link Step} implementation will have a {@link Parameters} instance that will
+ * house any values passed to this method. Storing these configurations in {@link Parameters} is not a requirement
+ * however, IF the configuration is an expected option for the step and can be stored on a member field that can
+ * be accessed on the step by more direct means (i.e. like a getter method).
+ */
+ public void configure(final Object... keyValues);
+}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Mutating.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Mutating.java
index 50e415a..14553d9 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Mutating.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Mutating.java
@@ -28,13 +28,10 @@
* @author Stephen Mallette (http://stephen.genoprime.com)
* @author Matt Frantz (http://github.com/mhfrantz)
*/
-public interface Mutating<E extends Event> {
+public interface Mutating<E extends Event> extends Configuring {
/**
* Gets the callback registry for events that the step raises.
*/
public CallbackRegistry<E> getMutatingCallbackRegistry();
-
- public void addPropertyMutations(final Object... keyValues);
-
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Parameterizing.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Parameterizing.java
similarity index 84%
rename from gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Parameterizing.java
rename to gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Parameterizing.java
index 9b7e088..9d8dc22 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Parameterizing.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Parameterizing.java
@@ -16,14 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tinkerpop.gremlin.process.traversal;
+package org.apache.tinkerpop.gremlin.process.traversal.step;
+import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
/**
* An interface for {@link Step} implementations that hold a {@link Parameters} object, which fold in arguments from
* other steps. It is typically used on mutating steps, such as {@code addV()}, where calls to {@code property(k,v)}
- * are folded in as parameters to that add vertex step.
+ * are folded in as parameters to that add vertex step, but it may be used for any step that could benefit from
+ * modulation.
*
* @author Marko A. Rodriguez (http://markorodriguez.com)
* @author Stephen Mallette (http://stephen.genoprime.com)
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
index c86f91f..da7b0eb 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
@@ -110,13 +110,13 @@
public enum Variable {START, END}
public default <S> S getScopeValue(final Pop pop, final String key, final Traverser.Admin<?> traverser) throws IllegalArgumentException {
- if (traverser.getSideEffects().exists(key))
- return traverser.getSideEffects().get(key);
- ///
final Object object = traverser.get();
if (object instanceof Map && ((Map<String, S>) object).containsKey(key))
return ((Map<String, S>) object).get(key);
///
+ if (traverser.getSideEffects().exists(key))
+ return traverser.getSideEffects().get(key);
+ ///
final Path path = traverser.path();
if (path.hasLabel(key))
return path.get(pop, key);
@@ -125,13 +125,13 @@
}
public default <S> S getNullableScopeValue(final Pop pop, final String key, final Traverser.Admin<?> traverser) {
- if (traverser.getSideEffects().exists(key))
- return traverser.getSideEffects().get(key);
- ///
final Object object = traverser.get();
if (object instanceof Map && ((Map<String, S>) object).containsKey(key))
return ((Map<String, S>) object).get(key);
///
+ if (traverser.getSideEffects().exists(key))
+ return traverser.getSideEffects().get(key);
+ ///
final Path path = traverser.path();
if (path.hasLabel(key))
return path.get(pop, key);
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/AndStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/AndStep.java
index 5d9d124..5c20cd8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/AndStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/AndStep.java
@@ -39,4 +39,4 @@
}
return true;
}
-}
\ No newline at end of file
+}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DropStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DropStep.java
index cd95e48..e7e14bb 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DropStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DropStep.java
@@ -21,6 +21,7 @@
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.CallbackRegistry;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.ListCallbackRegistry;
@@ -94,7 +95,13 @@
/**
* This method doesn't do anything as {@code drop()} doesn't take property mutation arguments.
*/
- public void addPropertyMutations(final Object... keyValues) {
+ @Override
+ public void configure(final Object... keyValues) {
// do nothing
}
+
+ @Override
+ public Parameters getParameters() {
+ return Parameters.EMPTY;
+ }
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStartStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStartStep.java
index 73f69a0..c6a2ef1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStartStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStartStep.java
@@ -19,7 +19,7 @@
package org.apache.tinkerpop.gremlin.process.traversal.step.map;
-import org.apache.tinkerpop.gremlin.process.traversal.Parameterizing;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Parameterizing;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
@@ -51,7 +51,7 @@
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
public final class AddEdgeStartStep extends AbstractStep<Edge, Edge>
- implements Mutating<Event.EdgeAddedEvent>, TraversalParent, Parameterizing, Scoping, FromToModulating {
+ implements Mutating<Event.EdgeAddedEvent>, TraversalParent, Scoping, FromToModulating {
private static final String FROM = Graph.Hidden.hide("from");
private static final String TO = Graph.Hidden.hide("to");
@@ -86,7 +86,7 @@
}
@Override
- public void addPropertyMutations(final Object... keyValues) {
+ public void configure(final Object... keyValues) {
this.parameters.set(this, keyValues);
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java
index 81afd03..27197f4 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java
@@ -18,7 +18,7 @@
*/
package org.apache.tinkerpop.gremlin.process.traversal.step.map;
-import org.apache.tinkerpop.gremlin.process.traversal.Parameterizing;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Parameterizing;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.step.FromToModulating;
@@ -37,7 +37,6 @@
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.util.Attachable;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
import java.util.List;
@@ -48,7 +47,7 @@
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
public final class AddEdgeStep<S> extends MapStep<S, Edge>
- implements Mutating<Event.EdgeAddedEvent>, TraversalParent, Parameterizing, Scoping, FromToModulating {
+ implements Mutating<Event.EdgeAddedEvent>, TraversalParent, Scoping, FromToModulating {
private static final String FROM = Graph.Hidden.hide("from");
private static final String TO = Graph.Hidden.hide("to");
@@ -82,7 +81,7 @@
}
@Override
- public void addPropertyMutations(final Object... keyValues) {
+ public void configure(final Object... keyValues) {
this.parameters.set(this, keyValues);
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexStartStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexStartStep.java
index 920fa45..f47e631 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexStartStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexStartStep.java
@@ -18,7 +18,7 @@
*/
package org.apache.tinkerpop.gremlin.process.traversal.step.map;
-import org.apache.tinkerpop.gremlin.process.traversal.Parameterizing;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Parameterizing;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
@@ -37,7 +37,6 @@
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
import java.util.List;
import java.util.Set;
@@ -47,7 +46,7 @@
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
public final class AddVertexStartStep extends AbstractStep<Vertex, Vertex>
- implements Mutating<Event.VertexAddedEvent>, TraversalParent, Parameterizing, Scoping {
+ implements Mutating<Event.VertexAddedEvent>, TraversalParent, Scoping {
private Parameters parameters = new Parameters();
private boolean first = true;
@@ -79,7 +78,7 @@
}
@Override
- public void addPropertyMutations(final Object... keyValues) {
+ public void configure(final Object... keyValues) {
this.parameters.set(this, keyValues);
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexStep.java
index 13e2fc8..0feecec 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexStep.java
@@ -18,7 +18,6 @@
*/
package org.apache.tinkerpop.gremlin.process.traversal.step.map;
-import org.apache.tinkerpop.gremlin.process.traversal.Parameterizing;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
@@ -33,7 +32,6 @@
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
import java.util.List;
import java.util.Set;
@@ -43,7 +41,7 @@
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
public final class AddVertexStep<S> extends MapStep<S, Vertex>
- implements Mutating<Event.VertexAddedEvent>, TraversalParent, Parameterizing, Scoping {
+ implements Mutating<Event.VertexAddedEvent>, TraversalParent, Scoping {
private Parameters parameters = new Parameters();
private CallbackRegistry<Event.VertexAddedEvent> callbackRegistry;
@@ -74,7 +72,7 @@
}
@Override
- public void addPropertyMutations(final Object... keyValues) {
+ public void configure(final Object... keyValues) {
this.parameters.set(this, keyValues);
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/EdgeOtherVertexStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/EdgeOtherVertexStep.java
index 3a5a73b..a53dd50 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/EdgeOtherVertexStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/EdgeOtherVertexStep.java
@@ -20,6 +20,8 @@
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Configuring;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Vertex;
@@ -32,7 +34,8 @@
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
-public class EdgeOtherVertexStep extends MapStep<Edge, Vertex> {
+public class EdgeOtherVertexStep extends MapStep<Edge, Vertex> implements Configuring {
+ protected Parameters parameters = new Parameters();
public EdgeOtherVertexStep(final Traversal.Admin traversal) {
super(traversal);
@@ -52,6 +55,16 @@
}
@Override
+ public Parameters getParameters() {
+ return this.parameters;
+ }
+
+ @Override
+ public void configure(final Object... keyValues) {
+ this.parameters.set(null, keyValues);
+ }
+
+ @Override
public Set<TraverserRequirement> getRequirements() {
return Collections.singleton(TraverserRequirement.PATH);
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/EdgeVertexStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/EdgeVertexStep.java
index 8bef835..c15c52a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/EdgeVertexStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/EdgeVertexStep.java
@@ -20,6 +20,8 @@
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Configuring;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -33,8 +35,9 @@
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
-public class EdgeVertexStep extends FlatMapStep<Edge, Vertex> implements AutoCloseable {
+public class EdgeVertexStep extends FlatMapStep<Edge, Vertex> implements AutoCloseable, Configuring {
+ protected Parameters parameters = new Parameters();
protected Direction direction;
public EdgeVertexStep(final Traversal.Admin traversal, final Direction direction) {
@@ -43,6 +46,16 @@
}
@Override
+ public Parameters getParameters() {
+ return this.parameters;
+ }
+
+ @Override
+ public void configure(final Object... keyValues) {
+ this.parameters.set(null, keyValues);
+ }
+
+ @Override
protected Iterator<Vertex> flatMap(final Traverser.Admin<Edge> traverser) {
return traverser.get().vertices(this.direction);
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GraphStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GraphStep.java
index e40271c..345eb42 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GraphStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GraphStep.java
@@ -24,9 +24,11 @@
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Configuring;
import org.apache.tinkerpop.gremlin.process.traversal.step.GraphComputing;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Element;
@@ -46,8 +48,9 @@
* @author Marko A. Rodriguez (http://markorodriguez.com)
* @author Pieter Martin
*/
-public class GraphStep<S, E extends Element> extends AbstractStep<S, E> implements GraphComputing, AutoCloseable {
+public class GraphStep<S, E extends Element> extends AbstractStep<S, E> implements GraphComputing, AutoCloseable, Configuring {
+ protected Parameters parameters = new Parameters();
protected final Class<E> returnClass;
protected Object[] ids;
protected transient Supplier<Iterator<E>> iteratorSupplier;
@@ -71,6 +74,16 @@
return StringFactory.stepString(this, this.returnClass.getSimpleName().toLowerCase(), Arrays.toString(this.ids));
}
+ @Override
+ public Parameters getParameters() {
+ return this.parameters;
+ }
+
+ @Override
+ public void configure(final Object... keyValues) {
+ this.parameters.set(null, keyValues);
+ }
+
public Class<E> getReturnClass() {
return this.returnClass;
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/LambdaCollectingBarrierStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/LambdaCollectingBarrierStep.java
index 9b500d4..ef41b61 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/LambdaCollectingBarrierStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/LambdaCollectingBarrierStep.java
@@ -32,19 +32,6 @@
*/
public final class LambdaCollectingBarrierStep<S> extends CollectingBarrierStep<S> implements LambdaHolder {
- /**
- * @deprecated As of release 3.2.0, replaced by use of {@link NoOpBarrierStep}.
- */
- @Deprecated
- public enum Consumers implements Consumer<TraverserSet<Object>> {
- noOp {
- @Override
- public void accept(final TraverserSet<Object> traverserSet) {
-
- }
- }
- }
-
private final Consumer<TraverserSet<S>> barrierConsumer;
public LambdaCollectingBarrierStep(final Traversal.Admin traversal, final Consumer<TraverserSet<S>> barrierConsumer, final int maxBarrierSize) {
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
index 8e2207a..8082f40 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
@@ -20,10 +20,8 @@
import org.apache.tinkerpop.gremlin.process.traversal.Path;
import org.apache.tinkerpop.gremlin.process.traversal.Pop;
-import org.apache.tinkerpop.gremlin.process.traversal.Scope;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.step.Barrier;
import org.apache.tinkerpop.gremlin.process.traversal.step.PathProcessor;
@@ -236,7 +234,7 @@
public MatchAlgorithm getMatchAlgorithm() {
if (null == this.matchAlgorithm)
- this.initializeMatchAlgorithm(this.traverserStepIdAndLabelsSetByChild ? TraversalEngine.Type.COMPUTER : TraversalEngine.Type.STANDARD);
+ this.initializeMatchAlgorithm(this.traverserStepIdAndLabelsSetByChild);
return this.matchAlgorithm;
}
@@ -324,13 +322,13 @@
return bindings;
}
- private void initializeMatchAlgorithm(final TraversalEngine.Type traversalEngineType) {
+ private void initializeMatchAlgorithm(final boolean onComputer) {
try {
this.matchAlgorithm = this.matchAlgorithmClass.getConstructor().newInstance();
} catch (final NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) {
throw new IllegalStateException(e.getMessage(), e);
}
- this.matchAlgorithm.initialize(traversalEngineType, this.matchTraversals);
+ this.matchAlgorithm.initialize(onComputer, this.matchTraversals);
}
private boolean hasPathLabel(final Path path, final Set<String> labels) {
@@ -362,7 +360,7 @@
while (true) {
if (this.first) {
this.first = false;
- this.initializeMatchAlgorithm(TraversalEngine.Type.STANDARD);
+ this.initializeMatchAlgorithm(false);
if (null != this.keepLabels &&
this.keepLabels.containsAll(this.matchEndLabels) &&
this.keepLabels.containsAll(this.matchStartLabels))
@@ -416,7 +414,7 @@
while (true) {
if (this.first) {
this.first = false;
- this.initializeMatchAlgorithm(TraversalEngine.Type.COMPUTER);
+ this.initializeMatchAlgorithm(true);
if (null != this.keepLabels &&
this.keepLabels.containsAll(this.matchEndLabels) &&
this.keepLabels.containsAll(this.matchStartLabels))
@@ -692,7 +690,7 @@
public static Function<List<Traversal.Admin<Object, Object>>, IllegalStateException> UNMATCHABLE_PATTERN = traversals -> new IllegalStateException("The provided match pattern is unsolvable: " + traversals);
- public void initialize(final TraversalEngine.Type traversalEngineType, final List<Traversal.Admin<Object, Object>> traversals);
+ public void initialize(final boolean onComputer, final List<Traversal.Admin<Object, Object>> traversals);
public default void recordStart(final Traverser.Admin<Object> traverser, final Traversal.Admin<Object, Object> traversal) {
@@ -708,7 +706,7 @@
private List<Traversal.Admin<Object, Object>> traversals;
@Override
- public void initialize(final TraversalEngine.Type traversalEngineType, final List<Traversal.Admin<Object, Object>> traversals) {
+ public void initialize(final boolean onComputer, final List<Traversal.Admin<Object, Object>> traversals) {
this.traversals = traversals;
}
@@ -728,8 +726,8 @@
protected int counter = 0;
protected boolean onComputer;
- public void initialize(final TraversalEngine.Type traversalEngineType, final List<Traversal.Admin<Object, Object>> traversals) {
- this.onComputer = traversalEngineType.equals(TraversalEngine.Type.COMPUTER);
+ public void initialize(final boolean onComputer, final List<Traversal.Admin<Object, Object>> traversals) {
+ this.onComputer = onComputer;
this.bundles = traversals.stream().map(Bundle::new).collect(Collectors.toList());
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MaxGlobalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MaxGlobalStep.java
index 954dbfe..2873f55 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MaxGlobalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MaxGlobalStep.java
@@ -32,7 +32,7 @@
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
-public final class MaxGlobalStep<S extends Number> extends ReducingBarrierStep<S, S> {
+public final class MaxGlobalStep<S extends Comparable> extends ReducingBarrierStep<S, S> {
public MaxGlobalStep(final Traversal.Admin traversal) {
super(traversal);
@@ -41,7 +41,13 @@
}
@Override
- public S projectTraverser(Traverser.Admin<S> traverser) {
+ public void processAllStarts() {
+ if (this.starts.hasNext())
+ super.processAllStarts();
+ }
+
+ @Override
+ public S projectTraverser(final Traverser.Admin<S> traverser) {
return traverser.get();
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MaxLocalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MaxLocalStep.java
index 2baca28..3ad326f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MaxLocalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MaxLocalStep.java
@@ -21,6 +21,7 @@
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
+import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException;
import java.util.Collections;
import java.util.Iterator;
@@ -32,7 +33,7 @@
* @author Marko A. Rodriguez (http://markorodriguez.com)
* @author Daniel Kuppitz (http://gremlin.guru)
*/
-public final class MaxLocalStep<E extends Number, S extends Iterable<E>> extends MapStep<S, E> {
+public final class MaxLocalStep<E extends Comparable, S extends Iterable<E>> extends MapStep<S, E> {
public MaxLocalStep(final Traversal.Admin traversal) {
super(traversal);
@@ -40,17 +41,15 @@
@Override
protected E map(final Traverser.Admin<S> traverser) {
- Number result;
final Iterator<E> iterator = traverser.get().iterator();
if (iterator.hasNext()) {
- result = iterator.next();
+ Comparable result = iterator.next();
while (iterator.hasNext()) {
result = max(iterator.next(), result);
}
- } else {
- result = Double.NaN;
+ return (E) result;
}
- return (E) result;
+ throw FastNoSuchElementException.instance();
}
@Override
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MeanGlobalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MeanGlobalStep.java
index 2f1c1dc..5e90336 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MeanGlobalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MeanGlobalStep.java
@@ -49,6 +49,12 @@
}
@Override
+ public void processAllStarts() {
+ if (this.starts.hasNext())
+ super.processAllStarts();
+ }
+
+ @Override
public E projectTraverser(final Traverser.Admin<S> traverser) {
return (E) new MeanNumber(traverser.get(), traverser.bulk());
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MeanLocalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MeanLocalStep.java
index 99005c9..91447fd 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MeanLocalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MeanLocalStep.java
@@ -22,6 +22,7 @@
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
+import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException;
import java.util.Collections;
import java.util.Iterator;
@@ -48,9 +49,8 @@
counter++;
}
return NumberHelper.div(result, counter, true);
- } else {
- return Double.NaN;
}
+ throw FastNoSuchElementException.instance();
}
@Override
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MinGlobalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MinGlobalStep.java
index 7d0eb56..781e93d 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MinGlobalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MinGlobalStep.java
@@ -32,7 +32,7 @@
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
-public final class MinGlobalStep<S extends Number> extends ReducingBarrierStep<S, S> {
+public final class MinGlobalStep<S extends Comparable> extends ReducingBarrierStep<S, S> {
public MinGlobalStep(final Traversal.Admin traversal) {
super(traversal);
@@ -41,6 +41,12 @@
}
@Override
+ public void processAllStarts() {
+ if (this.starts.hasNext())
+ super.processAllStarts();
+ }
+
+ @Override
public S projectTraverser(final Traverser.Admin<S> traverser) {
return traverser.get();
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MinLocalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MinLocalStep.java
index e7e001c..4139a7d 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MinLocalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MinLocalStep.java
@@ -21,6 +21,7 @@
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
+import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException;
import java.util.Collections;
import java.util.Iterator;
@@ -32,7 +33,7 @@
* @author Marko A. Rodriguez (http://markorodriguez.com)
* @author Daniel Kuppitz (http://gremlin.guru)
*/
-public final class MinLocalStep<E extends Number, S extends Iterable<E>> extends MapStep<S, E> {
+public final class MinLocalStep<E extends Comparable, S extends Iterable<E>> extends MapStep<S, E> {
public MinLocalStep(final Traversal.Admin traversal) {
super(traversal);
@@ -40,17 +41,15 @@
@Override
protected E map(final Traverser.Admin<S> traverser) {
- Number result;
final Iterator<E> iterator = traverser.get().iterator();
if (iterator.hasNext()) {
- result = iterator.next();
+ Comparable result = iterator.next();
while (iterator.hasNext()) {
result = min(iterator.next(), result);
}
- } else {
- result = Double.NaN;
+ return (E) result;
}
- return (E) result;
+ throw FastNoSuchElementException.instance();
}
@Override
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertiesStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertiesStep.java
index cbfc475..7cc193a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertiesStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertiesStep.java
@@ -20,6 +20,8 @@
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Configuring;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.PropertyType;
@@ -33,8 +35,9 @@
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
-public class PropertiesStep<E> extends FlatMapStep<Element, E> implements AutoCloseable {
+public class PropertiesStep<E> extends FlatMapStep<Element, E> implements AutoCloseable, Configuring {
+ protected Parameters parameters = new Parameters();
protected final String[] propertyKeys;
protected final PropertyType returnType;
@@ -45,6 +48,16 @@
}
@Override
+ public Parameters getParameters() {
+ return this.parameters;
+ }
+
+ @Override
+ public void configure(final Object... keyValues) {
+ this.parameters.set(null, keyValues);
+ }
+
+ @Override
protected Iterator<E> flatMap(final Traverser.Admin<Element> traverser) {
return this.returnType.equals(PropertyType.VALUE) ?
traverser.get().values(this.propertyKeys) :
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumGlobalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumGlobalStep.java
index 7942d9b..3711cfe 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumGlobalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumGlobalStep.java
@@ -48,6 +48,12 @@
}
@Override
+ public void processAllStarts() {
+ if (this.starts.hasNext())
+ super.processAllStarts();
+ }
+
+ @Override
public S projectTraverser(final Traverser.Admin<S> traverser) {
return (S) mul(traverser.get(), traverser.bulk());
}
@@ -57,4 +63,4 @@
public Set<TraverserRequirement> getRequirements() {
return REQUIREMENTS;
}
-}
\ No newline at end of file
+}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumLocalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumLocalStep.java
index b062a7e..72e6539 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumLocalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumLocalStep.java
@@ -22,6 +22,7 @@
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
+import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException;
import java.util.Collections;
import java.util.Iterator;
@@ -39,17 +40,15 @@
@Override
protected E map(final Traverser.Admin<S> traverser) {
- Number result;
final Iterator<E> iterator = traverser.get().iterator();
if (iterator.hasNext()) {
- result = iterator.next();
+ Number result = iterator.next();
while (iterator.hasNext()) {
result = NumberHelper.add(result, iterator.next());
}
- } else {
- result = 0;
+ return (E) result;
}
- return (E) result;
+ throw FastNoSuchElementException.instance();
}
@Override
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexStep.java
index 9ac6d0c..6825736 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexStep.java
@@ -20,6 +20,8 @@
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Configuring;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -35,8 +37,9 @@
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
-public class VertexStep<E extends Element> extends FlatMapStep<Vertex, E> implements AutoCloseable {
+public class VertexStep<E extends Element> extends FlatMapStep<Vertex, E> implements AutoCloseable, Configuring {
+ protected Parameters parameters = new Parameters();
private final String[] edgeLabels;
private Direction direction;
private final Class<E> returnClass;
@@ -49,6 +52,16 @@
}
@Override
+ public Parameters getParameters() {
+ return this.parameters;
+ }
+
+ @Override
+ public void configure(final Object... keyValues) {
+ this.parameters.set(null, keyValues);
+ }
+
+ @Override
protected Iterator<E> flatMap(final Traverser.Admin<Vertex> traverser) {
return Vertex.class.isAssignableFrom(this.returnClass) ?
(Iterator<E>) traverser.get().vertices(this.direction, this.edgeLabels) :
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStep.java
index 7509f86..6b814c3 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStep.java
@@ -18,7 +18,7 @@
*/
package org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect;
-import org.apache.tinkerpop.gremlin.process.traversal.Parameterizing;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Parameterizing;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
@@ -37,9 +37,8 @@
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedProperty;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
+import org.apache.tinkerpop.gremlin.structure.util.keyed.KeyedProperty;
+import org.apache.tinkerpop.gremlin.structure.util.keyed.KeyedVertexProperty;
import java.util.List;
import java.util.Set;
@@ -48,7 +47,7 @@
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
public final class AddPropertyStep<S extends Element> extends SideEffectStep<S>
- implements Mutating<Event.ElementPropertyChangedEvent>, TraversalParent, Parameterizing, Scoping {
+ implements Mutating<Event.ElementPropertyChangedEvent>, TraversalParent, Scoping {
private Parameters parameters = new Parameters();
private final VertexProperty.Cardinality cardinality;
@@ -76,7 +75,7 @@
}
@Override
- public void addPropertyMutations(final Object... keyValues) {
+ public void configure(final Object... keyValues) {
this.parameters.set(this, keyValues);
}
@@ -100,17 +99,17 @@
if (element instanceof Vertex)
evt = new Event.VertexPropertyChangedEvent(eventStrategy.detach((Vertex) element),
newProperty ?
- eventStrategy.empty(element, key) :
+ new KeyedVertexProperty(key) :
eventStrategy.detach((VertexProperty) currentProperty), value, vertexPropertyKeyValues);
else if (element instanceof Edge)
evt = new Event.EdgePropertyChangedEvent(eventStrategy.detach((Edge) element),
newProperty ?
- eventStrategy.empty(element, key) :
+ new KeyedProperty(key) :
eventStrategy.detach(currentProperty), value);
else if (element instanceof VertexProperty)
evt = new Event.VertexPropertyPropertyChangedEvent(eventStrategy.detach((VertexProperty) element),
newProperty ?
- eventStrategy.empty(element, key) :
+ new KeyedProperty(key) :
eventStrategy.detach(currentProperty), value);
else
throw new IllegalStateException(String.format("The incoming object cannot be processed by change eventing in %s: %s", AddPropertyStep.class.getName(), element));
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/EmptyPath.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/EmptyPath.java
index 0c6827e..69111ee 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/EmptyPath.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/EmptyPath.java
@@ -19,6 +19,7 @@
package org.apache.tinkerpop.gremlin.process.traversal.step.util;
import org.apache.tinkerpop.gremlin.process.traversal.Path;
+import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import java.io.Serializable;
import java.util.Collections;
@@ -103,4 +104,9 @@
public boolean equals(final Object object) {
return object instanceof EmptyPath;
}
+
+ @Override
+ public String toString() {
+ return StringFactory.pathString(this);
+ }
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/HasContainer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/HasContainer.java
index 08ab389..9e3ab91 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/HasContainer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/HasContainer.java
@@ -182,22 +182,4 @@
}
return true;
}
-
-
- /**
- * @deprecated As of release 3.2.4. Providers should handle composite {@link P#and} predicates and not rely on splitting.
- */
- @Deprecated
- public static HasContainer[] makeHasContainers(final String key, final P<?> predicate) {
- if (predicate instanceof AndP) {
- final List<P<?>> predicates = ((AndP) predicate).getPredicates();
- final HasContainer[] hasContainers = new HasContainer[predicates.size()];
- for (int i = 0; i < predicates.size(); i++) {
- hasContainers[i] = new HasContainer(key, predicates.get(i));
- }
- return hasContainers;
- } else {
- return new HasContainer[]{new HasContainer(key, predicate)};
- }
- }
}
\ No newline at end of file
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ImmutablePath.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ImmutablePath.java
index 7a6b9a8..623b810 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ImmutablePath.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ImmutablePath.java
@@ -20,6 +20,7 @@
import org.apache.tinkerpop.gremlin.process.traversal.Path;
import org.apache.tinkerpop.gremlin.process.traversal.Pop;
+import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import java.io.Serializable;
import java.util.ArrayList;
@@ -217,7 +218,7 @@
@Override
public String toString() {
- return this.objects().toString();
+ return StringFactory.pathString(this);
}
@Override
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/MutablePath.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/MutablePath.java
index 168b7dc..427c601 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/MutablePath.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/MutablePath.java
@@ -20,6 +20,7 @@
import org.apache.tinkerpop.gremlin.process.traversal.Path;
import org.apache.tinkerpop.gremlin.process.traversal.Pop;
+import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import java.io.Serializable;
import java.util.ArrayList;
@@ -168,7 +169,7 @@
@Override
public String toString() {
- return this.objects.toString();
+ return StringFactory.pathString(this);
}
@Override
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
index d368322..40d9330 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
@@ -48,6 +48,8 @@
*/
public final class Parameters implements Cloneable, Serializable {
+ public static final Parameters EMPTY = new Parameters();
+
private static final Object[] EMPTY_ARRAY = new Object[0];
private Map<Object, List<Object>> parameters = new HashMap<>();
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ConsoleMutationListener.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ConsoleMutationListener.java
index 937f414..1bfdf24 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ConsoleMutationListener.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ConsoleMutationListener.java
@@ -83,11 +83,6 @@
}
@Override
- public void vertexPropertyChanged(final Vertex element, final Property oldValue, final Object setValue, final Object... vertexPropertyKeyValues) {
- // do nothing - deprecated
- }
-
- @Override
public void vertexPropertyChanged(final Vertex element, final VertexProperty oldValue, final Object setValue, final Object... vertexPropertyKeyValues) {
System.out.println("Vertex [" + element.toString() + "] property [" + oldValue + "] change to [" + setValue + "] in graph [" + graph.toString() + "]");
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/MutationListener.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/MutationListener.java
index 00e49ed..8525d5d 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/MutationListener.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/MutationListener.java
@@ -52,19 +52,10 @@
/**
* Raised after the property of a {@link Vertex} changed.
*
- * @deprecated As of release 3.2.7, replaced by {@link #vertexPropertyChanged(Vertex, VertexProperty, Object, Object...)}.
- */
- public void vertexPropertyChanged(final Vertex element, final Property oldValue, final Object setValue, final Object... vertexPropertyKeyValues);
-
- /**
- * Raised after the property of a {@link Vertex} changed.
- *
* @param element the {@link Vertex} that changed
* @param setValue the new value of the property
*/
- public default void vertexPropertyChanged(final Vertex element, final VertexProperty oldValue, final Object setValue, final Object... vertexPropertyKeyValues) {
- vertexPropertyChanged(element, (Property) oldValue, setValue, vertexPropertyKeyValues);
- }
+ public void vertexPropertyChanged(final Vertex element, final VertexProperty oldValue, final Object setValue, final Object... vertexPropertyKeyValues);
/**
* Raised after a {@link VertexProperty} was removed from the graph.
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
index c8f9d22..25a2833 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
@@ -21,7 +21,7 @@
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.MapConfiguration;
import org.apache.tinkerpop.gremlin.process.traversal.P;
-import org.apache.tinkerpop.gremlin.process.traversal.Parameterizing;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Parameterizing;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.step.HasContainerHolder;
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java
index b4824c8..094b43d 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java
@@ -57,53 +57,23 @@
*/
public final class EventStrategy extends AbstractTraversalStrategy<TraversalStrategy.DecorationStrategy> implements TraversalStrategy.DecorationStrategy {
private final EventQueue eventQueue;
- private final Class<?> detachmentFactory;
+ private final Detachment detachment;
private EventStrategy(final Builder builder) {
this.eventQueue = builder.eventQueue;
this.eventQueue.setListeners(builder.listeners);
- this.detachmentFactory = builder.detachmentFactory;
+ this.detachment = builder.detachment;
}
- public Class<?> getDetachmentFactory() {
- return this.detachmentFactory;
+ public Detachment getDetachment() {
+ return this.detachment;
}
/**
* Applies the appropriate detach operation to elements that will be raised in mutation events.
*/
public <R> R detach(final R attached) {
- if (null == detachmentFactory)
- return attached;
- else if (detachmentFactory.equals(DetachedFactory.class))
- return DetachedFactory.detach(attached, true);
- else if (detachmentFactory.equals(ReferenceFactory.class))
- return ReferenceFactory.detach(attached);
- else
- throw new IllegalStateException("Unknown detachment option using " + detachmentFactory.getSimpleName());
- }
-
- /**
- * For newly created properties that do not yet exist, an empty {@link Property} is required that just contains
- * a key as a reference.
- */
- public <R extends Property> R empty(final Element element, final String key) {
- // currently the "no detachment" model simply returns a Detached value to maintain consistency with the
- // original API that already existed (where returning "Detached" was the only option). This could probably
- // change in the future to use an "empty" property or perhaps the "change" event API could change all together
- // and have a different return.
- if (null == detachmentFactory || detachmentFactory.equals(DetachedFactory.class)) {
- if (element instanceof Vertex)
- return (R) new DetachedVertexProperty(null, key, null, null);
- else
- return (R) new DetachedProperty(key, null);
- } else if (detachmentFactory.equals(ReferenceFactory.class)) {
- if (element instanceof Vertex)
- return (R) new ReferenceVertexProperty(new DetachedVertexProperty(null, key, null, null));
- else
- return (R) new ReferenceProperty(new DetachedProperty(key, null));
- } else
- throw new IllegalStateException("Unknown empty detachment option using " + detachmentFactory.getSimpleName());
+ return (R) detachment.detach(attached);
}
@Override
@@ -132,7 +102,7 @@
public final static class Builder {
private final List<MutationListener> listeners = new ArrayList<>();
private EventQueue eventQueue = new DefaultEventQueue();
- private Class<?> detachmentFactory = DetachedFactory.class;
+ private Detachment detachment = Detachment.DETACHED_WITH_PROPERTIES;
Builder() {}
@@ -147,15 +117,11 @@
}
/**
- * Configures the method of detachment for element provided in mutation callback events. If configured with
- * {@code null} for no detachment with a transactional graph, be aware that accessing the evented elements
- * after {@code commit()} will likely open new transactions.
- *
- * @param factoryClass must be either {@code null} (for no detachment), {@link ReferenceFactory} for elements
- * with no properties or {@link DetachedFactory} for elements with properties.
+ * Configures the method of detachment for element provided in mutation callback events. The default is
+ * {@link Detachment#DETACHED_WITH_PROPERTIES}.
*/
- public Builder detach(final Class<?> factoryClass) {
- detachmentFactory = factoryClass;
+ public Builder detach(final Detachment detachment) {
+ this.detachment = detachment;
return this;
}
@@ -165,6 +131,60 @@
}
/**
+ * A common interface for detachment.
+ */
+ public interface Detacher {
+ public Object detach(final Object object);
+ }
+
+ /**
+ * Options for detaching elements from the graph during eventing.
+ */
+ public enum Detachment implements Detacher {
+ /**
+ * Does not detach the element from the graph. It should be noted that if this option is used with
+ * transactional graphs new transactions may be opened if these elements are accessed after a {@code commit()}
+ * is called.
+ */
+ NONE {
+ @Override
+ public Object detach(final Object object) {
+ return object;
+ }
+ },
+
+ /**
+ * Uses {@link DetachedFactory} to detach and includes properties of elements that have them.
+ */
+ DETACHED_WITH_PROPERTIES {
+ @Override
+ public Object detach(final Object object) {
+ return DetachedFactory.detach(object, true);
+ }
+ },
+
+ /**
+ * Uses {@link DetachedFactory} to detach and does not include properties of elements that have them.
+ */
+ DETACHED_NO_PROPERTIES {
+ @Override
+ public Object detach(final Object object) {
+ return DetachedFactory.detach(object, false);
+ }
+ },
+
+ /**
+ * Uses {@link ReferenceFactory} to detach which only includes id and label of elements.
+ */
+ REFERENCE {
+ @Override
+ public Object detach(final Object object) {
+ return ReferenceFactory.detach(object);
+ }
+ }
+ }
+
+ /**
* Gathers messages from callbacks and fires them to listeners. When the event is sent to the listener is
* up to the implementation of this interface.
*/
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
index 438d8b2..877c2df 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
@@ -21,7 +21,7 @@
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.MapConfiguration;
import org.apache.tinkerpop.gremlin.process.traversal.P;
-import org.apache.tinkerpop.gremlin.process.traversal.Parameterizing;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Parameterizing;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@ -203,7 +203,7 @@
// ends up being a Vertex or not. AddPropertyStep currently chooses to simply not bother
// to use the additional "property mutations" if the Element being mutated is a Edge or
// VertexProperty
- ((Mutating) step).addPropertyMutations(partitionKey, writePartition);
+ ((Mutating) step).configure(partitionKey, writePartition);
if (includeMetaProperties) {
// GraphTraversal folds g.addV().property('k','v') to just AddVertexStep/AddVertexStartStep so this
@@ -216,7 +216,7 @@
final VertexProperty.Cardinality cardinality = vertexFeatures.getCardinality((String) k);
v.forEach(o -> {
final AddPropertyStep addPropertyStep = new AddPropertyStep(traversal, cardinality, k, o);
- addPropertyStep.addPropertyMutations(partitionKey, writePartition);
+ addPropertyStep.configure(partitionKey, writePartition);
addPropertyStepsToAppend.add(addPropertyStep);
// need to remove the parameter from the AddVertex/StartStep because it's now being added
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Element.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Element.java
index 2f752a3..761e3ba 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Element.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Element.java
@@ -144,14 +144,5 @@
public static IllegalArgumentException labelCanNotBeAHiddenKey(final String label) {
return new IllegalArgumentException("Label can not be a hidden key: " + label);
}
-
- /**
- * @deprecated As of release 3.1.0, not replaced - this exception is no longer enforced by the test suite.
- * @see <a href="https://issues.apache.org/jira/browse/TINKERPOP-297">TINKERPOP-297</a>
- */
- @Deprecated
- public static IllegalStateException elementAlreadyRemoved(final Class<? extends Element> clazz, final Object id) {
- return new IllegalStateException(String.format("%s with id %s was removed.", clazz.getSimpleName(), id));
- }
}
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
index 5dec1a5..dc14cc6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
@@ -21,10 +21,8 @@
import org.apache.commons.configuration.Configuration;
import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine;
import org.apache.tinkerpop.gremlin.structure.io.Io;
import org.apache.tinkerpop.gremlin.structure.io.IoRegistry;
import org.apache.tinkerpop.gremlin.structure.util.FeatureDescriptor;
@@ -42,7 +40,6 @@
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
-import java.util.NoSuchElementException;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
@@ -506,6 +503,7 @@
public static final String FEATURE_DUPLICATE_MULTI_PROPERTIES = "DuplicateMultiProperties";
public static final String FEATURE_META_PROPERTIES = "MetaProperties";
public static final String FEATURE_REMOVE_VERTICES = "RemoveVertices";
+ public static final String FEATURE_UPSERT = "Upsert";
/**
* Gets the {@link VertexProperty.Cardinality} for a key. By default, this method will return
@@ -567,6 +565,20 @@
}
/**
+ * Determines if the {@code Graph} implementation uses upsert functionality as opposed to insert
+ * functionality for {@link #addVertex(String)}. This feature gives graph providers some flexibility as
+ * to how graph mutations are treated. For graph providers, testing of this feature (as far as TinkerPop
+ * is concerned) only covers graphs that can support user supplied identifiers as there is no other way
+ * for TinkerPop to know what aspect of a vertex is unique to appropriately apply assertions. Graph
+ * providers, especially those who support schema features, may have other methods for uniquely identifying
+ * a vertex and should therefore resort to their own body of tests to validate this feature.
+ */
+ @FeatureDescriptor(name = FEATURE_UPSERT)
+ public default boolean supportsUpsert() {
+ return false;
+ }
+
+ /**
* Gets features related to "properties" on a {@link Vertex}.
*/
public default VertexPropertyFeatures properties() {
@@ -581,6 +593,7 @@
public interface EdgeFeatures extends ElementFeatures {
public static final String FEATURE_ADD_EDGES = "AddEdges";
public static final String FEATURE_REMOVE_EDGES = "RemoveEdges";
+ public static final String FEATURE_UPSERT = "Upsert";
/**
* Determines if an {@link Edge} can be added to a {@code Vertex}.
@@ -599,6 +612,21 @@
}
/**
+ * Determines if the {@code Graph} implementation uses upsert functionality as opposed to insert
+ * functionality for {@link Vertex#addEdge(String, Vertex, Object...)}. This feature gives graph providers
+ * some flexibility as to how graph mutations are treated. For graph providers, testing of this feature
+ * (as far as TinkerPop is concerned) only covers graphs that can support user supplied identifiers as
+ * there is no other way for TinkerPop to know what aspect of a edge is unique to appropriately apply
+ * assertions. Graph providers, especially those who support schema features, may have other methods for
+ * uniquely identifying a edge and should therefore resort to their own body of tests to validate this
+ * feature.
+ */
+ @FeatureDescriptor(name = FEATURE_UPSERT)
+ public default boolean supportsUpsert() {
+ return false;
+ }
+
+ /**
* Gets features related to "properties" on an {@link Edge}.
*/
public default EdgePropertyFeatures properties() {
@@ -1120,11 +1148,6 @@
return new UnsupportedOperationException("Graph does not support graph computer");
}
- @Deprecated
- public static IllegalArgumentException traversalEngineNotSupported(final TraversalEngine engine) {
- return new IllegalArgumentException("Graph does not support the provided traversal engine: " + engine.getClass().getCanonicalName());
- }
-
public static IllegalArgumentException graphDoesNotSupportProvidedGraphComputer(final Class graphComputerClass) {
return new IllegalArgumentException("Graph does not support the provided graph computer: " + graphComputerClass.getSimpleName());
}
@@ -1148,34 +1171,6 @@
public static IllegalArgumentException argumentCanNotBeNull(final String argument) {
return new IllegalArgumentException(String.format("The provided argument can not be null: %s", argument));
}
-
- /**
- * Deprecated as of 3.2.3, not replaced.
- *
- * @see <a href="https://issues.apache.org/jira/browse/TINKERPOP-944">TINKERPOP-944</a>
- */
- @Deprecated
- public static NoSuchElementException elementNotFound(final Class<? extends Element> elementClass, final Object id) {
- return (null == id) ?
- new NoSuchElementException("The " + elementClass.getSimpleName().toLowerCase() + " with id null does not exist in the graph") :
- new NoSuchElementException("The " + elementClass.getSimpleName().toLowerCase() + " with id " + id + " of type " + id.getClass().getSimpleName() + " does not exist in the graph");
- }
-
- /**
- * Deprecated as of 3.2.3, not replaced.
- *
- * @see <a href="https://issues.apache.org/jira/browse/TINKERPOP-944">TINKERPOP-944</a>
- */
- @Deprecated
- public static NoSuchElementException elementNotFound(final Class<? extends Element> elementClass, final Object id, final Exception rootCause) {
- NoSuchElementException elementNotFoundException;
- if (null == id)
- elementNotFoundException = new NoSuchElementException("The " + elementClass.getSimpleName().toLowerCase() + " with id null does not exist in the graph");
- else
- elementNotFoundException = new NoSuchElementException("The " + elementClass.getSimpleName().toLowerCase() + " with id " + id + " of type " + id.getClass().getSimpleName() + " does not exist in the graph");
- elementNotFoundException.initCause(rootCause);
- return elementNotFoundException;
- }
}
/**
@@ -1243,7 +1238,7 @@
/**
* The list of {@link GraphComputer} implementations by class name that a test should opt-out from using (i.e. other
* graph computers not in this list will execute the test). This setting should only be included when
- * the test is one that uses the {@link ComputerTraversalEngine} - it will otherwise be ignored. By
+ * the test is one that uses the {@code TraversalEngine.COMPUTER} - it will otherwise be ignored. By
* default, an empty array is assigned and it is thus assumed that all computers are excluded when an
* {@code OptOut} annotation is used, therefore this value must be overridden to be more specific.
*/
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/StringFactory.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/StringFactory.java
index 68973a8..ad953c3 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/StringFactory.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/StringFactory.java
@@ -26,6 +26,7 @@
import org.apache.tinkerpop.gremlin.process.computer.Memory;
import org.apache.tinkerpop.gremlin.process.computer.VertexProgram;
import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.Path;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.Translator;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
@@ -40,6 +41,7 @@
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.util.function.FunctionUtils;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import org.javatuples.Pair;
import java.lang.reflect.Method;
@@ -53,7 +55,6 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
-
/**
* A collection of helpful methods for creating standard {@link Object#toString()} representations of graph-related
* objects.
@@ -66,6 +67,7 @@
private static final String E = "e";
private static final String P = "p";
private static final String VP = "vp";
+ private static final String PATH = "path";
private static final String L_BRACKET = "[";
private static final String R_BRACKET = "]";
private static final String COMMA_SPACE = ", ";
@@ -176,7 +178,7 @@
}
public static String translatorString(final Translator translator) {
- return "translator[" + translator.getTraversalSource() + ":" + translator.getTargetLanguage() + "]";
+ return "translator" + L_BRACKET + translator.getTraversalSource() + ":" + translator.getTargetLanguage() + R_BRACKET;
}
public static String vertexProgramString(final VertexProgram vertexProgram, final String internalString) {
@@ -252,4 +254,7 @@
return string.substring(1, string.length() - 1);
}
+ public static String pathString(final Path path) {
+ return PATH + L_BRACKET + String.join(", ", IteratorUtils.map(path, Object::toString)) + R_BRACKET;
+ }
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/empty/EmptyVertexProperty.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/empty/EmptyVertexProperty.java
index a77fd6f..c7a5b44 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/empty/EmptyVertexProperty.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/empty/EmptyVertexProperty.java
@@ -90,7 +90,7 @@
}
@Override
- public <U> Iterator<Property<U>> properties(String... propertyKeys) {
+ public <U> Iterator<Property<U>> properties(final String... propertyKeys) {
return Collections.emptyIterator();
}
}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/keyed/KeyedProperty.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/keyed/KeyedProperty.java
new file mode 100644
index 0000000..5532f06
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/keyed/KeyedProperty.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.structure.util.keyed;
+
+import org.apache.tinkerpop.gremlin.structure.Element;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
+
+import java.util.NoSuchElementException;
+
+/**
+ * A utility implementation of a {@link Property} that only has a key but no value.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public final class KeyedProperty<V> implements Property<V> {
+
+ private final String key;
+
+ public KeyedProperty(final String key) {
+ if (null == key || key.isEmpty()) throw new IllegalArgumentException("key cannot be null");
+ this.key = key;
+ }
+
+ @Override
+ public String key() {
+ return this.key;
+ }
+
+ @Override
+ public V value() throws NoSuchElementException {
+ throw Exceptions.propertyDoesNotExist();
+ }
+
+ @Override
+ public boolean isPresent() {
+ return false;
+ }
+
+ @Override
+ public Element element() {
+ throw Exceptions.propertyDoesNotExist();
+ }
+
+ @Override
+ public void remove() {
+
+ }
+
+ @Override
+ public String toString() {
+ return StringFactory.propertyString(this);
+ }
+
+ @Override
+ public boolean equals(final Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ final KeyedProperty<?> that = (KeyedProperty<?>) o;
+
+ return key.equals(that.key);
+ }
+
+ @Override
+ public int hashCode() {
+ return key.hashCode();
+ }
+}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/keyed/KeyedVertexProperty.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/keyed/KeyedVertexProperty.java
new file mode 100644
index 0000000..53cba69
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/keyed/KeyedVertexProperty.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.structure.util.keyed;
+
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * A utility implementation of a {@link Property} that only has a key but no value and no meta-properties.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public final class KeyedVertexProperty<V> implements VertexProperty<V> {
+
+ private final String key;
+
+ public KeyedVertexProperty(final String key) {
+ if (null == key || key.isEmpty()) throw new IllegalArgumentException("key cannot be null");
+ this.key = key;
+ }
+
+ @Override
+ public Vertex element() {
+ throw Property.Exceptions.propertyDoesNotExist();
+ }
+
+ @Override
+ public Object id() {
+ throw Property.Exceptions.propertyDoesNotExist();
+ }
+
+ @Override
+ public Graph graph() {
+ throw Property.Exceptions.propertyDoesNotExist();
+ }
+
+ @Override
+ public <U> Property<U> property(String key) {
+ return Property.<U>empty();
+ }
+
+ @Override
+ public <U> Property<U> property(String key, U value) {
+ return Property.<U>empty();
+ }
+
+ @Override
+ public String key() {
+ return this.key;
+ }
+
+ @Override
+ public V value() throws NoSuchElementException {
+ throw Property.Exceptions.propertyDoesNotExist();
+ }
+
+ @Override
+ public boolean isPresent() {
+ return false;
+ }
+
+ @Override
+ public void remove() {
+
+ }
+
+ @Override
+ public String toString() {
+ return StringFactory.propertyString(this);
+ }
+
+ @Override
+ public <U> Iterator<Property<U>> properties(final String... propertyKeys) {
+ return Collections.emptyIterator();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ final KeyedVertexProperty<?> that = (KeyedVertexProperty<?>) o;
+
+ return key.equals(that.key);
+ }
+
+ @Override
+ public int hashCode() {
+ return key.hashCode();
+ }
+}
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/NumberHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/NumberHelper.java
index efd446b..aaf066a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/NumberHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/NumberHelper.java
@@ -345,11 +345,33 @@
return getHelper(clazz).min.apply(a, b);
}
+ public static Comparable min(final Comparable a, final Comparable b) {
+ if (a instanceof Number && b instanceof Number) {
+ final Number an = (Number) a, bn = (Number) b;
+ final Class<? extends Number> clazz = getHighestCommonNumberClass(an, bn);
+ return (Comparable) getHelper(clazz).min.apply(an, bn);
+ }
+ return isNonValue(a) ? b :
+ isNonValue(b) ? a :
+ a.compareTo(b) < 0 ? a : b;
+ }
+
public static Number max(final Number a, final Number b) {
final Class<? extends Number> clazz = getHighestCommonNumberClass(a, b);
return getHelper(clazz).max.apply(a, b);
}
+ public static Comparable max(final Comparable a, final Comparable b) {
+ if (a instanceof Number && b instanceof Number) {
+ final Number an = (Number) a, bn = (Number) b;
+ final Class<? extends Number> clazz = getHighestCommonNumberClass(an, bn);
+ return (Comparable) getHelper(clazz).max.apply(an, bn);
+ }
+ return isNonValue(a) ? b :
+ isNonValue(b) ? a :
+ a.compareTo(b) > 0 ? a : b;
+ }
+
public static Integer compare(final Number a, final Number b) {
final Class<? extends Number> clazz = getHighestCommonNumberClass(a, b);
return getHelper(clazz).cmp.apply(a, b);
@@ -415,4 +437,8 @@
private static boolean isNumber(final Number number) {
return number != null && !number.equals(Double.NaN);
}
+
+ private static boolean isNonValue(final Object value) {
+ return value instanceof Double && !isNumber((Double) value);
+ }
}
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/OperatorExceptionTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/OperatorExceptionTest.java
index 9aa1339..513d04f 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/OperatorExceptionTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/OperatorExceptionTest.java
@@ -31,16 +31,6 @@
}
@Test(expected = ClassCastException.class)
- public void shouldThrowIfValueToMaxIsNotNumeric() {
- Operator.max.apply("1", "1");
- }
-
- @Test(expected = ClassCastException.class)
- public void shouldThrowIfValueToMinIsNotNumeric() {
- Operator.min.apply("1", "1");
- }
-
- @Test(expected = ClassCastException.class)
public void shouldThrowIfValueToMinusIsNotNumeric() {
Operator.minus.apply("1", "1");
}
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/OperatorTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/OperatorTest.java
index 38f7742..e498cae 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/OperatorTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/OperatorTest.java
@@ -38,7 +38,7 @@
/**
* Required to verify that Operator can handle Number type, that it doesn't know explicitly.
*/
- static class CustomNumber extends Number {
+ static class CustomNumber extends Number implements Comparable<CustomNumber> {
public final static CustomNumber ONE = new CustomNumber(1);
public final static CustomNumber TEN = new CustomNumber(10);
@@ -68,6 +68,11 @@
public double doubleValue() {
return n;
}
+
+ @Override
+ public int compareTo(final CustomNumber anotherCustomNumber) {
+ return Integer.compare(n, anotherCustomNumber.n);
+ }
}
@Parameterized.Parameters(name = "{0}({1},{2}) = {3}")
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java
index 6decbe0..9009d0b 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java
@@ -42,7 +42,7 @@
public class GraphTraversalTest {
private static final Logger logger = LoggerFactory.getLogger(GraphTraversalTest.class);
- private static Set<String> NO_GRAPH = new HashSet<>(Arrays.asList("asAdmin", "by", "option", "iterate", "to", "from", "profile", "pageRank", "peerPressure", "program", "none"));
+ private static Set<String> NO_GRAPH = new HashSet<>(Arrays.asList("asAdmin", "by", "with", "option", "iterate", "to", "from", "profile", "pageRank", "peerPressure", "program", "none"));
private static Set<String> NO_ANONYMOUS = new HashSet<>(Arrays.asList("start", "__"));
private static Set<String> IGNORES_BYTECODE = new HashSet<>(Arrays.asList("asAdmin", "iterate", "mapValues", "mapKeys"));
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java
index 9061258..9b204cf 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java
@@ -20,7 +20,6 @@
import org.apache.tinkerpop.gremlin.process.traversal.P;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.process.traversal.step.StepTest;
@@ -200,7 +199,7 @@
// MAKE SURE THE SORT ORDER CHANGES AS MORE RESULTS ARE RETURNED BY ONE OR THE OTHER TRAVERSAL
Traversal.Admin<?, ?> traversal = __.match(as("a").out().as("b"), as("c").in().as("d")).asAdmin();
MatchStep.CountMatchAlgorithm countMatchAlgorithm = new MatchStep.CountMatchAlgorithm();
- countMatchAlgorithm.initialize(TraversalEngine.Type.STANDARD, ((MatchStep<?, ?>) traversal.getStartStep()).getGlobalChildren());
+ countMatchAlgorithm.initialize(false, ((MatchStep<?, ?>) traversal.getStartStep()).getGlobalChildren());
Traversal.Admin<Object, Object> firstPattern = ((MatchStep<?, ?>) traversal.getStartStep()).getGlobalChildren().get(0);
Traversal.Admin<Object, Object> secondPattern = ((MatchStep<?, ?>) traversal.getStartStep()).getGlobalChildren().get(1);
//
@@ -246,7 +245,7 @@
/////// MAKE SURE WHERE PREDICATE TRAVERSALS ARE ALWAYS FIRST AS THEY ARE SIMPLY .hasNext() CHECKS
traversal = __.match(as("a").out().as("b"), as("c").in().as("d"), where("a", P.eq("b"))).asAdmin();
countMatchAlgorithm = new MatchStep.CountMatchAlgorithm();
- countMatchAlgorithm.initialize(TraversalEngine.Type.STANDARD, ((MatchStep<?, ?>) traversal.getStartStep()).getGlobalChildren());
+ countMatchAlgorithm.initialize(false, ((MatchStep<?, ?>) traversal.getStartStep()).getGlobalChildren());
assertEquals(3, countMatchAlgorithm.bundles.size());
firstPattern = ((MatchStep<?, ?>) traversal.getStartStep()).getGlobalChildren().get(0);
secondPattern = ((MatchStep<?, ?>) traversal.getStartStep()).getGlobalChildren().get(1);
@@ -334,7 +333,7 @@
.asAdmin();
traversal.applyStrategies(); // necessary to enure step ids are unique
final MatchStep.CountMatchAlgorithm countMatchAlgorithm = new MatchStep.CountMatchAlgorithm();
- countMatchAlgorithm.initialize(TraversalEngine.Type.COMPUTER, ((MatchStep<?, ?>) traversal.getStartStep()).getGlobalChildren());
+ countMatchAlgorithm.initialize(true, ((MatchStep<?, ?>) traversal.getStartStep()).getGlobalChildren());
Traversal.Admin<Object, Object> firstPattern = ((MatchStep<?, ?>) traversal.getStartStep()).getGlobalChildren().get(0);
Traversal.Admin<Object, Object> secondPattern = ((MatchStep<?, ?>) traversal.getStartStep()).getGlobalChildren().get(1);
Traversal.Admin<Object, Object> thirdPattern = ((MatchStep<?, ?>) traversal.getStartStep()).getGlobalChildren().get(2);
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyTest.java
index 27d9b7e..911ef41 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyTest.java
@@ -23,7 +23,6 @@
import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.ConsoleMutationListener;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.MutationListener;
-import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/gremlin-dotnet/pom.xml b/gremlin-dotnet/pom.xml
index 38f3d70..0f66b02 100644
--- a/gremlin-dotnet/pom.xml
+++ b/gremlin-dotnet/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-dotnet</artifactId>
<name>Apache TinkerPop :: Gremlin.Net</name>
diff --git a/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.csproj b/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.csproj
index 22de9c6..3748e83 100644
--- a/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.csproj
+++ b/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.csproj
@@ -27,7 +27,7 @@
<ItemGroup>
<!-- We need both reference elements until this is resolved: https://github.com/dotnet/sdk/issues/1151 -->
<ProjectReference Include="../Gremlin.Net/Gremlin.Net.csproj" />
- <PackageReference Include="Gremlin.Net" Version="3.3.4-SNAPSHOT" />
+ <PackageReference Include="Gremlin.Net" Version="3.4.0-SNAPSHOT" />
</ItemGroup>
</Project>
diff --git a/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.nuspec b/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.nuspec
index ddb50d8..90cceb6 100644
--- a/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.nuspec
+++ b/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.nuspec
@@ -3,7 +3,7 @@
<metadata>
<id>Gremlin.Net.Template</id>
<title>Gremlin.Net Template</title>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
<description>Gremlin.Net template to create a console application with dotnet new.</description>
<authors>Apache TinkerPop</authors>
<licenseUrl>https://github.com/apache/tinkerpop/blob/master/LICENSE</licenseUrl>
diff --git a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
index 772eb8e..2a13e88 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
+++ b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
@@ -25,9 +25,9 @@
</PropertyGroup>
<PropertyGroup Label="Package">
- <Version>3.3.4-SNAPSHOT</Version>
- <FileVersion>3.3.4.0</FileVersion>
- <AssemblyVersion>3.3.0.0</AssemblyVersion>
+ <Version>3.4.0-SNAPSHOT</Version>
+ <FileVersion>3.4.0.0</FileVersion>
+ <AssemblyVersion>3.4.0.0</AssemblyVersion>
<Title>Gremlin.Net</Title>
<Authors>Apache TinkerPop</Authors>
<Description>Gremlin.Net for Apache TinkerPop™ is a language variant and driver for .NET.
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/Path.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/Path.cs
index a9f2698..d205a88 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/Path.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/Path.cs
@@ -111,7 +111,7 @@
/// <inheritdoc />
public override string ToString()
{
- return $"[{string.Join(", ", Objects)}]";
+ return $"path[{string.Join(", ", Objects)}]";
}
/// <summary>
diff --git a/gremlin-dotnet/src/pom.xml b/gremlin-dotnet/src/pom.xml
index e390ef9..0f4f945 100644
--- a/gremlin-dotnet/src/pom.xml
+++ b/gremlin-dotnet/src/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-dotnet</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-dotnet-source</artifactId>
<name>Apache TinkerPop :: Gremlin.Net - Source</name>
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
index 787cca9..6716fa1 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
@@ -383,4 +383,4 @@
return rootDir.FullName;
}
}
-}
\ No newline at end of file
+}
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
index c93630f..b9824ad 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
@@ -241,7 +241,7 @@
Path readPath = reader.ToObject(JObject.Parse(graphSon));
- Assert.Equal("[v[1], v[3], lop]", readPath.ToString());
+ Assert.Equal("path[v[1], v[3], lop]", readPath.ToString());
Assert.Equal(new Vertex(1), readPath[0]);
Assert.Equal(new Vertex(1), readPath["a"]);
Assert.Equal("lop", readPath[2]);
@@ -258,7 +258,7 @@
Path readPath = reader.ToObject(JObject.Parse(graphSon));
- Assert.Equal("[v[5]]", readPath.ToString());
+ Assert.Equal("path[v[5]]", readPath.ToString());
Assert.Equal(new Vertex(5L), readPath[0]);
Assert.Equal(new Vertex(5L), readPath["z"]);
Assert.Equal(1, readPath.Count);
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/PathTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/PathTests.cs
index cbc3f8d..6df92ba 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/PathTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/PathTests.cs
@@ -364,7 +364,7 @@
var pathStr = path.ToString();
- Assert.Equal("[1, v[1], hello]", pathStr);
+ Assert.Equal("path[1, v[1], hello]", pathStr);
}
[Fact]
diff --git a/gremlin-dotnet/test/pom.xml b/gremlin-dotnet/test/pom.xml
index 624496a..9e226c9 100644
--- a/gremlin-dotnet/test/pom.xml
+++ b/gremlin-dotnet/test/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-dotnet</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-dotnet-tests</artifactId>
<name>Apache TinkerPop :: Gremlin.Net - Tests</name>
diff --git a/gremlin-driver/pom.xml b/gremlin-driver/pom.xml
index 738a338..5bb6ac0 100644
--- a/gremlin-driver/pom.xml
+++ b/gremlin-driver/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-driver</artifactId>
<name>Apache TinkerPop :: Gremlin Driver</name>
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java
index 3da8663..7ef92ac 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java
@@ -94,18 +94,6 @@
* server to a variable called "g" for the context of the requests made through that {@code Client}.
*
* @param graphOrTraversalSource rebinds the specified global Gremlin Server variable to "g"
- * @deprecated As of release 3.1.0, replaced by {@link #alias(String)}
- */
- @Deprecated
- public Client rebind(final String graphOrTraversalSource) {
- return alias(graphOrTraversalSource);
- }
-
- /**
- * Create a new {@code Client} that aliases the specified {@link Graph} or {@link TraversalSource} name on the
- * server to a variable called "g" for the context of the requests made through that {@code Client}.
- *
- * @param graphOrTraversalSource rebinds the specified global Gremlin Server variable to "g"
*/
public Client alias(final String graphOrTraversalSource) {
return alias(makeDefaultAliasMap(graphOrTraversalSource));
@@ -116,16 +104,6 @@
* one or more globally defined {@link Graph} or {@link TraversalSource} server bindings for the context of
* the created {@code Client}.
*/
- @Deprecated
- public Client rebind(final Map<String,String> rebindings) {
- return alias(rebindings);
- }
-
- /**
- * Creates a {@code Client} that supplies the specified set of aliases, thus allowing the user to re-name
- * one or more globally defined {@link Graph} or {@link TraversalSource} server bindings for the context of
- * the created {@code Client}.
- */
public Client alias(final Map<String,String> aliases) {
return new AliasClusteredClient(this, aliases, settings);
}
@@ -444,15 +422,6 @@
* {@inheritDoc}
*/
@Override
- @Deprecated
- public Client rebind(final String graphOrTraversalSource) {
- return alias(graphOrTraversalSource);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public Client alias(final String graphOrTraversalSource) {
final Map<String,String> aliases = new HashMap<>();
aliases.put("g", graphOrTraversalSource);
@@ -460,16 +429,6 @@
}
/**
- * Creates a {@code Client} that supplies the specified set of aliases, thus allowing the user to re-name
- * one or more globally defined {@link Graph} or {@link TraversalSource} server bindings for the context of
- * the created {@code Client}.
- */
- @Deprecated
- public Client rebind(final Map<String,String> rebindings) {
- return alias(rebindings);
- }
-
- /**
* {@inheritDoc}
*/
@Override
@@ -541,30 +500,15 @@
* Uses a {@link org.apache.tinkerpop.gremlin.driver.Client.ClusteredClient} that rebinds requests to a
* specified {@link Graph} or {@link TraversalSource} instances on the server-side.
*/
- public final static class AliasClusteredClient extends ReboundClusteredClient {
- public AliasClusteredClient(final Client client, final Map<String, String> rebindings,
- final Client.Settings settings) {
- super(client, rebindings, settings);
- }
- }
-
- /**
- * Uses a {@link org.apache.tinkerpop.gremlin.driver.Client.ClusteredClient} that rebinds requests to a
- * specified {@link Graph} or {@link TraversalSource} instances on the server-side.
- *
- * @deprecated As of release 3.1.1-incubating, replaced by {@link AliasClusteredClient}.
- */
- @Deprecated
- public static class ReboundClusteredClient extends Client {
+ public static class AliasClusteredClient extends Client {
private final Client client;
private final Map<String,String> aliases = new HashMap<>();
final CompletableFuture<Void> close = new CompletableFuture<>();
- ReboundClusteredClient(final Client client, final Map<String,String> rebindings,
- final Client.Settings settings) {
+ AliasClusteredClient(final Client client, final Map<String,String> aliases, final Client.Settings settings) {
super(client.cluster, settings);
this.client = client;
- this.aliases.putAll(rebindings);
+ this.aliases.putAll(aliases);
}
@Override
@@ -644,15 +588,6 @@
* {@inheritDoc}
*/
@Override
- @Deprecated
- public Client rebind(final String graphOrTraversalSource) {
- return alias(graphOrTraversalSource);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public Client alias(final Map<String, String> aliases) {
if (close.isDone()) throw new IllegalStateException("Client is closed");
return new AliasClusteredClient(client, aliases, settings);
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Tokens.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Tokens.java
index 9dfc4bd..0a8b4d0 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Tokens.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Tokens.java
@@ -50,12 +50,6 @@
public static final String ARGS_AGGREGATE_TO = "aggregateTo";
public static final String ARGS_SIDE_EFFECT_KEY = "sideEffectKey";
- /**
- * @deprecated As of release 3.1.0-incubating, replaced by {@link #ARGS_ALIASES}.
- */
- @Deprecated
- public static final String ARGS_REBINDINGS = "rebindings";
-
public static final String VAL_AGGREGATE_TO_BULKSET = "bulkset";
public static final String VAL_AGGREGATE_TO_LIST = "list";
public static final String VAL_AGGREGATE_TO_MAP = "map";
diff --git a/gremlin-groovy/pom.xml b/gremlin-groovy/pom.xml
index ea0556c..f2be939 100644
--- a/gremlin-groovy/pom.xml
+++ b/gremlin-groovy/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-groovy</artifactId>
<name>Apache TinkerPop :: Gremlin Groovy</name>
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
index 03ea883..e2af3aa 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
@@ -29,7 +29,6 @@
import groovy.lang.MissingPropertyException;
import groovy.lang.Script;
import groovy.lang.Tuple;
-import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.tinkerpop.gremlin.groovy.loaders.GremlinLoader;
import org.apache.tinkerpop.gremlin.jsr223.ConcurrentBindings;
import org.apache.tinkerpop.gremlin.jsr223.CoreGremlinPlugin;
@@ -89,8 +88,7 @@
* @author Stephen Mallette (http://stephen.genoprime.com)
* @see org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor
*/
-public class GremlinGroovyScriptEngine extends GroovyScriptEngineImpl
- implements AutoCloseable, GremlinScriptEngine {
+public class GremlinGroovyScriptEngine extends GroovyScriptEngineImpl implements GremlinScriptEngine {
private static final Logger log = LoggerFactory.getLogger(GremlinGroovyScriptEngine.class);
/**
@@ -310,15 +308,6 @@
}
/**
- * @deprecated As of release 3.2.4, not replaced as this class will not implement {@code AutoCloseable} in the
- * future.
- */
- @Override
- @Deprecated
- public void close() throws Exception {
- }
-
- /**
* Resets the entire {@code GremlinGroovyScriptEngine} by clearing script caches, recreating the classloader,
* clearing bindings.
*/
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraph.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraph.java
deleted file mode 100644
index 0ae8e00..0000000
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraph.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential;
-
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.T;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.mindrot.jbcrypt.BCrypt;
-
-import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.drop;
-
-/**
- * A DSL for managing a "credentials graph" used by Gremlin Server for simple authentication functions. If the
- * {@link Graph} is transactional, new transactions will be started for each method call.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- * @deprecated As of release 3.3.3, replaced by {@link CredentialTraversalDsl}.
- */
-@Deprecated
-public class CredentialGraph {
-
- private final int BCRYPT_ROUNDS = 4;
- private final Graph graph;
- private final GraphTraversalSource g;
- private final boolean supportsTransactions;
-
- public CredentialGraph(final Graph graph) {
- this.graph = graph;
- g = graph.traversal();
- supportsTransactions = graph.features().graph().supportsTransactions();
- }
-
- /**
- * Finds a user by username and return {@code null} if one could not be found.
- *
- * @throws IllegalStateException if there is more than one user with a particular username.
- */
- public Vertex findUser(final String username) {
- if (supportsTransactions) g.tx().rollback();
- final GraphTraversal<Vertex,Vertex> t = g.V().has(CredentialGraphTokens.PROPERTY_USERNAME, username);
- final Vertex v = t.hasNext() ? t.next() : null;
- if (t.hasNext()) throw new IllegalStateException(String.format("Multiple users with username %s", username));
- return v;
- }
-
- /**
- * Creates a new user.
- *
- * @return the newly created user vertex
- */
- public Vertex createUser(final String username, final String password) {
- if (findUser(username) != null) throw new IllegalStateException("User with this name already exists");
- if (supportsTransactions) graph.tx().rollback();
-
- try {
- final Vertex v = graph.addVertex(T.label, CredentialGraphTokens.VERTEX_LABEL_USER,
- CredentialGraphTokens.PROPERTY_USERNAME, username,
- CredentialGraphTokens.PROPERTY_PASSWORD, BCrypt.hashpw(password, BCrypt.gensalt(BCRYPT_ROUNDS)));
- if (supportsTransactions) graph.tx().commit();
- return v;
- } catch (Exception ex) {
- if (supportsTransactions) graph.tx().rollback();
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * Removes a user by name.
- *
- * @return the number of users removed (which should be one or zero)
- */
- public long removeUser(final String username) {
- if (supportsTransactions) graph.tx().rollback();
- try {
- final long count = g.V().has(CredentialGraphTokens.PROPERTY_USERNAME, username).sideEffect(drop()).count().next();
- if (supportsTransactions) graph.tx().commit();
- return count;
- } catch (Exception ex) {
- if (supportsTransactions) graph.tx().rollback();
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * Get a count of the number of users in the database.
- */
- public long countUsers() {
- if (supportsTransactions) graph.tx().rollback();
- return g.V().hasLabel(CredentialGraphTokens.VERTEX_LABEL_USER).count().next();
- }
-
- @Override
- public String toString() {
- return "CredentialGraph{" +
- "graph=" + graph +
- '}';
- }
-
- /**
- * Wrap up any {@link Graph} instance in the {@code CredentialGraph} DSL.
- */
- public static CredentialGraph credentials(final Graph graph) {
- return new CredentialGraph(graph);
- }
-}
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphGremlinPlugin.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphGremlinPlugin.java
index e36dff9..1bafbee 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphGremlinPlugin.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphGremlinPlugin.java
@@ -38,11 +38,9 @@
static {
try {
imports = DefaultImportCustomizer.build()
- .addClassImports(CredentialGraph.class)
.addClassImports(CredentialTraversalDsl.class)
.addClassImports(CredentialTraversal.class)
.addClassImports(CredentialTraversalSource.class)
- .addMethodImports(CredentialGraph.class.getMethod("credentials", Graph.class))
.create();
} catch (Exception ex) {
throw new RuntimeException(ex);
diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineCompileStaticTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineCompileStaticTest.java
index b5949a2..f6bea6e 100644
--- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineCompileStaticTest.java
+++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineCompileStaticTest.java
@@ -37,12 +37,12 @@
@Test
public void shouldCompileStatic() throws Exception {
// with no type checking this should pass
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine()) {
- assertEquals(255, scriptEngine.eval("((Object) new java.awt.Color(255, 255, 255)).getRed()"));
- }
+ GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine();
+ assertEquals(255, scriptEngine.eval("((Object) new java.awt.Color(255, 255, 255)).getRed()"));
final CompileStaticGroovyCustomizer provider = new CompileStaticGroovyCustomizer();
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(provider)) {
+ scriptEngine = new GremlinGroovyScriptEngine(provider);
+ try {
scriptEngine.eval("((Object) new java.awt.Color(255, 255, 255)).getRed()");
fail("Should have failed type checking");
} catch (ScriptException se) {
@@ -56,13 +56,13 @@
public void shouldCompileStaticWithExtension() throws Exception {
// with no type checking extension this should pass
final CompileStaticGroovyCustomizer providerNoExtension = new CompileStaticGroovyCustomizer();
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerNoExtension)) {
- assertEquals(255, scriptEngine.eval("def c = new java.awt.Color(255, 255, 255); c.red"));
- }
+ GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerNoExtension);
+ assertEquals(255, scriptEngine.eval("def c = new java.awt.Color(255, 255, 255); c.red"));
final CompileStaticGroovyCustomizer providerWithExtension = new CompileStaticGroovyCustomizer(
PrecompiledExtensions.PreventColorUsageExtension.class.getName());
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerWithExtension)) {
+ scriptEngine = new GremlinGroovyScriptEngine(providerWithExtension);
+ try {
scriptEngine.eval("def c = new java.awt.Color(255, 255, 255); c.red");
fail("Should have failed type checking");
} catch (ScriptException se) {
@@ -75,15 +75,15 @@
public void shouldCompileStaticWithMultipleExtension() throws Exception {
// with no type checking extension this should pass
final CompileStaticGroovyCustomizer providerNoExtension = new CompileStaticGroovyCustomizer();
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerNoExtension)) {
- assertEquals(255, scriptEngine.eval("def c = new java.awt.Color(255, 255, 255); c.red"));
- assertEquals(1l, scriptEngine.eval("def c = new java.util.concurrent.CountDownLatch(1); c.count"));
- }
+ GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerNoExtension);
+ assertEquals(255, scriptEngine.eval("def c = new java.awt.Color(255, 255, 255); c.red"));
+ assertEquals(1l, scriptEngine.eval("def c = new java.util.concurrent.CountDownLatch(1); c.count"));
final CompileStaticGroovyCustomizer providerWithExtension = new CompileStaticGroovyCustomizer(
PrecompiledExtensions.PreventColorUsageExtension.class.getName() +
"," + PrecompiledExtensions.PreventCountDownLatchUsageExtension.class.getName());
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerWithExtension)) {
+ scriptEngine = new GremlinGroovyScriptEngine(providerWithExtension);
+ try {
scriptEngine.eval("def c = new java.awt.Color(255, 255, 255); c.red");
fail("Should have failed type checking");
} catch (ScriptException se) {
@@ -91,7 +91,8 @@
assertThat(se.getMessage(), containsString("Method call is not allowed!"));
}
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerWithExtension)) {
+ scriptEngine = new GremlinGroovyScriptEngine(providerWithExtension);
+ try {
scriptEngine.eval("def c = new java.util.concurrent.CountDownLatch(1); c.count");
fail("Should have failed type checking");
} catch (ScriptException se) {
diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineFileSandboxTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineFileSandboxTest.java
index 12925b8..c92581a 100644
--- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineFileSandboxTest.java
+++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineFileSandboxTest.java
@@ -70,35 +70,33 @@
final File f = TestHelper.generateTempFileFromResource(graph.getClass(), GremlinGroovyScriptEngineFileSandboxTest.class, "sandbox-empty-static-variable-types.yaml", ".yaml");
System.setProperty(FileSandboxExtension.GREMLIN_SERVER_SANDBOX, f.getAbsolutePath());
final CompileStaticGroovyCustomizer standardSandbox = new CompileStaticGroovyCustomizer(FileSandboxExtension.class.getName());
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox)) {
- assertEquals(123, engine.eval("java.lang.Math.abs(-123)"));
- assertThat(engine.eval("new Boolean(true)"), is(true));
- assertThat(engine.eval("new Boolean(true).toString()"), is("true"));
- }
+ final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox);
+ assertEquals(123, engine.eval("java.lang.Math.abs(-123)"));
+ assertThat(engine.eval("new Boolean(true)"), is(true));
+ assertThat(engine.eval("new Boolean(true).toString()"), is("true"));
}
@Test
public void shouldEvalAsTheMethodIsWhiteListed() throws Exception {
final CompileStaticGroovyCustomizer standardSandbox = new CompileStaticGroovyCustomizer(FileSandboxExtension.class.getName());
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox)) {
- assertEquals(123, engine.eval("java.lang.Math.abs(-123)"));
- assertThat(engine.eval("new Boolean(true)"), is(true));
- assertThat(engine.eval("new Boolean(true).toString()"), is("true"));
- }
+ final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox);
+ assertEquals(123, engine.eval("java.lang.Math.abs(-123)"));
+ assertThat(engine.eval("new Boolean(true)"), is(true));
+ assertThat(engine.eval("new Boolean(true).toString()"), is("true"));
}
@Test
public void shouldEvalAsGroovyPropertiesWhenWhiteListed() throws Exception {
final CompileStaticGroovyCustomizer standardSandbox = new CompileStaticGroovyCustomizer(FileSandboxExtension.class.getName());
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox)) {
- assertThat(Arrays.equals("test".getBytes(), (byte[]) engine.eval("'test'.bytes")), is(true));
- }
+ final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox);
+ assertThat(Arrays.equals("test".getBytes(), (byte[]) engine.eval("'test'.bytes")), is(true));
}
@Test
public void shouldPreventMaliciousStuffWithSystemButAllowSomeMethodsOnSystem() throws Exception {
final CompileStaticGroovyCustomizer standardSandbox = new CompileStaticGroovyCustomizer(FileSandboxExtension.class.getName());
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox)) {
+ final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox);
+ try {
assertThat((long) engine.eval("System.currentTimeMillis()"), greaterThan(0L));
assertThat((long) engine.eval("System.nanoTime()"), greaterThan(0L));
@@ -113,7 +111,8 @@
@Test
public void shouldPreventMaliciousStuffWithFile() throws Exception {
final CompileStaticGroovyCustomizer standardSandbox = new CompileStaticGroovyCustomizer(FileSandboxExtension.class.getName());
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox)) {
+ final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox);
+ try {
engine.eval("java.nio.file.FileSystems.getDefault()");
fail("Should have a compile error because class/method is not white listed");
} catch (Exception ex) {
@@ -126,13 +125,13 @@
@LoadGraphWith(LoadGraphWith.GraphData.MODERN)
public void shouldEvalOnGAsTheMethodIsWhiteListed() throws Exception {
final CompileStaticGroovyCustomizer standardSandbox = new CompileStaticGroovyCustomizer(FileSandboxExtension.class.getName());
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox)) {
- final Bindings bindings = engine.createBindings();
- bindings.put("g", g);
- bindings.put("marko", convertToVertexId(graph, "marko"));
- assertEquals(g.V(convertToVertexId(graph, "marko")).next(), engine.eval("g.V(marko).next()", bindings));
- assertEquals(g.V(convertToVertexId(graph, "marko")).out("created").count().next(), engine.eval("g.V(marko).out(\"created\").count().next()", bindings));
- }
+ final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox);
+
+ final Bindings bindings = engine.createBindings();
+ bindings.put("g", g);
+ bindings.put("marko", convertToVertexId(graph, "marko"));
+ assertEquals(g.V(convertToVertexId(graph, "marko")).next(), engine.eval("g.V(marko).next()", bindings));
+ assertEquals(g.V(convertToVertexId(graph, "marko")).out("created").count().next(), engine.eval("g.V(marko).out(\"created\").count().next()", bindings));
}
private Object convertToVertexId(final Graph graph, final String vertexName) {
diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineSandboxedStandardTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineSandboxedStandardTest.java
index c3bac74..b203ba8 100644
--- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineSandboxedStandardTest.java
+++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineSandboxedStandardTest.java
@@ -61,15 +61,15 @@
public void shouldEvalGraphTraversalSource() throws Exception {
final Graph graph = TinkerFactory.createModern();
final GraphTraversalSource g = graph.traversal();
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine()) {
- final Bindings bindings = engine.createBindings();
- bindings.put("g", g);
- bindings.put("marko", convertToVertexId(graph, "marko"));
- assertEquals(g.V(convertToVertexId(graph, "marko")).next(), engine.eval("g.V(marko).next()", bindings));
- }
+ GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine();
+ Bindings bindings = engine.createBindings();
+ bindings.put("g", g);
+ bindings.put("marko", convertToVertexId(graph, "marko"));
+ assertEquals(g.V(convertToVertexId(graph, "marko")).next(), engine.eval("g.V(marko).next()", bindings));
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(notSandboxed)) {
- final Bindings bindings = engine.createBindings();
+ engine = new GremlinGroovyScriptEngine(notSandboxed);
+ try {
+ bindings = engine.createBindings();
bindings.put("g", g);
bindings.put("marko", convertToVertexId(graph, "marko"));
engine.eval("g.V(marko).next()", bindings);
@@ -79,28 +79,27 @@
assertThat(ex.getMessage(), containsString("The variable [g] is undeclared."));
}
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(sandboxed)) {
- final Bindings bindings = engine.createBindings();
- bindings.put("g", g);
- bindings.put("marko", convertToVertexId(graph, "marko"));
- assertEquals(g.V(convertToVertexId(graph, "marko")).next(), engine.eval("g.V(marko).next()", bindings));
- assertEquals(g.V(convertToVertexId(graph, "marko")).out("created").count().next(), engine.eval("g.V(marko).out(\"created\").count().next()", bindings));
- }
+ engine = new GremlinGroovyScriptEngine(sandboxed);
+ bindings = engine.createBindings();
+ bindings.put("g", g);
+ bindings.put("marko", convertToVertexId(graph, "marko"));
+ assertEquals(g.V(convertToVertexId(graph, "marko")).next(), engine.eval("g.V(marko).next()", bindings));
+ assertEquals(g.V(convertToVertexId(graph, "marko")).out("created").count().next(), engine.eval("g.V(marko).out(\"created\").count().next()", bindings));
}
@Test
public void shouldEvalGraph() throws Exception {
final Graph graph = TinkerFactory.createModern();
final GraphTraversalSource g = graph.traversal();
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine()) {
- final Bindings bindings = engine.createBindings();
- bindings.put("graph", graph);
- bindings.put("marko", convertToVertexId(graph, "marko"));
- assertEquals(graph.vertices(convertToVertexId(graph, "marko")).next(), engine.eval("graph.vertices(marko).next()", bindings));
- }
+ GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine();
+ Bindings bindings = engine.createBindings();
+ bindings.put("graph", graph);
+ bindings.put("marko", convertToVertexId(graph, "marko"));
+ assertEquals(graph.vertices(convertToVertexId(graph, "marko")).next(), engine.eval("graph.vertices(marko).next()", bindings));
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(notSandboxed)) {
- final Bindings bindings = engine.createBindings();
+ engine = new GremlinGroovyScriptEngine(notSandboxed);
+ try {
+ bindings = engine.createBindings();
bindings.put("graph", graph);
bindings.put("marko", convertToVertexId(graph, "marko"));
assertEquals(graph.vertices(convertToVertexId(graph, "marko")).next(), engine.eval("graph.vertices(marko).next()", bindings));
@@ -110,8 +109,9 @@
assertThat(ex.getMessage(), containsString("The variable [graph] is undeclared."));
}
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(notSandboxed)) {
- final Bindings bindings = engine.createBindings();
+ engine = new GremlinGroovyScriptEngine(notSandboxed);
+ try {
+ bindings = engine.createBindings();
bindings.put("graph", graph);
bindings.put("x", convertToVertexId(graph, "marko"));
assertEquals(graph.vertices(convertToVertexId(graph, "marko")).next(), engine.eval("graph.vertices(x).next()", bindings));
@@ -121,19 +121,17 @@
assertThat(ex.getMessage(), containsString("The variable [graph] is undeclared."));
}
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(sandboxed)) {
- final Bindings bindings = engine.createBindings();
- bindings.put("graph", graph);
- bindings.put("marko", convertToVertexId(graph, "marko"));
- assertEquals(graph.vertices(convertToVertexId(graph, "marko")).next(), engine.eval("graph.vertices(marko).next()", bindings));
- }
+ engine = new GremlinGroovyScriptEngine(sandboxed);
+ bindings = engine.createBindings();
+ bindings.put("graph", graph);
+ bindings.put("marko", convertToVertexId(graph, "marko"));
+ assertEquals(graph.vertices(convertToVertexId(graph, "marko")).next(), engine.eval("graph.vertices(marko).next()", bindings));
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(sandboxed)) {
- final Bindings bindings = engine.createBindings();
- bindings.put("graph", graph);
- bindings.put("x", convertToVertexId(graph, "marko"));
- assertEquals(graph.vertices(convertToVertexId(graph, "marko")).next(), engine.eval("graph.vertices(x).next()", bindings));
- }
+ engine = new GremlinGroovyScriptEngine(sandboxed);
+ bindings = engine.createBindings();
+ bindings.put("graph", graph);
+ bindings.put("x", convertToVertexId(graph, "marko"));
+ assertEquals(graph.vertices(convertToVertexId(graph, "marko")).next(), engine.eval("graph.vertices(x).next()", bindings));
}
private Object convertToVertexId(final Graph graph, final String vertexName) {
diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTinkerPopSandboxTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTinkerPopSandboxTest.java
index c2d555f..fd36eaa 100644
--- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTinkerPopSandboxTest.java
+++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTinkerPopSandboxTest.java
@@ -40,7 +40,8 @@
@Test
public void shouldNotEvalAsTheMethodIsNotWhiteListed() throws Exception {
final CompileStaticGroovyCustomizer standardSandbox = new CompileStaticGroovyCustomizer(TinkerPopSandboxExtension.class.getName());
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox)) {
+ final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox);
+ try {
engine.eval("java.lang.Math.abs(123)");
fail("Should have a compile error because class/method is not white listed");
} catch (Exception ex) {
@@ -54,13 +55,13 @@
final Graph graph = TinkerFactory.createModern();
final GraphTraversalSource g = graph.traversal();
final CompileStaticGroovyCustomizer standardSandbox = new CompileStaticGroovyCustomizer(TinkerPopSandboxExtension.class.getName());
- try (GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox)) {
- final Bindings bindings = engine.createBindings();
- bindings.put("g", g);
- bindings.put("marko", convertToVertexId(graph, "marko"));
- assertEquals(g.V(convertToVertexId(graph, "marko")).next(), engine.eval("g.V(marko).next()", bindings));
- assertEquals(g.V(convertToVertexId(graph, "marko")).out("created").count().next(), engine.eval("g.V(marko).out(\"created\").count().next()", bindings));
- }
+ final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(standardSandbox);
+
+ final Bindings bindings = engine.createBindings();
+ bindings.put("g", g);
+ bindings.put("marko", convertToVertexId(graph, "marko"));
+ assertEquals(g.V(convertToVertexId(graph, "marko")).next(), engine.eval("g.V(marko).next()", bindings));
+ assertEquals(g.V(convertToVertexId(graph, "marko")).out("created").count().next(), engine.eval("g.V(marko).out(\"created\").count().next()", bindings));
}
private Object convertToVertexId(final Graph graph, final String vertexName) {
diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTypeCheckedTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTypeCheckedTest.java
index 70c7b68..6cfb7f4 100644
--- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTypeCheckedTest.java
+++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTypeCheckedTest.java
@@ -37,12 +37,12 @@
@Test
public void shouldTypeCheck() throws Exception {
// with no type checking this should pass
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine()) {
- assertEquals(255, scriptEngine.eval("((Object) new java.awt.Color(255, 255, 255)).getRed()"));
- }
+ GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine();
+ assertEquals(255, scriptEngine.eval("((Object) new java.awt.Color(255, 255, 255)).getRed()"));
final TypeCheckedGroovyCustomizer provider = new TypeCheckedGroovyCustomizer();
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(provider)) {
+ scriptEngine = new GremlinGroovyScriptEngine(provider);
+ try {
scriptEngine.eval("((Object) new java.awt.Color(255, 255, 255)).getRed()");
fail("Should have failed type checking");
} catch (ScriptException se) {
@@ -56,13 +56,13 @@
public void shouldTypeCheckWithExtension() throws Exception {
// with no type checking extension this should pass
final TypeCheckedGroovyCustomizer providerNoExtension = new TypeCheckedGroovyCustomizer();
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerNoExtension)) {
- assertEquals(255, scriptEngine.eval("def c = new java.awt.Color(255, 255, 255); c.red"));
- }
+ GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerNoExtension);
+ assertEquals(255, scriptEngine.eval("def c = new java.awt.Color(255, 255, 255); c.red"));
final TypeCheckedGroovyCustomizer providerWithExtension = new TypeCheckedGroovyCustomizer(
PrecompiledExtensions.PreventColorUsageExtension.class.getName());
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerWithExtension)) {
+ scriptEngine = new GremlinGroovyScriptEngine(providerWithExtension);
+ try {
scriptEngine.eval("def c = new java.awt.Color(255, 255, 255); c.red");
fail("Should have failed type checking");
} catch (ScriptException se) {
@@ -75,15 +75,15 @@
public void shouldTypeCheckWithMultipleExtension() throws Exception {
// with no type checking extension this should pass
final TypeCheckedGroovyCustomizer providerNoExtension = new TypeCheckedGroovyCustomizer();
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerNoExtension)) {
- assertEquals(255, scriptEngine.eval("def c = new java.awt.Color(255, 255, 255); c.red"));
- assertEquals(1l, scriptEngine.eval("def c = new java.util.concurrent.CountDownLatch(1); c.count"));
- }
+ GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerNoExtension);
+ assertEquals(255, scriptEngine.eval("def c = new java.awt.Color(255, 255, 255); c.red"));
+ assertEquals(1l, scriptEngine.eval("def c = new java.util.concurrent.CountDownLatch(1); c.count"));
final TypeCheckedGroovyCustomizer providerWithExtension = new TypeCheckedGroovyCustomizer(
PrecompiledExtensions.PreventColorUsageExtension.class.getName() +
"," + PrecompiledExtensions.PreventCountDownLatchUsageExtension.class.getName());
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerWithExtension)) {
+ scriptEngine = new GremlinGroovyScriptEngine(providerWithExtension);
+ try {
scriptEngine.eval("def c = new java.awt.Color(255, 255, 255); c.red");
fail("Should have failed type checking");
} catch (ScriptException se) {
@@ -91,7 +91,8 @@
assertThat(se.getMessage(), containsString("Method call is not allowed!"));
}
- try (GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(providerWithExtension)) {
+ scriptEngine = new GremlinGroovyScriptEngine(providerWithExtension);
+ try {
scriptEngine.eval("def c = new java.util.concurrent.CountDownLatch(1); c.count");
fail("Should have failed type checking");
} catch (ScriptException se) {
diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java
deleted file mode 100644
index 7e054ce..0000000
--- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential;
-
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
-import org.hamcrest.MatcherAssert;
-import org.junit.Test;
-
-import static org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialGraph.credentials;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.greaterThan;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNull;
-
-/**
- * These tests cover old functionality prior to the new method for DSL implementation.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- * @deprecated As for release 3.3.3, replaced by {@link CredentialTraversalDslTest}.
- */
-@Deprecated
-public class CredentialGraphTest {
-
- @Test
- public void shouldCreateUser() {
- final Graph graph = TinkerGraph.open();
- final Vertex v = credentials(graph).createUser("stephen", "secret");
- assertEquals("stephen", v.value("username"));
- assertEquals("user", v.label());
- assertNotEquals("secret", v.value("password")); // hashed to something
- assertThat(v.value("password").toString().length(), greaterThan(0));
- }
-
- @Test
- public void shouldRemoveUser() {
- final Graph graph = TinkerGraph.open();
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
- credentials(graph).createUser("stephen", "secret");
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-
- assertEquals(1, credentials(graph).removeUser("stephen"));
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
- }
-
- @Test
- public void shouldNotRemoveUser() {
- final Graph graph = TinkerGraph.open();
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
- credentials(graph).createUser("stephen", "secret");
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-
- assertEquals(0, credentials(graph).removeUser("stephanie"));
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
- }
-
- @Test
- public void shouldFindUser() {
- final Graph graph = TinkerGraph.open();
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
- credentials(graph).createUser("marko", "secret");
- final Vertex stephen = credentials(graph).createUser("stephen", "secret");
- credentials(graph).createUser("daniel", "secret");
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-
- assertEquals(stephen, credentials(graph).findUser("stephen"));
- }
-
- @Test
- public void shouldNotFindUser() {
- final Graph graph = TinkerGraph.open();
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
- credentials(graph).createUser("marko", "secret");
- credentials(graph).createUser("stephen", "secret");
- credentials(graph).createUser("daniel", "secret");
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-
- assertNull(credentials(graph).findUser("stephanie"));
- }
-
- @Test
- public void shouldCountUsers() {
- final Graph graph = TinkerGraph.open();
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
- credentials(graph).createUser("marko", "secret");
- credentials(graph).createUser("stephen", "secret");
- credentials(graph).createUser("daniel", "secret");
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-
- assertEquals(3, credentials(graph).countUsers());
- }
-
- @Test(expected = IllegalStateException.class)
- public void shouldThrowIfFindingMultipleUsers() {
- final Graph graph = TinkerGraph.open();
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
- credentials(graph).createUser("stephen", "secret");
- credentials(graph).createUser("stephen", "secret");
- MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-
- assertNull(credentials(graph).findUser("stephen"));
- }
-}
diff --git a/gremlin-javascript/glv/generate.groovy b/gremlin-javascript/glv/generate.groovy
index 8fd22e3..8778e89 100644
--- a/gremlin-javascript/glv/generate.groovy
+++ b/gremlin-javascript/glv/generate.groovy
@@ -28,7 +28,8 @@
import java.lang.reflect.Modifier
def toJsMap = ["in": "in_",
- "from": "from_"]
+ "from": "from_",
+ "with": "with_"]
def toJs = { symbol -> toJsMap.getOrDefault(symbol, symbol) }
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
index a4739ae..46bfec4 100644
--- a/gremlin-javascript/pom.xml
+++ b/gremlin-javascript/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-javascript</artifactId>
<name>Apache TinkerPop :: Gremlin Javascript</name>
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
index edeb2cb..f143542 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
@@ -1132,6 +1132,16 @@
return this;
}
+ /**
+ * Graph traversal with method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+ with_(...args) {
+ this.bytecode.addStep('with', args);
+ return this;
+ }
+
}
function callOnEmptyTraversal(fnName, args) {
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.js
index 2861a50..f6553fa 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.js
@@ -126,6 +126,10 @@
this.objects = objects;
}
+ toString() {
+ return 'path[' + objects.join(", ") + ']';
+ }
+
equals(other) {
if (!(other instanceof Path)) {
return false;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json b/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
index 8e51302..50c461d 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
@@ -1,6 +1,6 @@
{
"name": "gremlin",
- "version": "3.3.4-alpha1",
+ "version": "3.4.0-alpha1",
"description": "JavaScript Gremlin Language Variant",
"author": "Apache TinkerPop team",
"keywords": [
diff --git a/gremlin-python/glv/generate.groovy b/gremlin-python/glv/generate.groovy
index 58d0cd3..57cc9c9 100644
--- a/gremlin-python/glv/generate.groovy
+++ b/gremlin-python/glv/generate.groovy
@@ -30,6 +30,7 @@
"as": "as_",
"in": "in_",
"and": "and_",
+ "with": "with_",
"or": "or_",
"is": "is_",
"not": "not_",
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index e48901c..2c59e19 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-python</artifactId>
<name>Apache TinkerPop :: Gremlin Python</name>
diff --git a/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py b/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
index d5630c0..bb81d87 100644
--- a/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
+++ b/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
@@ -505,6 +505,10 @@
self.bytecode.add_step("where", *args)
return self
+ def with_(self, *args):
+ self.bytecode.add_step("with", *args)
+ return self
+
class __(object):
graph_traversal = GraphTraversal
diff --git a/gremlin-python/src/main/jython/gremlin_python/structure/graph.py b/gremlin-python/src/main/jython/gremlin_python/structure/graph.py
index a22633c..3df0cd1 100644
--- a/gremlin-python/src/main/jython/gremlin_python/structure/graph.py
+++ b/gremlin-python/src/main/jython/gremlin_python/structure/graph.py
@@ -103,7 +103,7 @@
self.objects = objects
def __repr__(self):
- return str(self.objects)
+ return "path[" + ", ".join(map(str, self.objects)) + "]"
def __eq__(self, other):
return isinstance(other, self.__class__) and self.objects == other.objects and self.labels == other.labels
diff --git a/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV2d0.py b/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV2d0.py
index 416a9a4..802960d 100644
--- a/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV2d0.py
+++ b/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV2d0.py
@@ -124,10 +124,7 @@
"""{"@type":"g:Path","@value":{"labels":[["a"],["b","c"],[]],"objects":[{"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":1},"label":"person","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":0},"value":"marko","label":"name"}}],"age":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29},"label":"age"}}]}}},{"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":3},"label":"software","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":4},"value":"lop","label":"name"}}],"lang":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":5},"value":"java","label":"lang"}}]}}},"lop"]}}"""
)
assert isinstance(path, Path)
- if six.PY3:
- assert "[v[1], v[3], 'lop']" == str(path)
- else:
- assert "[v[1], v[3], u'lop']" == str(path)
+ assert "path[v[1], v[3], lop]" == str(path)
assert Vertex(1) == path[0]
assert Vertex(1) == path["a"]
assert "lop" == path[2]
diff --git a/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py b/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
index 16de67f..7d3bca1 100644
--- a/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
+++ b/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
@@ -152,10 +152,7 @@
"""{"@type":"g:Path","@value":{"labels":{"@type":"g:List","@value":[{"@type":"g:Set","@value":["a"]},{"@type":"g:Set","@value":["b","c"]},{"@type":"g:Set","@value":[]}]},"objects":{"@type":"g:List","@value":[{"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":1},"label":"person","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":0},"value":"marko","label":"name"}}],"age":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29},"label":"age"}}]}}},{"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":3},"label":"software","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":4},"value":"lop","label":"name"}}],"lang":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":5},"value":"java","label":"lang"}}]}}},"lop"]}}}"""
)
assert isinstance(path, Path)
- if six.PY3:
- assert "[v[1], v[3], 'lop']" == str(path)
- else:
- assert "[v[1], v[3], u'lop']" == str(path)
+ assert "path[v[1], v[3], lop]" == str(path)
assert Vertex(1) == path[0]
assert Vertex(1) == path["a"]
assert "lop" == path[2]
diff --git a/gremlin-python/src/main/jython/tests/structure/test_graph.py b/gremlin-python/src/main/jython/tests/structure/test_graph.py
index e779bf6..986772e 100644
--- a/gremlin-python/src/main/jython/tests/structure/test_graph.py
+++ b/gremlin-python/src/main/jython/tests/structure/test_graph.py
@@ -75,7 +75,7 @@
def test_path(self):
path = Path([set(["a", "b"]), set(["c", "b"]), set([])], [1, Vertex(1), "hello"])
- assert "[1, v[1], 'hello']" == str(path)
+ assert "path[1, v[1], hello]" == str(path)
assert 1 == path["a"]
assert Vertex(1) == path["c"]
assert [1, Vertex(1)] == path["b"]
diff --git a/gremlin-server/pom.xml b/gremlin-server/pom.xml
index 01d5f3e..3540b7a 100644
--- a/gremlin-server/pom.xml
+++ b/gremlin-server/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-server</artifactId>
<name>Apache TinkerPop :: Gremlin Server</name>
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
index e7f299b..388bf0b 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
@@ -179,12 +179,7 @@
}
private Authenticator createAuthenticator(final Settings.AuthenticationSettings config) {
- String authenticatorClass = null;
- if (config.authenticator == null) {
- authenticatorClass = config.className;
- } else {
- authenticatorClass = config.authenticator;
- }
+ final String authenticatorClass = config.authenticator;
try {
final Class<?> clazz = Class.forName(authenticatorClass);
final Authenticator authenticator = (Authenticator) clazz.newInstance();
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
index bcb4a8e..b64bba4 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
@@ -35,16 +35,6 @@
* the interface also defines similar features for {@link TraversalSource} objects.
*/
public interface GraphManager {
- /**
- * Get a list of the {@link Graph} instances and their binding names.
- *
- * @return a {@code Map} where the key is the name of the {@link Graph} and the value is the {@link Graph} itself
- * @deprecated As of release 3.2.5, replaced by a combination of {@link #getGraphNames()} and
- * {@link #getGraph(String)} - note that the expectation is this method return an immutable {@code Map} which was
- * not the expectation prior to 3.2.5.
- */
- @Deprecated
- public Map<String, Graph> getGraphs();
/**
* Get a {@link Set} of {@link String} graphNames corresponding to names stored in the graph's
@@ -65,18 +55,6 @@
public void putGraph(final String graphName, final Graph g);
/**
- * Get a list of the {@link TraversalSource} instances and their binding names
- *
- * @return a {@link Map} where the key is the name of the {@link TraversalSource} and the value is the
- * {@link TraversalSource} itself
- * @deprecated As of release 3.2.5, replaced by a combination of {@link #getTraversalSourceNames()} and
- * {@link #getTraversalSource(String)} - note that the expectation is this method return an immutable
- * {@code Map} which was not the expectation prior to 3.2.5.
- */
- @Deprecated
- public Map<String, TraversalSource> getTraversalSources();
-
- /**
* Get a {@code Set} of the names of the the stored {@link TraversalSource} instances.
*/
public Set<String> getTraversalSourceNames();
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
index 9921817..3066b2c 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
@@ -30,7 +30,6 @@
import org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer;
import org.apache.tinkerpop.gremlin.server.handler.AbstractAuthenticationHandler;
import org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager;
-import info.ganglia.gmetric4j.gmetric.GMetric;
import org.apache.tinkerpop.gremlin.server.util.LifeCycleHook;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.yaml.snakeyaml.TypeDescription;
@@ -105,15 +104,6 @@
public long scriptEvaluationTimeout = 30000L;
/**
- * Time in milliseconds to wait while an evaluated script serializes its results. This value represents the
- * total serialization time allowed for the request. Defaults to 0 which disables this setting.
- *
- * @deprecated As of release 3.2.1, replaced wholly by {@link #scriptEvaluationTimeout}.
- */
- @Deprecated
- public long serializedResponseTimeout = 0L;
-
- /**
* Number of items in a particular resultset to iterate and serialize prior to pushing the data down the wire
* to the client.
*/
@@ -411,16 +401,7 @@
* used to load the implementation from the classpath. Defaults to {@link AllowAllAuthenticator} when
* not specified.
*/
- public String authenticator = null;
-
- /**
- * The fully qualified class name of the {@link Authenticator} implementation. This class name will be
- * used to load the implementation from the classpath. Defaults to {@link AllowAllAuthenticator} when
- * not specified.
- * @deprecated As of release 3.2.5, replaced by {@link #authenticator}.
- */
- @Deprecated
- public String className = AllowAllAuthenticator.class.getName();
+ public String authenticator = AllowAllAuthenticator.class.getName();
/**
* The fully qualified class name of the {@link AbstractAuthenticationHandler} implementation.
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpGremlinEndpointHandler.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpGremlinEndpointHandler.java
index e2b15d6..6292ddd 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpGremlinEndpointHandler.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpGremlinEndpointHandler.java
@@ -35,7 +35,6 @@
import org.apache.tinkerpop.gremlin.server.util.MetricManager;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.util.function.FunctionUtils;
-import org.apache.tinkerpop.gremlin.util.function.ThrowingBiConsumer;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
@@ -108,11 +107,6 @@
private static final String ARGS_BINDINGS_DOT = Tokens.ARGS_BINDINGS + ".";
- /**
- * @deprecated As of release 3.1.0, replaced by {@link #ARGS_ALIASES_DOT}.
- */
- @Deprecated
- private static final String ARGS_REBINDINGS_DOT = Tokens.ARGS_REBINDINGS + ".";
private static final String ARGS_ALIASES_DOT = Tokens.ARGS_ALIASES + ".";
private static final Timer evalOpTimer = MetricManager.INSTANCE.getTimer(name(GremlinServer.class, "op", "eval"));
@@ -365,18 +359,9 @@
decoder.parameters().entrySet().stream().filter(kv -> kv.getKey().startsWith(ARGS_BINDINGS_DOT))
.forEach(kv -> bindings.put(kv.getKey().substring(ARGS_BINDINGS_DOT.length()), kv.getValue().get(0)));
- // don't allow both rebindings and aliases parameters as they are the same thing. aliases were introduced
- // as of 3.1.0 as a replacement for rebindings. this check can be removed when rebindings are completely
- // removed from the protocol
- final boolean hasRebindings = decoder.parameters().entrySet().stream().anyMatch(kv -> kv.getKey().startsWith(ARGS_REBINDINGS_DOT));
- final boolean hasAliases = decoder.parameters().entrySet().stream().anyMatch(kv -> kv.getKey().startsWith(ARGS_ALIASES_DOT));
- if (hasRebindings && hasAliases)
- throw new IllegalArgumentException("prefer use of the 'aliases' parameter over 'rebindings' and do not use both");
-
final Map<String, String> aliases = new HashMap<>();
- final String rebindingOrAliasParameter = hasRebindings ? ARGS_REBINDINGS_DOT : ARGS_ALIASES_DOT;
- decoder.parameters().entrySet().stream().filter(kv -> kv.getKey().startsWith(rebindingOrAliasParameter))
- .forEach(kv -> aliases.put(kv.getKey().substring(rebindingOrAliasParameter.length()), kv.getValue().get(0)));
+ decoder.parameters().entrySet().stream().filter(kv -> kv.getKey().startsWith(ARGS_ALIASES_DOT))
+ .forEach(kv -> aliases.put(kv.getKey().substring(ARGS_ALIASES_DOT.length()), kv.getValue().get(0)));
final List<String> languageParms = decoder.parameters().get(Tokens.ARGS_LANGUAGE);
final String language = (null == languageParms || languageParms.size() == 0) ? null : languageParms.get(0);
@@ -401,16 +386,7 @@
if (bindingsNode != null)
bindingsNode.fields().forEachRemaining(kv -> bindings.put(kv.getKey(), fromJsonNode(kv.getValue())));
- // don't allow both rebindings and aliases parameters as they are the same thing. aliases were introduced
- // as of 3.1.0 as a replacement for rebindings. this check can be removed when rebindings are completely
- // removed from the protocol
- final boolean hasRebindings = body.has(Tokens.ARGS_REBINDINGS);
- final boolean hasAliases = body.has(Tokens.ARGS_ALIASES);
- if (hasRebindings && hasAliases)
- throw new IllegalArgumentException("prefer use of the 'aliases' parameter over 'rebindings' and do not use both");
-
- final String rebindingOrAliasParameter = hasRebindings ? Tokens.ARGS_REBINDINGS : Tokens.ARGS_ALIASES;
- final JsonNode aliasesNode = body.get(rebindingOrAliasParameter);
+ final JsonNode aliasesNode = body.get(Tokens.ARGS_ALIASES);
if (aliasesNode != null && !aliasesNode.isObject())
throw new IllegalArgumentException("aliases must be a Map");
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java
index 0f14293..75d44e8 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java
@@ -56,15 +56,6 @@
private final ScheduledExecutorService scheduledExecutorService;
private final Channelizer channelizer;
- /**
- * @deprecated As of release 3.2.8, replaced by {@link #OpSelectorHandler(Settings, GraphManager, GremlinExecutor, ScheduledExecutorService, Channelizer)}
- */
- @Deprecated
- public OpSelectorHandler(final Settings settings, final GraphManager graphManager, final GremlinExecutor gremlinExecutor,
- final ScheduledExecutorService scheduledExecutorService) {
- this(settings, graphManager, gremlinExecutor, scheduledExecutorService, null);
- }
-
public OpSelectorHandler(final Settings settings, final GraphManager graphManager, final GremlinExecutor gremlinExecutor,
final ScheduledExecutorService scheduledExecutorService, final Channelizer channelizer) {
this.settings = settings;
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java
index 8899bb5..bb368c5 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java
@@ -19,7 +19,6 @@
package org.apache.tinkerpop.gremlin.server.op;
import io.netty.channel.ChannelHandlerContext;
-import org.apache.commons.lang.time.StopWatch;
import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
import org.apache.tinkerpop.gremlin.driver.Tokens;
import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
@@ -43,7 +42,6 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
/**
* A base {@link OpProcessor} implementation that processes an {@code Iterator} of results in a generalized way while
@@ -64,16 +62,12 @@
}
/**
- * Provides a generic way of iterating a result set back to the client. Implementers should respect the
- * {@link Settings#serializedResponseTimeout} configuration and break the serialization process if
- * it begins to take too long to do so, throwing a {@link java.util.concurrent.TimeoutException} in such
- * cases.
+ * Provides a generic way of iterating a result set back to the client.
*
* @param context The Gremlin Server {@link Context} object containing settings, request message, etc.
* @param itty The result to iterator
- * @throws TimeoutException if the time taken to serialize the entire result set exceeds the allowable time.
*/
- protected void handleIterator(final Context context, final Iterator itty) throws TimeoutException, InterruptedException {
+ protected void handleIterator(final Context context, final Iterator itty) throws InterruptedException {
final ChannelHandlerContext ctx = context.getChannelHandlerContext();
final RequestMessage msg = context.getRequestMessage();
final Settings settings = context.getSettings();
@@ -96,10 +90,6 @@
return;
}
- // timer for the total serialization time
- final StopWatch stopWatch = new StopWatch();
- stopWatch.start();
-
// the batch size can be overridden by the request
final int resultIterationBatchSize = (Integer) msg.optionalArgs(Tokens.ARGS_BATCH_SIZE)
.orElse(settings.resultIterationBatchSize);
@@ -204,18 +194,7 @@
// this isn't blocking the IO thread - just a worker.
TimeUnit.MILLISECONDS.sleep(10);
}
-
- stopWatch.split();
- if (settings.serializedResponseTimeout > 0 && stopWatch.getSplitTime() > settings.serializedResponseTimeout) {
- final String timeoutMsg = String.format("Serialization of the entire response exceeded the 'serializeResponseTimeout' setting %s",
- warnOnce ? "[Gremlin Server paused writes to client as messages were not being consumed quickly enough]" : "");
- throw new TimeoutException(timeoutMsg.trim());
- }
-
- stopWatch.unsplit();
}
-
- stopWatch.stop();
}
/**
@@ -249,18 +228,9 @@
return Collections.emptyMap();
}
- /**
- * @deprecated As of release 3.2.2, replaced by {@link #makeFrame(ChannelHandlerContext, RequestMessage, MessageSerializer, boolean, List, ResponseStatusCode, Map)}.
- */
protected static Frame makeFrame(final ChannelHandlerContext ctx, final RequestMessage msg,
final MessageSerializer serializer, final boolean useBinary, final List<Object> aggregate,
- final ResponseStatusCode code) throws Exception {
- return makeFrame(ctx, msg, serializer, useBinary, aggregate, code, Collections.emptyMap());
- }
-
- protected static Frame makeFrame(final ChannelHandlerContext ctx, final RequestMessage msg,
- final MessageSerializer serializer, final boolean useBinary, final List<Object> aggregate,
- final ResponseStatusCode code, final Map<String,Object> responseMetaData) throws Exception {
+ final ResponseStatusCode code, final Map<String,Object> responseMetaData) throws Exception {
try {
if (useBinary) {
return new Frame(serializer.serializeResponseAsBinary(ResponseMessage.build(msg)
@@ -290,13 +260,8 @@
protected static void attemptCommit(final RequestMessage msg, final GraphManager graphManager, final boolean strict) {
if (strict) {
- // validations should have already been performed in StandardOpProcessor, but a failure in bindings maker
- // at the time of the eval might raise through here at which point the validation didn't yet happen. better
- // to just check again
- final boolean hasRebindings = msg.getArgs().containsKey(Tokens.ARGS_REBINDINGS);
- final String rebindingOrAliasParameter = hasRebindings ? Tokens.ARGS_REBINDINGS : Tokens.ARGS_ALIASES;
- if (msg.getArgs().containsKey(rebindingOrAliasParameter)) {
- final Map<String, String> aliases = (Map<String, String>) msg.getArgs().get(rebindingOrAliasParameter);
+ if (msg.getArgs().containsKey(Tokens.ARGS_ALIASES)) {
+ final Map<String, String> aliases = (Map<String, String>) msg.getArgs().get(Tokens.ARGS_ALIASES);
graphManager.commit(new HashSet<>(aliases.values()));
} else {
graphManager.commitAll();
@@ -308,13 +273,8 @@
protected static void attemptRollback(final RequestMessage msg, final GraphManager graphManager, final boolean strict) {
if (strict) {
- // validations should have already been performed in StandardOpProcessor, but a failure in bindings maker
- // at the time of the eval might raise through here at which point the validation didn't yet happen. better
- // to just check again
- final boolean hasRebindings = msg.getArgs().containsKey(Tokens.ARGS_REBINDINGS);
- final String rebindingOrAliasParameter = hasRebindings ? Tokens.ARGS_REBINDINGS : Tokens.ARGS_ALIASES;
- if (msg.getArgs().containsKey(rebindingOrAliasParameter)) {
- final Map<String, String> aliases = (Map<String, String>) msg.getArgs().get(rebindingOrAliasParameter);
+ if (msg.getArgs().containsKey(Tokens.ARGS_ALIASES)) {
+ final Map<String, String> aliases = (Map<String, String>) msg.getArgs().get(Tokens.ARGS_ALIASES);
graphManager.rollback(new HashSet<>(aliases.values()));
} else {
graphManager.rollbackAll();
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/SessionOpProcessor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/SessionOpProcessor.java
index 3dd0439..8154be6 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/SessionOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/SessionOpProcessor.java
@@ -218,22 +218,9 @@
final RequestMessage msg = context.getRequestMessage();
final Bindings bindings = session.getBindings();
- // don't allow both rebindings and aliases parameters as they are the same thing. aliases were introduced
- // as of 3.1.0 as a replacement for rebindings. this check can be removed when rebindings are completely
- // removed from the protocol
- final boolean hasRebindings = msg.getArgs().containsKey(Tokens.ARGS_REBINDINGS);
- final boolean hasAliases = msg.getArgs().containsKey(Tokens.ARGS_ALIASES);
- if (hasRebindings && hasAliases) {
- final String error = "Prefer use of the 'aliases' parameter over 'rebindings' and do not use both";
- throw new OpProcessorException(error, ResponseMessage.build(msg)
- .code(ResponseStatusCode.REQUEST_ERROR_INVALID_REQUEST_ARGUMENTS).statusMessage(error).create());
- }
-
- final String rebindingOrAliasParameter = hasRebindings ? Tokens.ARGS_REBINDINGS : Tokens.ARGS_ALIASES;
-
// alias any global bindings to a different variable
- if (msg.getArgs().containsKey(rebindingOrAliasParameter)) {
- final Map<String, String> aliases = (Map<String, String>) msg.getArgs().get(rebindingOrAliasParameter);
+ if (msg.getArgs().containsKey(Tokens.ARGS_ALIASES)) {
+ final Map<String, String> aliases = (Map<String, String>) msg.getArgs().get(Tokens.ARGS_ALIASES);
for (Map.Entry<String,String> aliasKv : aliases.entrySet()) {
boolean found = false;
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/standard/StandardOpProcessor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/standard/StandardOpProcessor.java
index 105ca88..da1831b 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/standard/StandardOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/standard/StandardOpProcessor.java
@@ -28,7 +28,6 @@
import org.apache.tinkerpop.gremlin.server.Settings;
import org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor;
import org.apache.tinkerpop.gremlin.server.op.OpProcessorException;
-import org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.util.function.ThrowingConsumer;
import org.slf4j.Logger;
@@ -115,22 +114,9 @@
final RequestMessage msg = context.getRequestMessage();
final Bindings bindings = new SimpleBindings();
- // don't allow both rebindings and aliases parameters as they are the same thing. aliases were introduced
- // as of 3.1.0 as a replacement for rebindings. this check can be removed when rebindings are completely
- // removed from the protocol
- final boolean hasRebindings = msg.getArgs().containsKey(Tokens.ARGS_REBINDINGS);
- final boolean hasAliases = msg.getArgs().containsKey(Tokens.ARGS_ALIASES);
- if (hasRebindings && hasAliases) {
- final String error = "Prefer use of the 'aliases' parameter over 'rebindings' and do not use both";
- throw new OpProcessorException(error, ResponseMessage.build(msg)
- .code(ResponseStatusCode.REQUEST_ERROR_INVALID_REQUEST_ARGUMENTS).statusMessage(error).create());
- }
-
- final String rebindingOrAliasParameter = hasRebindings ? Tokens.ARGS_REBINDINGS : Tokens.ARGS_ALIASES;
-
// alias any global bindings to a different variable.
- if (msg.getArgs().containsKey(rebindingOrAliasParameter)) {
- final Map<String, String> aliases = (Map<String, String>) msg.getArgs().get(rebindingOrAliasParameter);
+ if (msg.getArgs().containsKey(Tokens.ARGS_ALIASES)) {
+ final Map<String, String> aliases = (Map<String, String>) msg.getArgs().get(Tokens.ARGS_ALIASES);
for (Map.Entry<String,String> aliasKv : aliases.entrySet()) {
boolean found = false;
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
index 9025108..ca035c7 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
@@ -68,7 +68,6 @@
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
import static com.codahale.metrics.MetricRegistry.name;
@@ -301,14 +300,6 @@
}
handleIterator(context, new SideEffectIterator(sideEffects.get(sideEffectKey.get()), sideEffectKey.get()));
- } catch (TimeoutException ex) {
- final String errorMessage = String.format("Response iteration exceeded the configured threshold for request [%s] - %s", msg.getRequestId(), ex.getMessage());
- logger.warn(errorMessage);
- ctx.writeAndFlush(ResponseMessage.build(msg).code(ResponseStatusCode.SERVER_ERROR_TIMEOUT)
- .statusMessage(errorMessage)
- .statusAttributeException(ex).create());
- onError(graph, context);
- return;
} catch (Exception ex) {
logger.warn(String.format("Exception processing a side-effect on iteration for request [%s].", msg.getRequestId()), ex);
ctx.writeAndFlush(ResponseMessage.build(msg).code(ResponseStatusCode.SERVER_ERROR)
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
index 9b5668f..a9e9902 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
@@ -65,19 +65,6 @@
});
}
- /**
- * Get a list of the {@link Graph} instances and their binding names as defined in the Gremlin Server
- * configuration file.
- *
- * @return a {@code Map} where the key is the name of the {@link Graph} and the value is the {@link Graph} itself
- * @deprecated As of release 3.2.5, replaced by a combination of {@link #getGraphNames()} and
- * {@link #getGraph(String)}
- */
- @Deprecated
- public final Map<String, Graph> getGraphs() {
- return graphs;
- }
-
public final Set<String> getGraphNames() {
return graphs.keySet();
}
@@ -90,20 +77,6 @@
graphs.put(graphName, g);
}
- /**
- * Get a list of the {@link TraversalSource} instances and their binding names as defined by Gremlin Server
- * initialization scripts.
- *
- * @return a {@code Map} where the key is the name of the {@link TraversalSource} and the value is the
- * {@link TraversalSource} itself
- * @deprecated As of release 3.2.5, replaced by a combination of {@link #getTraversalSourceNames()} and
- * {@link #getTraversalSource(String)}
- */
- @Deprecated
- public final Map<String, TraversalSource> getTraversalSources() {
- return traversalSources;
- }
-
public final Set<String> getTraversalSourceNames() {
return traversalSources.keySet();
}
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
index 6affde4..c7e7bb2 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
@@ -1244,11 +1244,6 @@
assertEquals(ResponseStatusCode.REQUEST_ERROR_INVALID_REQUEST_ARGUMENTS, re.getResponseStatusCode());
}
- // keep the testing here until "rebind" is completely removed
- final Client reboundLegacy = cluster.connect().rebind("graph");
- final Vertex vLegacy = reboundLegacy.submit("g.addVertex('name','stephen')").all().get().get(0).getVertex();
- assertEquals("stephen", vLegacy.value("name"));
-
final Client rebound = cluster.connect().alias("graph");
final Vertex v = rebound.submit("g.addVertex('name','jason')").all().get().get(0).getVertex();
assertEquals("jason", v.value("name"));
@@ -1271,11 +1266,6 @@
assertEquals(ResponseStatusCode.SERVER_ERROR_SCRIPT_EVALUATION, re.getResponseStatusCode());
}
- // keep the testing here until "rebind" is completely removed
- final Client reboundLegacy = cluster.connect().rebind("graph");
- final Vertex vLegacy = reboundLegacy.submit("g.addVertex('name','stephen')").all().get().get(0).getVertex();
- assertEquals("stephen", vLegacy.value("name"));
-
final Client rebound = cluster.connect().alias("graph");
final Vertex v = rebound.submit("g.addVertex('name','jason')").all().get().get(0).getVertex();
assertEquals("jason", v.value("name"));
@@ -1298,11 +1288,6 @@
assertEquals(ResponseStatusCode.SERVER_ERROR_SCRIPT_EVALUATION, re.getResponseStatusCode());
}
- // keep the testing here until "rebind" is completely removed
- final Client clientLegacy = client.rebind("g1");
- final Vertex vLegacy = clientLegacy.submit("g.addV().property('name','stephen')").all().get().get(0).getVertex();
- assertEquals("stephen", vLegacy.value("name"));
-
final Client clientAliased = client.alias("g1");
final Vertex v = clientAliased.submit("g.addV().property('name','jason')").all().get().get(0).getVertex();
assertEquals("jason", v.value("name"));
@@ -1325,14 +1310,8 @@
assertEquals(ResponseStatusCode.SERVER_ERROR_SCRIPT_EVALUATION, re.getResponseStatusCode());
}
- // keep the testing here until "rebind" is completely removed
- final Client reboundLegacy = client.rebind("graph");
- assertEquals("stephen", reboundLegacy.submit("n='stephen'").all().get().get(0).getString());
- final Vertex vLegacy = reboundLegacy.submit("g.addVertex('name',n)").all().get().get(0).getVertex();
- assertEquals("stephen", vLegacy.value("name"));
-
final Client aliased = client.alias("graph");
- assertEquals("jason", reboundLegacy.submit("n='jason'").all().get().get(0).getString());
+ assertEquals("jason", aliased.submit("n='jason'").all().get().get(0).getString());
final Vertex v = aliased.submit("g.addVertex('name',n)").all().get().get(0).getVertex();
assertEquals("jason", v.value("name"));
@@ -1354,12 +1333,6 @@
assertEquals(ResponseStatusCode.SERVER_ERROR_SCRIPT_EVALUATION, re.getResponseStatusCode());
}
- // keep the testing here until "rebind" is completely removed
- final Client clientLegacy = client.rebind("g1");
- assertEquals("stephen", clientLegacy.submit("n='stephen'").all().get().get(0).getString());
- final Vertex vLegacy = clientLegacy.submit("g.addV().property('name',n)").all().get().get(0).getVertex();
- assertEquals("stephen", vLegacy.value("name"));
-
final Client clientAliased = client.alias("g1");
assertEquals("jason", clientAliased.submit("n='jason'").all().get().get(0).getString());
final Vertex v = clientAliased.submit("g.addV().property('name',n)").all().get().get(0).getVertex();
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
index c31ee69..ce58c62 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
@@ -115,7 +115,7 @@
final Settings.AuthenticationSettings authSettings = new Settings.AuthenticationSettings();
settings.authentication = authSettings;
authSettings.enableAuditLog = AUDIT_LOG_ENABLED;
- authSettings.className = Krb5Authenticator.class.getName();
+ authSettings.authenticator = Krb5Authenticator.class.getName();
final Map<String,Object> authConfig = new HashMap<>();
authSettings.config = authConfig;
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
index 6dda40b..2fc7b22 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
@@ -54,7 +54,7 @@
@Override
public Settings overrideSettings(final Settings settings) {
final Settings.AuthenticationSettings authSettings = new Settings.AuthenticationSettings();
- authSettings.className = SimpleAuthenticator.class.getName();
+ authSettings.authenticator = SimpleAuthenticator.class.getName();
// use a credentials graph with one user in it: stephen/password
final Map<String,Object> authConfig = new HashMap<>();
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
index 5a02d0a..cda97d7 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
@@ -97,7 +97,7 @@
settings.ssl = sslConfig;
final Settings.AuthenticationSettings authSettings = new Settings.AuthenticationSettings();
settings.authentication = authSettings;
- authSettings.className = Krb5Authenticator.class.getName();
+ authSettings.authenticator = Krb5Authenticator.class.getName();
final Map<String,Object> authConfig = new HashMap<>();
authConfig.put("principal", kdcServer.serverPrincipal);
authConfig.put("keytab", kdcServer.serviceKeytabFile.getAbsolutePath());
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
index 1ec84c1..81f6234 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
@@ -330,32 +330,6 @@
}
@Test
- public void should200OnGETWithGremlinQueryStringArgumentWithIteratorResultAndAliases() throws Exception {
- // we can remove this first test when rebindings are completely removed
- final CloseableHttpClient httpclientLegacy = HttpClients.createDefault();
- final HttpGet httpgetLegacy = new HttpGet(TestClientFactory.createURLString("?gremlin=g1.V()&rebindings.g1=gclassic"));
-
- try (final CloseableHttpResponse response = httpclientLegacy.execute(httpgetLegacy)) {
- assertEquals(200, response.getStatusLine().getStatusCode());
- assertEquals("application/json", response.getEntity().getContentType().getValue());
- final String json = EntityUtils.toString(response.getEntity());
- final JsonNode node = mapper.readTree(json);
- assertEquals(6, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).size());
- }
-
- final CloseableHttpClient httpclient = HttpClients.createDefault();
- final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=g1.V()&aliases.g1=gclassic"));
-
- try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
- assertEquals(200, response.getStatusLine().getStatusCode());
- assertEquals("application/json", response.getEntity().getContentType().getValue());
- final String json = EntityUtils.toString(response.getEntity());
- final JsonNode node = mapper.readTree(json);
- assertEquals(6, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).size());
- }
- }
-
- @Test
public void should200OnGETWithGremlinQueryStringArgument() throws Exception {
final CloseableHttpClient httpclient = HttpClients.createDefault();
final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=1-1"));
@@ -504,20 +478,6 @@
public void should200OnPOSTTransactionalGraphInStrictMode() throws Exception {
assumeNeo4jIsPresent();
- // we can remove this first test when rebindings are completely removed
- final CloseableHttpClient httpclientLegacy = HttpClients.createDefault();
- final HttpPost httppostLegacy = new HttpPost(TestClientFactory.createURLString());
- httppostLegacy.addHeader("Content-Type", "application/json");
- httppostLegacy.setEntity(new StringEntity("{\"gremlin\":\"g1.addV()\",\"rebindings\":{\"g1\":\"g\"}}", Consts.UTF_8));
-
- try (final CloseableHttpResponse response = httpclientLegacy.execute(httppostLegacy)) {
- assertEquals(200, response.getStatusLine().getStatusCode());
- assertEquals("application/json", response.getEntity().getContentType().getValue());
- final String json = EntityUtils.toString(response.getEntity());
- final JsonNode node = mapper.readTree(json);
- assertEquals(1, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).size());
- }
-
final CloseableHttpClient httpclient = HttpClients.createDefault();
final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
@@ -570,20 +530,6 @@
@Test
public void should200OnPOSTWithGremlinJsonEndcodedBodyWithIteratorResultAndAliases() throws Exception {
- // we can remove this first test when rebindings are completely removed
- final CloseableHttpClient httpclientLegacy = HttpClients.createDefault();
- final HttpPost httppostLegacy = new HttpPost(TestClientFactory.createURLString());
- httppostLegacy.addHeader("Content-Type", "application/json");
- httppostLegacy.setEntity(new StringEntity("{\"gremlin\":\"g1.V()\",\"rebindings\":{\"g1\":\"gclassic\"}}", Consts.UTF_8));
-
- try (final CloseableHttpResponse response = httpclientLegacy.execute(httppostLegacy)) {
- assertEquals(200, response.getStatusLine().getStatusCode());
- assertEquals("application/json", response.getEntity().getContentType().getValue());
- final String json = EntityUtils.toString(response.getEntity());
- final JsonNode node = mapper.readTree(json);
- assertEquals(6, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).size());
- }
-
final CloseableHttpClient httpclient = HttpClients.createDefault();
final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
httppost.addHeader("Content-Type", "application/json");
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index a1689e9..08b8526 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
@@ -59,7 +59,6 @@
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
import org.apache.tinkerpop.gremlin.util.Log4jRecordingAppender;
import org.apache.tinkerpop.gremlin.util.function.Lambda;
@@ -70,7 +69,6 @@
import java.lang.reflect.Field;
import java.nio.channels.ClosedChannelException;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -92,7 +90,6 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.hamcrest.core.IsNot.not;
-import static org.hamcrest.core.StringEndsWith.endsWith;
import static org.hamcrest.core.StringStartsWith.startsWith;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -177,9 +174,6 @@
case "shouldReceiveFailureTimeOutOnScriptEval":
settings.scriptEvaluationTimeout = 1000;
break;
- case "shouldReceiveFailureTimeOutOnTotalSerialization":
- settings.serializedResponseTimeout = 1;
- break;
case "shouldBlockRequestWhenTooBig":
settings.maxContentLength = 1024;
break;
@@ -811,24 +805,6 @@
}
}
- /**
- * @deprecated As of release 3.2.1, replaced by tests covering {@link Settings#scriptEvaluationTimeout}.
- */
- @Test
- @SuppressWarnings("unchecked")
- @Deprecated
- public void shouldReceiveFailureTimeOutOnTotalSerialization() throws Exception {
- try (SimpleClient client = TestClientFactory.createWebSocketClient()){
- final List<ResponseMessage> responses = client.submit("(0..<100000)");
-
- // the last message should contain the error
- assertThat(responses.get(responses.size() - 1).getStatus().getMessage(), endsWith("Serialization of the entire response exceeded the 'serializeResponseTimeout' setting"));
-
- // validate that we can still send messages to the server
- assertEquals(2, ((List<Integer>) client.submit("1+1").get(0).getResult().getData()).get(0).intValue());
- }
- }
-
@Test
@SuppressWarnings("unchecked")
public void shouldLoadInitScript() throws Exception {
@@ -985,24 +961,6 @@
}
@Test
- @SuppressWarnings("unchecked")
- public void shouldStillSupportDeprecatedRebindingsParameterOnServer() throws Exception {
- // this test can be removed when the rebindings arg is removed
- try (SimpleClient client = TestClientFactory.createWebSocketClient()) {
- final Map<String,String> rebindings = new HashMap<>();
- rebindings.put("xyz", "graph");
- final RequestMessage request = RequestMessage.build(Tokens.OPS_EVAL)
- .addArg(Tokens.ARGS_GREMLIN, "xyz.addVertex('name','jason')")
- .addArg(Tokens.ARGS_REBINDINGS, rebindings).create();
- final List<ResponseMessage> responses = client.submit(request);
- assertEquals(1, responses.size());
-
- final DetachedVertex v = ((ArrayList<DetachedVertex>) responses.get(0).getResult().getData()).get(0);
- assertEquals("jason", v.value("name"));
- }
- }
-
- @Test
public void shouldSupportLambdasUsingWithRemote() throws Exception {
final Graph graph = EmptyGraph.instance();
final GraphTraversalSource g = graph.traversal().withRemote(conf);
diff --git a/gremlin-shaded/pom.xml b/gremlin-shaded/pom.xml
index 7bdffd3..45920b9 100644
--- a/gremlin-shaded/pom.xml
+++ b/gremlin-shaded/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-shaded</artifactId>
<name>Apache TinkerPop :: Gremlin Shaded</name>
diff --git a/gremlin-test/features/branch/Union.feature b/gremlin-test/features/branch/Union.feature
index 83318f6..8f5297e 100644
--- a/gremlin-test/features/branch/Union.feature
+++ b/gremlin-test/features/branch/Union.feature
@@ -135,7 +135,6 @@
| d[3].l |
| d[0].l |
| d[1.9].d |
- | d[0].i |
| d[0].l |
| d[1].l |
@@ -151,4 +150,4 @@
Then the result should be unordered
| result |
| d[1].l |
- | d[1].l |
\ No newline at end of file
+ | d[1].l |
diff --git a/gremlin-test/features/map/Max.feature b/gremlin-test/features/map/Max.feature
index ad0a270..44d9640 100644
--- a/gremlin-test/features/map/Max.feature
+++ b/gremlin-test/features/map/Max.feature
@@ -28,6 +28,57 @@
| result |
| d[35].i |
+ Scenario: g_V_foo_max
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("foo").max()
+ """
+ When iterated to list
+ Then the result should be empty
+
+ Scenario: g_V_name_max
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("name").max()
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | vadas |
+
+ Scenario: g_V_age_fold_maxXlocalX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("age").fold().max(Scope.local)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[35].i |
+
+ Scenario: g_V_foo_fold_maxXlocalX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("foo").fold().max(Scope.local)
+ """
+ When iterated to list
+ Then the result should be empty
+
+ Scenario: g_V_name_fold_maxXlocalX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("name").fold().max(Scope.local)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | vadas |
+
Scenario: g_V_repeatXbothX_timesX5X_age_max
Given the modern graph
And the traversal of
diff --git a/gremlin-test/features/map/Mean.feature b/gremlin-test/features/map/Mean.feature
index b109356..dc28ecb 100644
--- a/gremlin-test/features/map/Mean.feature
+++ b/gremlin-test/features/map/Mean.feature
@@ -28,6 +28,35 @@
| result |
| d[30.75].d |
+ Scenario: g_V_foo_mean
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("foo").mean()
+ """
+ When iterated to list
+ Then the result should be empty
+
+ Scenario: g_V_age_fold_meanXlocalX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("age").fold().mean(Scope.local)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[30.75].d |
+
+ Scenario: g_V_foo_fold_meanXlocalX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("foo").fold().mean(Scope.local)
+ """
+ When iterated to list
+ Then the result should be empty
+
Scenario: g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_meanX
Given the modern graph
And the traversal of
@@ -37,4 +66,4 @@
When iterated to list
Then the result should be unordered
| result |
- | m[{"ripple":"d[1.0].d","lop":"d[0.3333333333333333].d"}] |
\ No newline at end of file
+ | m[{"ripple":"d[1.0].d","lop":"d[0.3333333333333333].d"}] |
diff --git a/gremlin-test/features/map/Min.feature b/gremlin-test/features/map/Min.feature
index d77e9f3..d15eff7 100644
--- a/gremlin-test/features/map/Min.feature
+++ b/gremlin-test/features/map/Min.feature
@@ -28,6 +28,57 @@
| result |
| d[27].i |
+ Scenario: g_V_foo_min
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("foo").min()
+ """
+ When iterated to list
+ Then the result should be empty
+
+ Scenario: g_V_name_min
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("name").min()
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | josh |
+
+ Scenario: g_V_age_fold_minXlocalX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("age").fold().min(Scope.local)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[27].i |
+
+ Scenario: g_V_foo_fold_minXlocalX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("foo").fold().min(Scope.local)
+ """
+ When iterated to list
+ Then the result should be empty
+
+ Scenario: g_V_name_fold_minXlocalX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("name").fold().min(Scope.local)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | josh |
+
Scenario: g_V_repeatXbothX_timesX5X_age_min
Given the modern graph
And the traversal of
diff --git a/gremlin-test/features/map/Order.feature b/gremlin-test/features/map/Order.feature
index 1d4331f..207675a 100644
--- a/gremlin-test/features/map/Order.feature
+++ b/gremlin-test/features/map/Order.feature
@@ -224,13 +224,13 @@
When iterated to list
Then the result should be ordered
| result |
- | m[{"vadas":"d[0].i","peter":"d[0.2].d","josh":"d[1.4].d","marko":"d[1.9].d"}] |
+ | m[{"peter":"d[0.2].d","josh":"d[1.4].d","marko":"d[1.9].d"}] |
- Scenario: g_V_localXbothE_weight_foldX_order_byXsumXlocalX_descX
+ Scenario: g_V_mapXbothE_weight_foldX_order_byXsumXlocalX_descX
Given the modern graph
And the traversal of
"""
- g.V().local(__.bothE().values("weight").fold()).order().by(__.sum(Scope.local), Order.desc)
+ g.V().map(__.bothE().values("weight").fold()).order().by(__.sum(Scope.local), Order.desc)
"""
When iterated to list
Then the result should be ordered
@@ -265,7 +265,6 @@
| m[{"marko":"d[1.9].d"}] |
| m[{"josh":"d[1.4].d"}] |
| m[{"peter":"d[0.2].d"}] |
- | m[{"vadas":"d[0].i"}] |
Scenario: g_V_asXvX_mapXbothE_weight_foldX_sumXlocalX_asXsX_selectXv_sX_order_byXselectXsX_descX
Given the modern graph
@@ -367,4 +366,4 @@
Then nothing should happen because
"""
TODO
- """
\ No newline at end of file
+ """
diff --git a/gremlin-test/features/map/Select.feature b/gremlin-test/features/map/Select.feature
index 945b1e4..29c5fa6 100644
--- a/gremlin-test/features/map/Select.feature
+++ b/gremlin-test/features/map/Select.feature
@@ -204,6 +204,22 @@
| v[ripple] |
| v[peter] |
+ Scenario: g_VX1X_groupXaX_byXconstantXaXX_byXnameX_selectXaX_selectXaX
+ Given the modern graph
+ And using the parameter v1Id defined as "v[marko].id"
+ And the traversal of
+ """
+ g.V(v1Id).group("a").
+ by(__.constant("a")).
+ by(__.values("name")).
+ barrier().
+ select("a").select("a")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | marko |
+
Scenario: g_VX1X_asXhereX_out_selectXhereX
Given the modern graph
And using the parameter v1Id defined as "v[marko].id"
diff --git a/gremlin-test/features/map/Sum.feature b/gremlin-test/features/map/Sum.feature
index 2c89946..0e20368 100644
--- a/gremlin-test/features/map/Sum.feature
+++ b/gremlin-test/features/map/Sum.feature
@@ -17,7 +17,7 @@
Feature: Step - sum()
- Scenario: g_V_valuesXageX_sum
+ Scenario: g_V_age_sum
Given the modern graph
And the traversal of
"""
@@ -28,6 +28,35 @@
| result |
| d[123].l |
+ Scenario: g_V_foo_sum
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("foo").sum()
+ """
+ When iterated to list
+ Then the result should be empty
+
+ Scenario: g_V_age_fold_sumXlocalX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("age").fold().sum(Scope.local)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[123].i |
+
+ Scenario: g_V_foo_fold_sumXlocalX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().values("foo").fold().sum(Scope.local)
+ """
+ When iterated to list
+ Then the result should be empty
+
Scenario: g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_sumX
Given the modern graph
And the traversal of
@@ -37,4 +66,4 @@
When iterated to list
Then the result should be unordered
| result |
- | m[{"ripple":"d[1.0].d","lop":"d[1.0].d"}] |
\ No newline at end of file
+ | m[{"ripple":"d[1.0].d","lop":"d[1.0].d"}] |
diff --git a/gremlin-test/features/sideEffect/Group.feature b/gremlin-test/features/sideEffect/Group.feature
index cd2a5ce..87f6d04 100644
--- a/gremlin-test/features/sideEffect/Group.feature
+++ b/gremlin-test/features/sideEffect/Group.feature
@@ -101,7 +101,7 @@
When iterated to list
Then the result should be unordered
| result |
- | m[{"software":"d[0].i", "person":"d[3.5].d"}] |
+ | m[{"person":"d[3.5].d"}] |
Scenario: g_V_repeatXbothXfollowedByXX_timesX2X_group_byXsongTypeX_byXcountX
Given the grateful graph
@@ -206,7 +206,7 @@
When iterated to list
Then the result should be unordered
| result |
- | m[{"cover":{"followedBy":"d[777982].l", "sungBy":"d[0].i", "writtenBy":"d[0].i"}, "":{"followedBy":"d[179350].l"}, "original":{"followedBy":"d[2185613].l", "sungBy":"d[0].i", "writtenBy":"d[0].i"}}] |
+ | m[{"cover":{"followedBy":"d[777982].l"}, "":{"followedBy":"d[179350].l"}, "original":{"followedBy":"d[2185613].l"}}] |
Scenario: g_V_groupXmX_byXnameX_byXinXknowsX_nameX_capXmX
Given the modern graph
diff --git a/gremlin-test/pom.xml b/gremlin-test/pom.xml
index 6929aa5..2066c5a 100644
--- a/gremlin-test/pom.xml
+++ b/gremlin-test/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-test</artifactId>
<name>Apache TinkerPop :: Gremlin Test</name>
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractFileGraphProvider.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractFileGraphProvider.java
new file mode 100644
index 0000000..d16b289
--- /dev/null
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractFileGraphProvider.java
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin;
+
+import org.apache.commons.configuration.Configuration;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONResourceAccess;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoResourceAccess;
+import org.apache.tinkerpop.gremlin.structure.io.script.ScriptResourceAccess;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+
+/**
+ * A base {@link GraphProvider} that is typically for use with Hadoop-based graphs as it enables access to the various
+ * resource data files that are used in the tests.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public abstract class AbstractFileGraphProvider extends AbstractGraphProvider {
+
+ protected static final Random RANDOM = new Random();
+
+ protected boolean graphSONInput = false;
+
+ public static Map<String, String> PATHS = new HashMap<>();
+ static {
+ try {
+ final List<String> kryoResources = Arrays.asList(
+ "tinkerpop-modern-v3d0.kryo",
+ "grateful-dead-v3d0.kryo",
+ "tinkerpop-classic-v3d0.kryo",
+ "tinkerpop-crew-v3d0.kryo",
+ "tinkerpop-sink-v3d0.kryo");
+ for (final String fileName : kryoResources) {
+ PATHS.put(fileName, TestHelper.generateTempFileFromResource(GryoResourceAccess.class, fileName, "").getAbsolutePath().replace('\\', '/'));
+ }
+
+ final List<String> graphsonResources = Arrays.asList(
+ "tinkerpop-modern-typed-v2d0.json",
+ "tinkerpop-modern-v3d0.json",
+ "grateful-dead-typed-v2d0.json",
+ "grateful-dead-v3d0.json",
+ "tinkerpop-classic-typed-v2d0.json",
+ "tinkerpop-classic-v3d0.json",
+ "tinkerpop-crew-typed-v2d0.json",
+ "tinkerpop-crew-v3d0.json",
+ "tinkerpop-sink-v3d0.json");
+ for (final String fileName : graphsonResources) {
+ PATHS.put(fileName, TestHelper.generateTempFileFromResource(GraphSONResourceAccess.class, fileName, "").getAbsolutePath().replace('\\', '/'));
+ }
+
+ final List<String> scriptResources = Arrays.asList(
+ "tinkerpop-classic.txt",
+ "script-input.groovy",
+ "script-output.groovy",
+ "grateful-dead.txt",
+ "script-input-grateful-dead.groovy",
+ "script-output-grateful-dead.groovy");
+ for (final String fileName : scriptResources) {
+ PATHS.put(fileName, TestHelper.generateTempFileFromResource(ScriptResourceAccess.class, fileName, "").getAbsolutePath().replace('\\', '/'));
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void clear(final Graph graph, final Configuration configuration) throws Exception {
+ if (graph != null)
+ graph.close();
+ }
+
+ protected String getInputLocation(final Graph g, final LoadGraphWith.GraphData graphData) {
+ final String type = this.graphSONInput ? "-v3d0.json" : "-v3d0.kryo";
+
+ if (graphData.equals(LoadGraphWith.GraphData.GRATEFUL))
+ return PATHS.get("grateful-dead" + type);
+ else if (graphData.equals(LoadGraphWith.GraphData.MODERN))
+ return PATHS.get("tinkerpop-modern" + type);
+ else if (graphData.equals(LoadGraphWith.GraphData.CLASSIC))
+ return PATHS.get("tinkerpop-classic" + type);
+ else if (graphData.equals(LoadGraphWith.GraphData.CREW))
+ return PATHS.get("tinkerpop-crew" + type);
+ else if (graphData.equals(LoadGraphWith.GraphData.SINK))
+ return PATHS.get("tinkerpop-sink" + type);
+ else
+ throw new RuntimeException("Could not load graph with " + graphData);
+ }
+
+}
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
index 25d7a55..7ca44ba 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
@@ -29,20 +29,23 @@
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.javatuples.Pair;
import org.junit.After;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.rules.TestName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
-import java.util.Random;
+import java.util.Map;
+import java.util.Optional;
import java.util.Set;
import java.util.function.Consumer;
import java.util.stream.Collectors;
@@ -61,6 +64,7 @@
*/
public abstract class AbstractGremlinTest {
private static final Logger logger = LoggerFactory.getLogger(AbstractGremlinTest.class);
+
protected Graph graph;
protected GraphTraversalSource g;
protected Configuration config;
@@ -75,8 +79,16 @@
final LoadGraphWith[] loadGraphWiths = testMethod.getAnnotationsByType(LoadGraphWith.class);
final LoadGraphWith loadGraphWith = loadGraphWiths.length == 0 ? null : loadGraphWiths[0];
final LoadGraphWith.GraphData loadGraphWithData = null == loadGraphWith ? null : loadGraphWith.value();
+ final Set<FeatureRequirement> featureRequirementSet = getFeatureRequirementsForTest(testMethod, loadGraphWiths);
graphProvider = GraphManager.getGraphProvider();
+
+ // pre-check if available from graph provider to avoid graph creation
+ final Optional<Graph.Features> staticFeatures = graphProvider.getStaticFeatures();
+ if (staticFeatures.isPresent()) {
+ assumeRequirementsAreMetForTest(featureRequirementSet, staticFeatures.get(), true);
+ }
+
graphProvider.getTestListener().ifPresent(l -> l.onTestStart(this.getClass(), name.getMethodName()));
config = graphProvider.standardGraphConfiguration(this.getClass(), name.getMethodName(), loadGraphWithData);
@@ -87,31 +99,10 @@
graph = graphProvider.openTestGraph(config);
g = graphProvider.traversal(graph);
- // get feature requirements on the test method and add them to the list of ones to check
- final FeatureRequirement[] featureRequirement = testMethod.getAnnotationsByType(FeatureRequirement.class);
- final List<FeatureRequirement> frs = new ArrayList<>(Arrays.asList(featureRequirement));
-
- // if the graph is loading data then it will come with it's own requirements
- if (loadGraphWiths.length > 0) frs.addAll(loadGraphWiths[0].value().featuresRequired());
-
- // if the graph has a set of feature requirements bundled together then add those
- final FeatureRequirementSet[] featureRequirementSets = testMethod.getAnnotationsByType(FeatureRequirementSet.class);
- if (featureRequirementSets.length > 0)
- frs.addAll(Arrays.stream(featureRequirementSets)
- .flatMap(f -> f.value().featuresRequired().stream()).collect(Collectors.toList()));
-
- // process the unique set of feature requirements
- final Set<FeatureRequirement> featureRequirementSet = new HashSet<>(frs);
- for (FeatureRequirement fr : featureRequirementSet) {
- try {
- //System.out.println(String.format("Assume that %s meets Feature Requirement - %s - with %s", fr.featureClass().getSimpleName(), fr.feature(), fr.supported()));
- assumeThat(String.format("%s does not support all of the features required by this test so it will be ignored: %s.%s=%s",
- graph.getClass().getSimpleName(), fr.featureClass().getSimpleName(), fr.feature(), fr.supported()),
- graph.features().supports(fr.featureClass(), fr.feature()), is(fr.supported()));
- } catch (NoSuchMethodException nsme) {
- throw new NoSuchMethodException(String.format("[supports%s] is not a valid feature on %s", fr.feature(), fr.featureClass()));
- }
- }
+ // even if we checked static features earlier it's of little cost to recheck again with the real graph
+ // once it is instantiated. the real cost savings is preventing graph creation in the first place so
+ // let's double check that all is legit.
+ assumeRequirementsAreMetForTest(featureRequirementSet, graph.features(), false);
beforeLoadGraphWith(graph);
@@ -121,6 +112,25 @@
afterLoadGraphWith(graph);
}
+ private static void assumeRequirementsAreMetForTest(final Set<FeatureRequirement> featureRequirementSet,
+ final Graph.Features features, final boolean staticCheck)
+ throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
+ for (FeatureRequirement fr : featureRequirementSet) {
+ try {
+ assumeThat(String.format("Features of the graph do not support all of the features required by this test so it will be ignored: %s.%s=%s",
+ fr.featureClass().getSimpleName(), fr.feature(), fr.supported()),
+ features.supports(fr.featureClass(), fr.feature()), is(fr.supported()));
+ } catch (NoSuchMethodException nsme) {
+ throw new NoSuchMethodException(String.format("[supports%s] is not a valid feature on %s", fr.feature(), fr.featureClass()));
+ } catch (UnsupportedOperationException uoe) {
+ // no worries if this is a check of static features - it just means that we can't use the cache to
+ // support this check and will have to incur the cost of instantiating a graph instance directly. but,
+ // if this is not a static check then something else is amiss and we should throw.
+ if (staticCheck) throw uoe;
+ }
+ }
+ }
+
protected void beforeLoadGraphWith(final Graph g) throws Exception {
// do nothing
}
@@ -263,6 +273,24 @@
AbstractGremlinTest.verifyUniqueStepIds(traversal, 0, new HashSet<>());
}
+ private static Set<FeatureRequirement> getFeatureRequirementsForTest(final Method testMethod, final LoadGraphWith[] loadGraphWiths) {
+ // get feature requirements on the test method and add them to the list of ones to check
+ final FeatureRequirement[] featureRequirement = testMethod.getAnnotationsByType(FeatureRequirement.class);
+ final List<FeatureRequirement> frs = new ArrayList<>(Arrays.asList(featureRequirement));
+
+ // if the graph is loading data then it will come with it's own requirements
+ if (loadGraphWiths.length > 0) frs.addAll(loadGraphWiths[0].value().featuresRequired());
+
+ // if the graph has a set of feature requirements bundled together then add those
+ final FeatureRequirementSet[] featureRequirementSets = testMethod.getAnnotationsByType(FeatureRequirementSet.class);
+ if (featureRequirementSets.length > 0)
+ frs.addAll(Arrays.stream(featureRequirementSets)
+ .flatMap(f -> f.value().featuresRequired().stream()).collect(Collectors.toList()));
+
+ // process the unique set of feature requirements
+ return new HashSet<>(frs);
+ }
+
private static void verifyUniqueStepIds(final Traversal.Admin<?, ?> traversal, final int depth, final Set<String> ids) {
for (final Step step : traversal.asAdmin().getSteps()) {
/*for (int i = 0; i < depth; i++) System.out.print("\t");
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphManager.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphManager.java
index 6886465..7506226 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphManager.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphManager.java
@@ -183,6 +183,11 @@
if (innerGraphProvider instanceof AutoCloseable)
((AutoCloseable) innerGraphProvider).close();
}
+
+ @Override
+ public Optional<Graph.Features> getStaticFeatures() {
+ return innerGraphProvider.getStaticFeatures();
+ }
}
}
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
index c785cfc..1fcb147 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
@@ -294,6 +294,22 @@
}
/**
+ * Gets a {@link Graph.Features} implementation that contains graph feature configuration that will never change
+ * from execution to execution of the tests given this current {@code GraphProvider} implementation. Implementing
+ * this method will allow the test suite to avoid creation of a {@link Graph} instance and thus speed up the
+ * execution of tests if that creation process is expensive. It is important that this static set of features be
+ * representative of what the {@link Graph} instance produced by this {@code GraphProvider} can actually do or
+ * else the cost of {@link Graph} instantiation will be incurred when it doesn't need to be. It is also important
+ * that this method be faster than the cost of {@link Graph} creation in the first place or there really won't be
+ * any difference in execution speed. In cases where some features are static and others are not, simply throw
+ * an {@code UnsupportedOperationException} from those features to let the test suite know that it cannot rely
+ * on them and the test suite will revert to using a constructed {@link Graph} instance.
+ */
+ public default Optional<Graph.Features> getStaticFeatures() {
+ return Optional.empty();
+ }
+
+ /**
* An annotation to be applied to a {@code GraphProvider} implementation that provides additional information
* about its intentions. The {@code Descriptor} is required by those {@code GraphProvider} implementations
* that will be assigned to test suites that use
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
index a9c1a09..3edaf9e 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
@@ -1349,13 +1349,13 @@
assertEquals(Long.valueOf(0l), result.graph().traversal().E().count().next());
assertEquals(Long.valueOf(0l), result.graph().traversal().V().values().count().next());
assertEquals(Long.valueOf(0l), result.graph().traversal().E().values().count().next());
- assertEquals(0, result.graph().traversal().V().values("money").sum().next());
+ assertFalse(result.graph().traversal().V().values("money").sum().hasNext());
///
assertEquals(Long.valueOf(6l), graph.traversal().V().count().next());
assertEquals(Long.valueOf(6l), graph.traversal().E().count().next());
assertEquals(Long.valueOf(12l), graph.traversal().V().values().count().next());
assertEquals(Long.valueOf(6l), graph.traversal().E().values().count().next());
- assertEquals(0, graph.traversal().V().values("money").sum().next());
+ assertFalse(graph.traversal().V().values("money").sum().hasNext());
}
}
@@ -1375,7 +1375,7 @@
assertEquals(Long.valueOf(6l), graph.traversal().E().count().next());
assertEquals(Long.valueOf(12l), graph.traversal().V().values().count().next());
assertEquals(Long.valueOf(6l), graph.traversal().E().values().count().next());
- assertEquals(0, graph.traversal().V().values("money").sum().next());
+ assertFalse(graph.traversal().V().values("money").sum().hasNext());
}
}
@@ -1395,7 +1395,7 @@
assertEquals(Long.valueOf(6l), graph.traversal().E().count().next());
assertEquals(Long.valueOf(12l), graph.traversal().V().values().count().next());
assertEquals(Long.valueOf(6l), graph.traversal().E().values().count().next());
- assertEquals(0, graph.traversal().V().values("money").sum().next());
+ assertFalse(graph.traversal().V().values("money").sum().hasNext());
}
}
@@ -1409,13 +1409,13 @@
assertEquals(Long.valueOf(6l), result.graph().traversal().E().count().next());
assertEquals(Long.valueOf(12l), result.graph().traversal().V().values().count().next());
assertEquals(Long.valueOf(6l), result.graph().traversal().E().values().count().next());
- assertEquals(0, result.graph().traversal().V().values("money").sum().next());
+ assertFalse(result.graph().traversal().V().values("money").sum().hasNext());
///
assertEquals(Long.valueOf(6l), graph.traversal().V().count().next());
assertEquals(Long.valueOf(6l), graph.traversal().E().count().next());
assertEquals(Long.valueOf(12l), graph.traversal().V().values().count().next());
assertEquals(Long.valueOf(6l), graph.traversal().E().values().count().next());
- assertEquals(0, graph.traversal().V().values("money").sum().next());
+ assertFalse(graph.traversal().V().values("money").sum().hasNext());
}
}
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalEngine.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalEngine.java
new file mode 100644
index 0000000..e972cdf
--- /dev/null
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalEngine.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.process.traversal;
+
+import org.apache.tinkerpop.gremlin.process.computer.Computer;
+
+/**
+ * A TraversalEngine is a test component that helps determine the engine on which a traversal test will execute. This
+ * interface was originally in {@code gremlin-core} but deprecated in favor of {@link Computer}. Since this interface
+ * was heavily bound to the test suite it was maintained until 3.4.0 when it was finally moved here to
+ * {@code gremlin-test} where it simply serves as testing infrastructure to provide hints on whether a test will be
+ * executed with a {@link Computer} or not.
+ *
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public interface TraversalEngine {
+ public enum Type {STANDARD, COMPUTER}
+}
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/UnionTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/UnionTest.java
index 1c06943..bbe5eff 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/UnionTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/UnionTest.java
@@ -135,7 +135,7 @@
public void g_VX1_2X_localXunionXoutE_count__inE_count__outE_weight_sumXX() {
final Traversal<Vertex, Number> traversal = get_g_VX1_2X_localXunionXoutE_count__inE_count__outE_weight_sumXX(convertToVertexId("marko"), convertToVertexId("vadas"));
printTraversalForm(traversal);
- checkResults(Arrays.asList(0l, 0l, 0, 3l, 1l, 1.9d), traversal);
+ checkResults(Arrays.asList(3L, 0L, 1.9, 0L, 1L), traversal);
}
@Test
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MaxTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MaxTest.java
index fae3f92..22f68de 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MaxTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MaxTest.java
@@ -21,6 +21,7 @@
import org.apache.tinkerpop.gremlin.LoadGraphWith;
import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
+import org.apache.tinkerpop.gremlin.process.traversal.Scope;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.Test;
@@ -41,6 +42,16 @@
public abstract Traversal<Vertex, Integer> get_g_V_age_max();
+ public abstract Traversal<Vertex, Integer> get_g_V_age_fold_maxXlocalX();
+
+ public abstract Traversal<Vertex, Comparable> get_g_V_foo_max();
+
+ public abstract Traversal<Vertex, Comparable> get_g_V_foo_fold_maxXlocalX();
+
+ public abstract Traversal<Vertex, String> get_g_V_name_max();
+
+ public abstract Traversal<Vertex, String> get_g_V_name_fold_maxXlocalX();
+
public abstract Traversal<Vertex, Integer> get_g_V_repeatXbothX_timesX5X_age_max();
public abstract Traversal<Vertex, Map<String, Number>> get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_maxX();
@@ -55,6 +66,46 @@
@Test
@LoadGraphWith(MODERN)
+ public void g_V_age_fold_maxXlocalX() {
+ final Traversal<Vertex, Integer> traversal = get_g_V_age_fold_maxXlocalX();
+ printTraversalForm(traversal);
+ checkResults(Arrays.asList(35), traversal);
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_foo_max() {
+ final Traversal<Vertex, Comparable> traversal = get_g_V_foo_max();
+ printTraversalForm(traversal);
+ assertFalse(traversal.hasNext());
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_foo_fold_maxXlocalX() {
+ final Traversal<Vertex, Comparable> traversal = get_g_V_foo_fold_maxXlocalX();
+ printTraversalForm(traversal);
+ assertFalse(traversal.hasNext());
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_name_max() {
+ final Traversal<Vertex, String> traversal = get_g_V_name_max();
+ printTraversalForm(traversal);
+ checkResults(Arrays.asList("vadas"), traversal);
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_name_fold_maxXlocalX() {
+ final Traversal<Vertex, String> traversal = get_g_V_name_fold_maxXlocalX();
+ printTraversalForm(traversal);
+ checkResults(Arrays.asList("vadas"), traversal);
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
public void g_V_repeatXbothX_timesX5X_age_max() {
final Traversal<Vertex, Integer> traversal = get_g_V_repeatXbothX_timesX5X_age_max();
printTraversalForm(traversal);
@@ -82,6 +133,31 @@
}
@Override
+ public Traversal<Vertex, Integer> get_g_V_age_fold_maxXlocalX() {
+ return g.V().values("age").fold().max(Scope.local);
+ }
+
+ @Override
+ public Traversal<Vertex, Comparable> get_g_V_foo_max() {
+ return g.V().values("foo").max();
+ }
+
+ @Override
+ public Traversal<Vertex, Comparable> get_g_V_foo_fold_maxXlocalX() {
+ return g.V().values("foo").fold().max(Scope.local);
+ }
+
+ @Override
+ public Traversal<Vertex, String> get_g_V_name_max() {
+ return g.V().values("name").max();
+ }
+
+ @Override
+ public Traversal<Vertex, String> get_g_V_name_fold_maxXlocalX() {
+ return g.V().values("name").fold().max(Scope.local);
+ }
+
+ @Override
public Traversal<Vertex, Integer> get_g_V_repeatXbothX_timesX5X_age_max() {
return g.V().repeat(both()).times(5).values("age").max();
}
@@ -91,4 +167,4 @@
return g.V().hasLabel("software").<String, Number>group().by("name").by(bothE().values("weight").max());
}
}
-}
\ No newline at end of file
+}
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MeanTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MeanTest.java
index ab47605..34bef6d 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MeanTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MeanTest.java
@@ -21,11 +21,13 @@
import org.apache.tinkerpop.gremlin.LoadGraphWith;
import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
+import org.apache.tinkerpop.gremlin.process.traversal.Scope;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.util.Arrays;
import java.util.Map;
import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
@@ -40,16 +42,32 @@
public abstract Traversal<Vertex, Double> get_g_V_age_mean();
+ public abstract Traversal<Vertex, Double> get_g_V_age_fold_meanXlocalX();
+
+ public abstract Traversal<Vertex, Number> get_g_V_foo_mean();
+
+ public abstract Traversal<Vertex, Number> get_g_V_foo_fold_meanXlocalX();
+
public abstract Traversal<Vertex, Map<String, Number>> get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_meanX();
@Test
@LoadGraphWith(MODERN)
public void g_V_age_mean() {
- final Traversal<Vertex, Double> traversal = get_g_V_age_mean();
- printTraversalForm(traversal);
- final Double mean = traversal.next();
- assertEquals(30.75, mean, 0.05);
- assertFalse(traversal.hasNext());
+ for (final Traversal<Vertex, Double> traversal : Arrays.asList(get_g_V_age_mean(), get_g_V_age_fold_meanXlocalX())) {
+ printTraversalForm(traversal);
+ final Double mean = traversal.next();
+ assertEquals(30.75, mean, 0.05);
+ assertFalse(traversal.hasNext());
+ }
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_foo_mean() {
+ for (final Traversal<Vertex, Number> traversal : Arrays.asList(get_g_V_foo_mean(), get_g_V_foo_fold_meanXlocalX())) {
+ printTraversalForm(traversal);
+ assertFalse(traversal.hasNext());
+ }
}
@Test
@@ -73,6 +91,21 @@
}
@Override
+ public Traversal<Vertex, Double> get_g_V_age_fold_meanXlocalX() {
+ return g.V().values("age").fold().mean(Scope.local);
+ }
+
+ @Override
+ public Traversal<Vertex, Number> get_g_V_foo_mean() {
+ return g.V().values("foo").mean();
+ }
+
+ @Override
+ public Traversal<Vertex, Number> get_g_V_foo_fold_meanXlocalX() {
+ return g.V().values("foo").fold().mean(Scope.local);
+ }
+
+ @Override
public Traversal<Vertex, Map<String, Number>> get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_meanX() {
return g.V().hasLabel("software").<String, Number>group().by("name").by(bothE().values("weight").mean());
}
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MinTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MinTest.java
index 947137f..06093cb 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MinTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MinTest.java
@@ -21,6 +21,7 @@
import org.apache.tinkerpop.gremlin.LoadGraphWith;
import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
+import org.apache.tinkerpop.gremlin.process.traversal.Scope;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.Test;
@@ -43,11 +44,21 @@
public abstract Traversal<Vertex, Integer> get_g_V_age_min();
+ public abstract Traversal<Vertex, Integer> get_g_V_age_fold_minXlocalX();
+
+ public abstract Traversal<Vertex, Comparable> get_g_V_foo_min();
+
+ public abstract Traversal<Vertex, Comparable> get_g_V_foo_fold_minXlocalX();
+
+ public abstract Traversal<Vertex, String> get_g_V_name_min();
+
+ public abstract Traversal<Vertex, String> get_g_V_name_fold_minXlocalX();
+
public abstract Traversal<Vertex, Integer> get_g_V_repeatXbothX_timesX5X_age_min();
public abstract Traversal<Vertex, Map<String, Number>> get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_minX();
- public abstract Traversal<Vertex, Number> get_g_V_foo_injectX9999999999X_min();
+ public abstract Traversal<Vertex, Comparable> get_g_V_foo_injectX9999999999X_min();
@Test
@LoadGraphWith(MODERN)
@@ -59,6 +70,46 @@
@Test
@LoadGraphWith(MODERN)
+ public void g_V_age_fold_minXlocalX() {
+ final Traversal<Vertex, Integer> traversal = get_g_V_age_fold_minXlocalX();
+ printTraversalForm(traversal);
+ checkResults(Arrays.asList(27), traversal);
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_foo_min() {
+ final Traversal<Vertex, Comparable> traversal = get_g_V_foo_min();
+ printTraversalForm(traversal);
+ assertFalse(traversal.hasNext());
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_foo_fold_minXlocalX() {
+ final Traversal<Vertex, Comparable> traversal = get_g_V_foo_fold_minXlocalX();
+ printTraversalForm(traversal);
+ assertFalse(traversal.hasNext());
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_name_min() {
+ final Traversal<Vertex, String> traversal = get_g_V_name_min();
+ printTraversalForm(traversal);
+ checkResults(Arrays.asList("josh"), traversal);
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_name_fold_minXlocalX() {
+ final Traversal<Vertex, String> traversal = get_g_V_name_fold_minXlocalX();
+ printTraversalForm(traversal);
+ checkResults(Arrays.asList("josh"), traversal);
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
public void g_V_repeatXbothX_timesX5X_age_min() {
final Traversal<Vertex, Integer> traversal = get_g_V_repeatXbothX_timesX5X_age_min();
printTraversalForm(traversal);
@@ -81,10 +132,10 @@
@Test
@LoadGraphWith(MODERN)
public void g_V_foo_injectX9999999999X_min() {
- final Traversal<Vertex, Number> traversal = get_g_V_foo_injectX9999999999X_min();
+ final Traversal<Vertex, Comparable> traversal = get_g_V_foo_injectX9999999999X_min();
printTraversalForm(traversal);
assertTrue(traversal.hasNext());
- assertEquals(9999999999L, traversal.next().longValue());
+ assertEquals(9999999999L, traversal.next());
assertFalse(traversal.hasNext());
}
@@ -96,6 +147,31 @@
}
@Override
+ public Traversal<Vertex, Integer> get_g_V_age_fold_minXlocalX() {
+ return g.V().values("age").fold().min(Scope.local);
+ }
+
+ @Override
+ public Traversal<Vertex, Comparable> get_g_V_foo_min() {
+ return g.V().values("foo").min();
+ }
+
+ @Override
+ public Traversal<Vertex, Comparable> get_g_V_foo_fold_minXlocalX() {
+ return g.V().values("foo").fold().min(Scope.local);
+ }
+
+ @Override
+ public Traversal<Vertex, String> get_g_V_name_min() {
+ return g.V().values("name").min();
+ }
+
+ @Override
+ public Traversal<Vertex, String> get_g_V_name_fold_minXlocalX() {
+ return g.V().values("name").fold().min(Scope.local);
+ }
+
+ @Override
public Traversal<Vertex, Integer> get_g_V_repeatXbothX_timesX5X_age_min() {
return g.V().repeat(both()).times(5).values("age").min();
}
@@ -106,7 +182,7 @@
}
@Override
- public Traversal<Vertex, Number> get_g_V_foo_injectX9999999999X_min() {
+ public Traversal<Vertex, Comparable> get_g_V_foo_injectX9999999999X_min() {
return g.V().values("foo").inject(9999999999L).min();
}
}
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
index 3cb50aa..2bb1bc7 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
@@ -80,7 +80,7 @@
public abstract Traversal<Vertex, Map<String, List<Vertex>>> get_g_V_group_byXlabelX_byXname_order_byXdescX_foldX();
- public abstract Traversal<Vertex, List<Double>> get_g_V_localXbothE_weight_foldX_order_byXsumXlocalX_descX();
+ public abstract Traversal<Vertex, List<Double>> get_g_V_mapXbothE_weight_foldX_order_byXsumXlocalX_descX();
public abstract Traversal<Vertex, Map<String, Object>> get_g_V_asXvX_mapXbothE_weight_foldX_sumXlocalX_asXsX_selectXv_sX_order_byXselectXsX_descX();
@@ -264,8 +264,8 @@
@Test
@LoadGraphWith(MODERN)
- public void g_V_localXbothE_weight_foldX_order_byXsumXlocalX_descX() {
- final Traversal<Vertex, List<Double>> traversal = get_g_V_localXbothE_weight_foldX_order_byXsumXlocalX_descX();
+ public void g_V_mapXbothE_weight_foldX_order_byXsumXlocalX_descX() {
+ final Traversal<Vertex, List<Double>> traversal = get_g_V_mapXbothE_weight_foldX_order_byXsumXlocalX_descX();
final List<List<Double>> list = traversal.toList();
assertEquals(list.get(0).size(), 3);
assertEquals(list.get(1).size(), 3);
@@ -406,12 +406,9 @@
assertTrue(traversal.hasNext());
final Map<String, Number> m = traversal.next();
assertFalse(traversal.hasNext());
- assertEquals(4, m.size());
+ assertEquals(3, m.size());
final Iterator<Map.Entry<String, Number>> iterator = m.entrySet().iterator();
Map.Entry<String, Number> entry = iterator.next();
- assertEquals("vadas", entry.getKey());
- assertEquals(0.0, entry.getValue().doubleValue(), 0.0001);
- entry = iterator.next();
assertEquals("peter", entry.getKey());
assertEquals(0.2, entry.getValue().doubleValue(), 0.0001);
entry = iterator.next();
@@ -437,9 +434,6 @@
entry = traversal.next();
assertEquals("peter", entry.getKey());
assertEquals(0.2, entry.getValue().doubleValue(), 0.0001);
- entry = traversal.next();
- assertEquals("vadas", entry.getKey());
- assertEquals(0.0, entry.getValue().doubleValue(), 0.0001);
assertFalse(traversal.hasNext());
}
@@ -515,8 +509,8 @@
}
@Override
- public Traversal<Vertex, List<Double>> get_g_V_localXbothE_weight_foldX_order_byXsumXlocalX_descX() {
- return g.V().local(__.bothE().<Double>values("weight").fold()).order().by(__.sum(Scope.local), Order.desc);
+ public Traversal<Vertex, List<Double>> get_g_V_mapXbothE_weight_foldX_order_byXsumXlocalX_descX() {
+ return g.V().map(__.bothE().<Double>values("weight").fold()).order().by(__.sum(Scope.local), Order.desc);
}
@Override
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java
index 07a2b04..2312967 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java
@@ -23,6 +23,7 @@
import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgram;
+import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.PageRank;
import org.apache.tinkerpop.gremlin.process.traversal.Order;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
@@ -63,6 +64,8 @@
public abstract Traversal<Vertex, Map<String, List<Object>>> get_g_V_hasLabelXsoftwareX_hasXname_rippleX_pageRankX1X_byXinEXcreatedXX_timesX1X_byXpriorsX_inXcreatedX_unionXboth__identityX_valueMapXname_priorsX();
+ public abstract Traversal<Vertex, Map<Object, List<Vertex>>> get_g_V_outXcreatedX_groupXmX_byXlabelX_pageRankX1X_withXpropertyName_pageRankXX_withXedges_inEXX_withXtimes_1X_inXcreatedX_groupXmX_byXpageRankX_capXmX();
+
public abstract Traversal<Vertex, Map<Object, List<Vertex>>> get_g_V_outXcreatedX_groupXmX_byXlabelX_pageRankX1X_byXpageRankX_byXinEX_timesX1X_inXcreatedX_groupXmX_byXpageRankX_capXmX();
@Test
@@ -238,6 +241,39 @@
});
}
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_outXcreatedX_groupXmX_byXlabelX_pageRankX1X_withXPROPERTY_NAME_pageRankXX_withXEDGES_inEXX_withXTIMES_1X_inXcreatedX_groupXmX_byXpageRankX_capXmX() {
+ // [{2.0=[v[4], v[4], v[4], v[4]], 1.0=[v[6], v[6], v[6], v[1], v[1], v[1]], software=[v[5], v[3], v[3], v[3]]}]
+ final Traversal<Vertex, Map<Object, List<Vertex>>> traversal = get_g_V_outXcreatedX_groupXmX_byXlabelX_pageRankX1X_withXpropertyName_pageRankXX_withXedges_inEXX_withXtimes_1X_inXcreatedX_groupXmX_byXpageRankX_capXmX();
+ printTraversalForm(traversal);
+ final Map<Object, List<Vertex>> map = traversal.next();
+ assertFalse(traversal.hasNext());
+ assertEquals(3, map.size());
+ assertTrue(map.containsKey("software"));
+ map.forEach((k, v) -> {
+ boolean found = false;
+ if (!k.equals("software") && v.size() == 4) {
+ assertEquals(2.0d, ((Number) k).doubleValue(), 0.01d);
+ assertEquals(4, v.stream().filter(vertex -> vertex.id().equals(convertToVertexId(graph, "josh"))).count());
+ found = true;
+ } else if (v.size() == 6) {
+ assertEquals(1.0d, ((Number) k).doubleValue(), 0.01d);
+ assertEquals(3, v.stream().filter(vertex -> vertex.id().equals(convertToVertexId(graph, "peter"))).count());
+ assertEquals(3, v.stream().filter(vertex -> vertex.id().equals(convertToVertexId(graph, "marko"))).count());
+ found = true;
+ } else if (v.size() == 4) {
+ assertEquals("software", k);
+ assertEquals(3, v.stream().filter(vertex -> vertex.id().equals(convertToVertexId(graph, "lop"))).count());
+ assertEquals(1, v.stream().filter(vertex -> vertex.id().equals(convertToVertexId(graph, "ripple"))).count());
+ found = true;
+ }
+
+ if (!found)
+ fail("There are too many key/values: " + k + "--" + v);
+ });
+ }
+
public static class Traversals extends PageRankTest {
@Override
@@ -284,5 +320,10 @@
public Traversal<Vertex, Map<Object, List<Vertex>>> get_g_V_outXcreatedX_groupXmX_byXlabelX_pageRankX1X_byXpageRankX_byXinEX_timesX1X_inXcreatedX_groupXmX_byXpageRankX_capXmX() {
return g.V().out("created").group("m").by(T.label).pageRank(1.0).by("pageRank").by(__.inE()).times(1).in("created").group("m").by("pageRank").cap("m");
}
+
+ @Override
+ public Traversal<Vertex, Map<Object, List<Vertex>>> get_g_V_outXcreatedX_groupXmX_byXlabelX_pageRankX1X_withXpropertyName_pageRankXX_withXedges_inEXX_withXtimes_1X_inXcreatedX_groupXmX_byXpageRankX_capXmX() {
+ return g.V().out("created").group("m").by(T.label).pageRank(1.0).with(PageRank.propertyName, "pageRank").with(PageRank.edges, __.inE()).with(PageRank.times, 1).in("created").group("m").by("pageRank").cap("m");
+ }
}
}
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PeerPressureTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PeerPressureTest.java
index f9615d5..b70cb02 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PeerPressureTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PeerPressureTest.java
@@ -23,6 +23,7 @@
import org.apache.tinkerpop.gremlin.TestHelper;
import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
import org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.PeerPressureVertexProgram;
+import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.PeerPressure;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.structure.Vertex;
@@ -50,6 +51,8 @@
public abstract Traversal<Vertex, Map<String, List<Object>>> get_g_V_hasXname_rippleX_inXcreatedX_peerPressure_byXoutEX_byXclusterX_repeatXunionXidentity__bothX_timesX2X_dedup_valueMapXname_clusterX();
+ public abstract Traversal<Vertex, Map<String, List<Object>>> get_g_V_hasXname_rippleX_inXcreatedX_peerPressure_withXedges_outEX_withXpropertyName_clusterX_repeatXunionXidentity__bothX_timesX2X_dedup_valueMapXname_clusterX();
+
@Test
@LoadGraphWith(MODERN)
public void g_V_peerPressure() {
@@ -100,7 +103,28 @@
assertTrue(ids.contains(convertToVertexId("peter")));
}
-
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_hasXname_rippleX_inXcreatedX_peerPressure_withXEDGES_outEX_withXPROPERTY_NAME_clusterX_repeatXunionXidentity__bothX_timesX2X_dedup_valueMapXname_clusterX() {
+ TestHelper.assumeNonDeterministic();
+ final Traversal<Vertex, Map<String, List<Object>>> traversal = get_g_V_hasXname_rippleX_inXcreatedX_peerPressure_withXedges_outEX_withXpropertyName_clusterX_repeatXunionXidentity__bothX_timesX2X_dedup_valueMapXname_clusterX();
+ printTraversalForm(traversal);
+ final List<Map<String, List<Object>>> results = traversal.toList();
+ assertEquals(6, results.size());
+ final Map<String, Object> clusters = new HashMap<>();
+ results.forEach(m -> clusters.put((String) m.get("name").get(0), m.get("cluster").get(0)));
+ assertEquals(2, results.get(0).size());
+ assertEquals(6, clusters.size());
+ assertEquals(clusters.get("josh"), clusters.get("ripple"));
+ assertEquals(clusters.get("josh"), clusters.get("lop"));
+ final Set<Object> ids = new HashSet<>(clusters.values());
+ assertEquals(4, ids.size());
+ assertTrue(ids.contains(convertToVertexId("marko")));
+ assertTrue(ids.contains(convertToVertexId("vadas")));
+ assertTrue(ids.contains(convertToVertexId("josh")));
+ assertTrue(ids.contains(convertToVertexId("peter")));
+ }
+
public static class Traversals extends PeerPressureTest {
@Override
@@ -117,5 +141,10 @@
public Traversal<Vertex, Map<String, List<Object>>> get_g_V_hasXname_rippleX_inXcreatedX_peerPressure_byXoutEX_byXclusterX_repeatXunionXidentity__bothX_timesX2X_dedup_valueMapXname_clusterX() {
return g.V().has("name", "ripple").in("created").peerPressure().by(__.outE()).by("cluster").repeat(__.union(__.identity(), __.both())).times(2).dedup().valueMap("name", "cluster");
}
+
+ @Override
+ public Traversal<Vertex, Map<String, List<Object>>> get_g_V_hasXname_rippleX_inXcreatedX_peerPressure_withXedges_outEX_withXpropertyName_clusterX_repeatXunionXidentity__bothX_timesX2X_dedup_valueMapXname_clusterX() {
+ return g.V().has("name", "ripple").in("created").peerPressure().with(PeerPressure.edges,__.outE()).with(PeerPressure.propertyName, "cluster").repeat(__.union(__.identity(), __.both())).times(2).dedup().valueMap("name", "cluster");
+ }
}
}
\ No newline at end of file
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java
index cb87be8..0f5afbd 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java
@@ -83,6 +83,8 @@
public abstract Traversal<Vertex, Vertex> get_g_V_chooseXoutE_count_isX0X__asXaX__asXbXX_chooseXselectXaX__selectXaX__selectXbXX();
+ public abstract Traversal<Vertex, String> get_g_VX1X_groupXaX_byXconstantXaXX_byXnameX_selectXaX_selectXaX(final Object v1Id);
+
public abstract Traversal<Vertex, Long> get_g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX();
public abstract Traversal<Vertex, Double> get_g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX_byXmathX_plus_XX();
@@ -375,6 +377,16 @@
@Test
@LoadGraphWith(MODERN)
+ public void g_VX1X_groupXaX_byXconstantXaXX_byXnameX_selectXaX_selectXaX() {
+ final Traversal<Vertex, String> traversal = get_g_VX1X_groupXaX_byXconstantXaXX_byXnameX_selectXaX_selectXaX(convertToVertexId("marko"));
+ printTraversalForm(traversal);
+ assertTrue(traversal.hasNext());
+ assertEquals("marko", traversal.next());
+ assertFalse(traversal.hasNext());
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
public void g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX() {
final Traversal<Vertex, Long> traversal = get_g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX();
printTraversalForm(traversal);
@@ -801,7 +813,6 @@
}
assertFalse(traversal.hasNext());
}
-
@Test
@LoadGraphWith(MODERN)
public void g_VX1X_asXaX_repeatXout_asXaXX_timesX2X_selectXfirst_aX() {
@@ -878,6 +889,13 @@
}
@Override
+ public Traversal<Vertex, String> get_g_VX1X_groupXaX_byXconstantXaXX_byXnameX_selectXaX_selectXaX(final Object v1Id) {
+ return g.V(v1Id).group("a").by(__.constant("a")).by(__.values("name"))
+ .barrier() // TODO: this barrier() should not be necessary
+ .select("a").select("a");
+ }
+
+ @Override
public Traversal<Vertex, Long> get_g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX() {
return g.V().as("a").group("m").by().by(__.bothE().count()).barrier().select("m").select(__.select("a"));
}
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumTest.java
index 1183863..f8bfbcb 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SumTest.java
@@ -21,6 +21,7 @@
import org.apache.tinkerpop.gremlin.LoadGraphWith;
import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
+import org.apache.tinkerpop.gremlin.process.traversal.Scope;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.Test;
@@ -39,17 +40,49 @@
@RunWith(GremlinProcessRunner.class)
public abstract class SumTest extends AbstractGremlinProcessTest {
- public abstract Traversal<Vertex, Double> get_g_V_valuesXageX_sum();
+ public abstract Traversal<Vertex, Number> get_g_V_age_sum();
+
+ public abstract Traversal<Vertex, Number> get_g_V_age_fold_sumXlocalX();
+
+ public abstract Traversal<Vertex, Number> get_g_V_foo_sum();
+
+ public abstract Traversal<Vertex, Number> get_g_V_foo_fold_sumXlocalX();
public abstract Traversal<Vertex, Map<String, Number>> get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_sumX();
@Test
@LoadGraphWith(MODERN)
- public void g_V_valuesXageX_sum() {
- final Traversal<Vertex, Double> traversal = get_g_V_valuesXageX_sum();
+ public void g_V_age_sum() {
+ final Traversal<Vertex, Number> traversal = get_g_V_age_sum();
printTraversalForm(traversal);
final Number sum = traversal.next();
- assertEquals(123L, sum);
+ assertEquals(123, sum.intValue());
+ assertFalse(traversal.hasNext());
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_age_fold_sumXlocalX() {
+ final Traversal<Vertex, Number> traversal = get_g_V_age_fold_sumXlocalX();
+ printTraversalForm(traversal);
+ final Number sum = traversal.next();
+ assertEquals(123, sum.intValue());
+ assertFalse(traversal.hasNext());
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_foo_sum() {
+ final Traversal<Vertex, Number> traversal = get_g_V_foo_sum();
+ printTraversalForm(traversal);
+ assertFalse(traversal.hasNext());
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_foo_fold_sumXlocalX() {
+ final Traversal<Vertex, Number> traversal = get_g_V_foo_fold_sumXlocalX();
+ printTraversalForm(traversal);
assertFalse(traversal.hasNext());
}
@@ -69,13 +102,28 @@
public static class Traversals extends SumTest {
@Override
- public Traversal<Vertex, Double> get_g_V_valuesXageX_sum() {
+ public Traversal<Vertex, Number> get_g_V_age_sum() {
return g.V().values("age").sum();
}
@Override
+ public Traversal<Vertex, Number> get_g_V_age_fold_sumXlocalX() {
+ return g.V().values("age").fold().sum(Scope.local);
+ }
+
+ @Override
+ public Traversal<Vertex, Number> get_g_V_foo_sum() {
+ return g.V().values("foo").sum();
+ }
+
+ @Override
+ public Traversal<Vertex, Number> get_g_V_foo_fold_sumXlocalX() {
+ return g.V().values("foo").fold().sum(Scope.local);
+ }
+
+ @Override
public Traversal<Vertex, Map<String, Number>> get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_sumX() {
return g.V().hasLabel("software").<String, Number>group().by("name").by(bothE().values("weight").sum());
}
}
-}
\ No newline at end of file
+}
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupTest.java
index 3e1e53b..6a58aa7 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupTest.java
@@ -218,8 +218,7 @@
assertTrue(traversal.hasNext());
final Map<String, Number> map = traversal.next();
assertFalse(traversal.hasNext());
- assertEquals(2, map.size());
- assertEquals(0, map.get("software"));
+ assertEquals(1, map.size());
assertEquals(3.5d, (double) map.get("person"), 0.01d);
checkSideEffects(traversal.asAdmin().getSideEffects(), "a", HashMap.class);
}
@@ -424,16 +423,12 @@
assertEquals(179350, subMap.get("followedBy").intValue());
//
subMap = map.get("original");
- assertEquals(3, subMap.size());
+ assertEquals(1, subMap.size());
assertEquals(2185613, subMap.get("followedBy").intValue());
- assertEquals(0, subMap.get("writtenBy").intValue());
- assertEquals(0, subMap.get("sungBy").intValue());
//
subMap = map.get("cover");
- assertEquals(3, subMap.size());
+ assertEquals(1, subMap.size());
assertEquals(777982, subMap.get("followedBy").intValue());
- assertEquals(0, subMap.get("writtenBy").intValue());
- assertEquals(0, subMap.get("sungBy").intValue());
}
@Test
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java
index e7a392c..0992eae 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java
@@ -31,8 +31,9 @@
import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
+import org.apache.tinkerpop.gremlin.structure.util.keyed.KeyedProperty;
+import org.apache.tinkerpop.gremlin.structure.util.keyed.KeyedVertexProperty;
import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdge;
-import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceFactory;
import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex;
import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertexProperty;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
@@ -634,7 +635,7 @@
assertThat(element, instanceOf(DetachedVertexProperty.class));
assertEquals(label, element.label());
assertEquals(value, element.value());
- assertEquals(null, oldValue.value());
+ assertThat(oldValue, instanceOf(KeyedProperty.class));
assertEquals("new", oldValue.key());
assertEquals("yay!", setValue);
triggered.set(true);
@@ -752,7 +753,7 @@
assertEquals(label, element.label());
assertEquals(inId, element.inVertex().id());
assertEquals(outId, element.outVertex().id());
- assertEquals(null, oldValue.value());
+ assertThat(oldValue, instanceOf(KeyedProperty.class));
assertEquals("new", oldValue.key());
assertEquals("yay!", setValue);
triggered.set(true);
@@ -928,44 +929,8 @@
assertThat(element, instanceOf(DetachedVertex.class));
assertEquals(label, element.label());
assertEquals(id, element.id());
+ assertThat(oldValue, instanceOf(KeyedVertexProperty.class));
assertEquals("new", oldValue.key());
- assertEquals(null, oldValue.value());
- assertEquals("dah", setValue);
- triggered.set(true);
- }
- };
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener);
-
- if (graph.features().graph().supportsTransactions())
- builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
-
- final EventStrategy eventStrategy = builder.create();
- final GraphTraversalSource gts = create(eventStrategy);
-
- gts.V(v).property(VertexProperty.Cardinality.single, "new", "dah").iterate();
- tryCommit(graph);
-
- assertEquals(2, IteratorUtils.count(g.V(v).properties()));
- assertThat(triggered.get(), is(true));
- }
-
- @Test
- @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
- public void shouldDetachVertexPropertyWhenNewDeprecated() {
- final AtomicBoolean triggered = new AtomicBoolean(false);
- final Vertex v = graph.addVertex();
- final String label = v.label();
- final Object id = v.id();
- v.property("old","blah");
-
- final MutationListener listener = new AbstractMutationListener() {
- @Override
- public void vertexPropertyChanged(final Vertex element, final Property oldValue, final Object setValue, final Object... vertexPropertyKeyValues) {
- assertThat(element, instanceOf(DetachedVertex.class));
- assertEquals(label, element.label());
- assertEquals(id, element.id());
- assertEquals("new", oldValue.key());
- assertEquals(null, oldValue.value());
assertEquals("dah", setValue);
triggered.set(true);
}
@@ -1069,7 +1034,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1109,7 +1074,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1142,13 +1107,13 @@
assertThat(element, instanceOf(ReferenceVertexProperty.class));
assertEquals(label, element.label());
assertEquals(value, element.value());
- assertEquals(null, oldValue.value());
+ assertThat(oldValue, instanceOf(KeyedProperty.class));
assertEquals("new", oldValue.key());
assertEquals("yay!", setValue);
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1187,7 +1152,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1227,7 +1192,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1260,13 +1225,13 @@
assertEquals(label, element.label());
assertEquals(inId, element.inVertex().id());
assertEquals(outId, element.outVertex().id());
- assertEquals(null, oldValue.value());
+ assertThat(oldValue, instanceOf(KeyedProperty.class));
assertEquals("new", oldValue.key());
assertEquals("yay!", setValue);
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1302,7 +1267,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1335,7 +1300,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1369,7 +1334,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1408,7 +1373,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1425,7 +1390,7 @@
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
- public void shouldRefereceVertexPropertyWhenNew() {
+ public void shouldReferenceVertexPropertyWhenNew() {
final AtomicBoolean triggered = new AtomicBoolean(false);
final Vertex v = graph.addVertex();
final String label = v.label();
@@ -1438,49 +1403,13 @@
assertThat(element, instanceOf(ReferenceVertex.class));
assertEquals(label, element.label());
assertEquals(id, element.id());
+ assertThat(oldValue, instanceOf(KeyedVertexProperty.class));
assertEquals("new", oldValue.key());
- assertEquals(null, oldValue.value());
assertEquals("dah", setValue);
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
-
- if (graph.features().graph().supportsTransactions())
- builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
-
- final EventStrategy eventStrategy = builder.create();
- final GraphTraversalSource gts = create(eventStrategy);
-
- gts.V(v).property(VertexProperty.Cardinality.single, "new", "dah").iterate();
- tryCommit(graph);
-
- assertEquals(2, IteratorUtils.count(g.V(v).properties()));
- assertThat(triggered.get(), is(true));
- }
-
- @Test
- @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
- public void shouldReferenceVertexPropertyWhenNewDeprecated() {
- final AtomicBoolean triggered = new AtomicBoolean(false);
- final Vertex v = graph.addVertex();
- final String label = v.label();
- final Object id = v.id();
- v.property("old","blah");
-
- final MutationListener listener = new AbstractMutationListener() {
- @Override
- public void vertexPropertyChanged(final Vertex element, final Property oldValue, final Object setValue, final Object... vertexPropertyKeyValues) {
- assertThat(element, instanceOf(ReferenceVertex.class));
- assertEquals(label, element.label());
- assertEquals(id, element.id());
- assertEquals("new", oldValue.key());
- assertEquals(null, oldValue.value());
- assertEquals("dah", setValue);
- triggered.set(true);
- }
- };
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1512,7 +1441,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1541,7 +1470,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1578,7 +1507,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1618,7 +1547,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1651,13 +1580,13 @@
assertEquals(vp, element);
assertEquals(label, element.label());
assertEquals(value, element.value());
- assertEquals(null, oldValue.value());
+ assertThat(oldValue, instanceOf(KeyedProperty.class));
assertEquals("new", oldValue.key());
assertEquals("yay!", setValue);
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1696,7 +1625,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1736,7 +1665,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1769,13 +1698,13 @@
assertEquals(label, element.label());
assertEquals(inId, element.inVertex().id());
assertEquals(outId, element.outVertex().id());
- assertEquals(null, oldValue.value());
+ assertThat(oldValue, instanceOf(KeyedProperty.class));
assertEquals("new", oldValue.key());
assertEquals("yay!", setValue);
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1811,7 +1740,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1845,7 +1774,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1880,7 +1809,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1917,7 +1846,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -1947,49 +1876,13 @@
assertEquals(v, element);
assertEquals(label, element.label());
assertEquals(id, element.id());
+ assertThat(oldValue, instanceOf(KeyedVertexProperty.class));
assertEquals("new", oldValue.key());
- assertEquals(null, oldValue.value());
assertEquals("dah", setValue);
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
-
- if (graph.features().graph().supportsTransactions())
- builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
-
- final EventStrategy eventStrategy = builder.create();
- final GraphTraversalSource gts = create(eventStrategy);
-
- gts.V(v).property(VertexProperty.Cardinality.single, "new", "dah").iterate();
- tryCommit(graph);
-
- assertEquals(2, IteratorUtils.count(g.V(v).properties()));
- assertThat(triggered.get(), is(true));
- }
-
- @Test
- @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
- public void shouldUseActualVertexPropertyWhenNewDeprecated() {
- final AtomicBoolean triggered = new AtomicBoolean(false);
- final Vertex v = graph.addVertex();
- final String label = v.label();
- final Object id = v.id();
- v.property("old","blah");
-
- final MutationListener listener = new AbstractMutationListener() {
- @Override
- public void vertexPropertyChanged(final Vertex element, final Property oldValue, final Object setValue, final Object... vertexPropertyKeyValues) {
- assertEquals(v, element);
- assertEquals(label, element.label());
- assertEquals(id, element.id());
- assertEquals("new", oldValue.key());
- assertEquals(null, oldValue.value());
- assertEquals("dah", setValue);
- triggered.set(true);
- }
- };
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -2021,7 +1914,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -2051,7 +1944,7 @@
triggered.set(true);
}
};
- final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(ReferenceFactory.class);
+ final EventStrategy.Builder builder = EventStrategy.build().addListener(listener).detach(EventStrategy.Detachment.REFERENCE);
if (graph.features().graph().supportsTransactions())
builder.eventQueue(new EventStrategy.TransactionalEventQueue(graph));
@@ -2083,7 +1976,7 @@
}
@Override
- public void vertexPropertyChanged(final Vertex element, final Property oldValue, final Object setValue, final Object... vertexPropertyKeyValues) {
+ public void vertexPropertyChanged(final Vertex element, final VertexProperty oldValue, final Object setValue, final Object... vertexPropertyKeyValues) {
}
@@ -2211,11 +2104,6 @@
}
@Override
- public void vertexPropertyChanged(final Vertex element, final Property oldValue, final Object setValue, final Object... vertexPropertyKeyValues) {
- // do nothing - deprecated
- }
-
- @Override
public void vertexPropertyChanged(final Vertex element, final VertexProperty oldValue, final Object setValue, final Object... vertexPropertyKeyValues) {
vertexPropertyChangedEvent.incrementAndGet();
order.add("v-property-changed-" + element.id());
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
index a667e6f..d8f0817 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
@@ -49,7 +49,12 @@
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
/**
* @author Stephen Mallette (http://stephen.genoprime.com)
@@ -118,11 +123,12 @@
@Test
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_UPSERT, supported = false)
public void shouldHaveExceptionConsistencyWhenAssigningSameIdOnVertex() {
final Object o = graphProvider.convertId("1", Vertex.class);
- graph.addVertex(T.id, o);
+ graph.addVertex(T.id, o, "name", "marko");
try {
- graph.addVertex(T.id, o);
+ graph.addVertex(T.id, o, "name", "stephen");
fail("Assigning the same ID to an Element should throw an exception");
} catch (Exception ex) {
assertThat(ex, instanceOf(Graph.Exceptions.vertexWithIdAlreadyExists(0).getClass()));
@@ -132,6 +138,29 @@
@Test
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_UPSERT)
+ public void shouldUpsertWhenAssigningSameIdOnVertex() {
+ final Object o = graphProvider.convertId("1", Vertex.class);
+ graph.addVertex(T.id, o, "name", "marko");
+ tryCommit(graph, graph -> {
+ final Vertex v = graph.vertices(o).next();
+ assertEquals(o, v.id());
+ assertEquals("marko", v.value("name"));
+ assertVertexEdgeCounts(graph, 1, 0);
+ });
+
+ graph.addVertex(T.id, o, "name", "stephen");
+ tryCommit(graph, graph -> {
+ final Vertex v = graph.vertices(o).next();
+ assertEquals(o, v.id());
+ assertEquals("stephen", v.value("name"));
+ assertVertexEdgeCounts(graph, 1, 0);
+ });
+ }
+
+ @Test
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_NUMERIC_IDS)
public void shouldAddVertexWithUserSuppliedNumericId() {
graph.addVertex(T.id, 1000l);
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
index 8062fd1..6108456 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
@@ -37,9 +37,20 @@
import java.util.Set;
import java.util.UUID;
-import static org.apache.tinkerpop.gremlin.structure.Graph.Features.PropertyFeatures.*;
+import static org.apache.tinkerpop.gremlin.structure.Graph.Features.DataTypeFeatures.FEATURE_BOOLEAN_VALUES;
+import static org.apache.tinkerpop.gremlin.structure.Graph.Features.DataTypeFeatures.FEATURE_DOUBLE_VALUES;
+import static org.apache.tinkerpop.gremlin.structure.Graph.Features.DataTypeFeatures.FEATURE_FLOAT_VALUES;
+import static org.apache.tinkerpop.gremlin.structure.Graph.Features.DataTypeFeatures.FEATURE_INTEGER_VALUES;
+import static org.apache.tinkerpop.gremlin.structure.Graph.Features.DataTypeFeatures.FEATURE_LONG_VALUES;
+import static org.apache.tinkerpop.gremlin.structure.Graph.Features.DataTypeFeatures.FEATURE_STRING_VALUES;
import static org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -56,10 +67,10 @@
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_NUMERIC_IDS)
public void shouldAddEdgeWithUserSuppliedNumericId() {
final Vertex v = graph.addVertex();
- v.addEdge("self", v, T.id, 1000l);
+ v.addEdge("self", v, T.id, 1000L);
tryCommit(graph, graph -> {
- final Edge e = graph.edges(1000l).next();
- assertEquals(1000l, e.id());
+ final Edge e = graph.edges(1000L).next();
+ assertEquals(1000L, e.id());
});
}
@@ -251,18 +262,43 @@
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_USER_SUPPLIED_IDS)
+ @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_UPSERT, supported = false)
public void shouldHaveExceptionConsistencyWhenAssigningSameIdOnEdge() {
final Vertex v = graph.addVertex();
final Object o = graphProvider.convertId("1", Edge.class);
- v.addEdge("self", v, T.id, o);
+ v.addEdge("self", v, T.id, o, "weight", 1);
try {
- v.addEdge("self", v, T.id, o);
+ v.addEdge("self", v, T.id, o, "weight", 1);
fail("Assigning the same ID to an Element should throw an exception");
} catch (Exception ex) {
validateException(Graph.Exceptions.edgeWithIdAlreadyExists(o), ex);
}
+ }
+ @Test
+ @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+ @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_USER_SUPPLIED_IDS)
+ @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_UPSERT)
+ public void shouldUpsertWhenAssigningSameIdOnEdge() {
+ final Vertex v = graph.addVertex();
+ final Object o = graphProvider.convertId("1", Edge.class);
+ v.addEdge("self", v, T.id, o, "weight", 1);
+ tryCommit(graph, graph -> {
+ final Edge e = graph.edges(o).next();
+ assertEquals(o, e.id());
+ assertEquals(1, (int) e.value("weight"));
+ assertVertexEdgeCounts(graph, 1, 1);
+ });
+
+ v.addEdge("self", v, T.id, o, "weight", 2);
+ tryCommit(graph, graph -> {
+ final Edge e = graph.edges(o).next();
+ assertEquals(o, e.id());
+ assertEquals(2, (int) e.value("weight"));
+ assertVertexEdgeCounts(graph, 1, 1);
+ });
}
@Test
@@ -289,8 +325,8 @@
@Test
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
- @FeatureRequirement(featureClass = Graph.Features.VertexPropertyFeatures.class, feature = Graph.Features.VertexPropertyFeatures.FEATURE_STRING_VALUES)
- @FeatureRequirement(featureClass = Graph.Features.VertexPropertyFeatures.class, feature = Graph.Features.VertexPropertyFeatures.FEATURE_INTEGER_VALUES)
+ @FeatureRequirement(featureClass = Graph.Features.VertexPropertyFeatures.class, feature = FEATURE_STRING_VALUES)
+ @FeatureRequirement(featureClass = Graph.Features.VertexPropertyFeatures.class, feature = FEATURE_INTEGER_VALUES)
public void shouldHaveStandardStringRepresentationWithProperties() {
final Vertex v = graph.addVertex("name", "marko", "age", 34);
assertEquals(StringFactory.vertexString(v), v.toString());
@@ -462,9 +498,9 @@
@FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_LONG_VALUES)
public void shouldAutotypeLongProperties() {
final Vertex v = graph.addVertex();
- v.property(VertexProperty.Cardinality.single, "long", 1l);
+ v.property(VertexProperty.Cardinality.single, "long", 1L);
final Long best = v.value("long");
- assertEquals(best, Long.valueOf(1l));
+ assertEquals(best, Long.valueOf(1L));
}
@Test
@@ -516,9 +552,9 @@
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
- @FeatureRequirement(featureClass = Graph.Features.VertexPropertyFeatures.class, feature = Graph.Features.VertexPropertyFeatures.FEATURE_INTEGER_VALUES)
+ @FeatureRequirement(featureClass = Graph.Features.VertexPropertyFeatures.class, feature = FEATURE_INTEGER_VALUES)
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_PROPERTY)
- @FeatureRequirement(featureClass = Graph.Features.EdgePropertyFeatures.class, feature = Graph.Features.EdgePropertyFeatures.FEATURE_INTEGER_VALUES)
+ @FeatureRequirement(featureClass = Graph.Features.EdgePropertyFeatures.class, feature = FEATURE_INTEGER_VALUES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_REMOVE_VERTICES)
public void shouldNotGetConcurrentModificationException() {
for (int i = 0; i < 25; i++) {
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyIoRegistry.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/ToyIoRegistry.java
similarity index 94%
rename from hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyIoRegistry.java
rename to gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/ToyIoRegistry.java
index 26d87a9..339a83d 100644
--- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyIoRegistry.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/ToyIoRegistry.java
@@ -17,12 +17,11 @@
* under the License.
*/
-package org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo;
+package org.apache.tinkerpop.gremlin.structure.io.gryo;
import org.apache.tinkerpop.gremlin.structure.io.AbstractIoRegistry;
import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo;
import org.apache.tinkerpop.gremlin.structure.io.graphson.TinkerPopJacksonModule;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
import java.util.HashMap;
import java.util.Map;
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyPoint.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/ToyPoint.java
similarity index 91%
rename from hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyPoint.java
rename to gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/ToyPoint.java
index d0a5ca3..3bab073 100644
--- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyPoint.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/ToyPoint.java
@@ -17,21 +17,17 @@
* under the License.
*/
-package org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo;
+package org.apache.tinkerpop.gremlin.structure.io.gryo;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.io.graphson.AbstractObjectDeserializer;
-import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.InputShim;
import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShim;
import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.OutputShim;
import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.SerializerShim;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
import org.apache.tinkerpop.shaded.jackson.core.JsonGenerationException;
import org.apache.tinkerpop.shaded.jackson.core.JsonGenerator;
import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider;
import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdScalarSerializer;
-import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.util.Map;
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyTriangle.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/ToyTriangle.java
similarity index 96%
rename from hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyTriangle.java
rename to gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/ToyTriangle.java
index 280cd01..614ae70 100644
--- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyTriangle.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/ToyTriangle.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo;
+package org.apache.tinkerpop.gremlin.structure.io.gryo;
import org.apache.tinkerpop.gremlin.structure.io.graphson.AbstractObjectDeserializer;
import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.InputShim;
@@ -28,7 +28,6 @@
import org.apache.tinkerpop.shaded.jackson.core.JsonGenerator;
import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider;
import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdScalarSerializer;
-import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.util.Map;
diff --git a/gremlin-tools/gremlin-benchmark/pom.xml b/gremlin-tools/gremlin-benchmark/pom.xml
index 43c1127..f3c4c20 100644
--- a/gremlin-tools/gremlin-benchmark/pom.xml
+++ b/gremlin-tools/gremlin-benchmark/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>gremlin-tools</artifactId>
<groupId>org.apache.tinkerpop</groupId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-benchmark</artifactId>
diff --git a/gremlin-tools/gremlin-coverage/pom.xml b/gremlin-tools/gremlin-coverage/pom.xml
index 83b13ab..79cf987 100644
--- a/gremlin-tools/gremlin-coverage/pom.xml
+++ b/gremlin-tools/gremlin-coverage/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>gremlin-tools</artifactId>
<groupId>org.apache.tinkerpop</groupId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-coverage</artifactId>
<name>Apache TinkerPop :: Gremlin Coverage</name>
diff --git a/gremlin-tools/gremlin-io-test/pom.xml b/gremlin-tools/gremlin-io-test/pom.xml
index 8ab35fd..3d42965 100644
--- a/gremlin-tools/gremlin-io-test/pom.xml
+++ b/gremlin-tools/gremlin-io-test/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>gremlin-tools</artifactId>
<groupId>org.apache.tinkerpop</groupId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-io-test</artifactId>
<name>Apache TinkerPop :: Gremlin IO Test</name>
diff --git a/gremlin-tools/pom.xml b/gremlin-tools/pom.xml
index 70c643e..a8050d5 100644
--- a/gremlin-tools/pom.xml
+++ b/gremlin-tools/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>tinkerpop</artifactId>
<groupId>org.apache.tinkerpop</groupId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>gremlin-tools</artifactId>
diff --git a/hadoop-gremlin/conf/hadoop-graphson.properties b/hadoop-gremlin/conf/hadoop-graphson.properties
index c37cf28..c2f660b 100644
--- a/hadoop-gremlin/conf/hadoop-graphson.properties
+++ b/hadoop-gremlin/conf/hadoop-graphson.properties
@@ -33,12 +33,6 @@
spark.serializer=org.apache.spark.serializer.KryoSerializer
spark.kryo.registrator=org.apache.tinkerpop.gremlin.spark.structure.io.gryo.GryoRegistrator
-#####################################
-# GiraphGraphComputer Configuration #
-#####################################
-giraph.minWorkers=2
-giraph.maxWorkers=2
-
diff --git a/hadoop-gremlin/conf/hadoop-grateful-gryo.properties b/hadoop-gremlin/conf/hadoop-grateful-gryo.properties
index 92ed942..f28ce9d 100644
--- a/hadoop-gremlin/conf/hadoop-grateful-gryo.properties
+++ b/hadoop-gremlin/conf/hadoop-grateful-gryo.properties
@@ -30,15 +30,3 @@
spark.serializer=org.apache.spark.serializer.KryoSerializer
spark.kryo.registrator=org.apache.tinkerpop.gremlin.spark.structure.io.gryo.GryoRegistrator
-#####################################
-# GiraphGraphComputer Configuration #
-#####################################
-giraph.minWorkers=1
-giraph.maxWorkers=1
-giraph.useOutOfCoreGraph=true
-giraph.useOutOfCoreMessages=true
-mapred.map.child.java.opts=-Xmx1024m
-mapred.reduce.child.java.opts=-Xmx1024m
-giraph.numInputThreads=4
-giraph.numComputeThreads=4
-giraph.maxMessagesInMemory=100000
diff --git a/hadoop-gremlin/conf/hadoop-gryo.properties b/hadoop-gremlin/conf/hadoop-gryo.properties
index c156a98..31286d8 100644
--- a/hadoop-gremlin/conf/hadoop-gryo.properties
+++ b/hadoop-gremlin/conf/hadoop-gryo.properties
@@ -42,21 +42,5 @@
# spark.eventLog.dir=/tmp/spark-event-logs
# spark.ui.killEnabled=true
-#####################################
-# GiraphGraphComputer Configuration #
-#####################################
-giraph.minWorkers=2
-giraph.maxWorkers=2
-giraph.useOutOfCoreGraph=true
-giraph.useOutOfCoreMessages=true
-mapreduce.map.java.opts=-Xmx1024m
-mapreduce.reduce.java.opts=-Xmx1024m
-giraph.numInputThreads=2
-giraph.numComputeThreads=2
-# giraph.maxPartitionsInMemory=1
-# giraph.userPartitionCount=2
-## MapReduce of GiraphGraphComputer ##
-# mapreduce.job.maps=2
-# mapreduce.job.reduces=1
diff --git a/hadoop-gremlin/conf/hadoop-script.properties b/hadoop-gremlin/conf/hadoop-script.properties
index 88bf6d9..24d847b 100644
--- a/hadoop-gremlin/conf/hadoop-script.properties
+++ b/hadoop-gremlin/conf/hadoop-script.properties
@@ -38,21 +38,5 @@
# spark.eventLog.dir=/tmp/spark-event-logs
# spark.ui.killEnabled=true
-#####################################
-# GiraphGraphComputer Configuration #
-#####################################
-giraph.minWorkers=2
-giraph.maxWorkers=2
-giraph.useOutOfCoreGraph=true
-giraph.useOutOfCoreMessages=true
-mapreduce.map.java.opts=-Xmx1024m
-mapreduce.reduce.java.opts=-Xmx1024m
-giraph.numInputThreads=2
-giraph.numComputeThreads=2
-# giraph.maxPartitionsInMemory=1
-# giraph.userPartitionCount=2
-## MapReduce of GiraphGraphComputer ##
-# mapreduce.job.maps=2
-# mapreduce.job.reduces=1
diff --git a/hadoop-gremlin/pom.xml b/hadoop-gremlin/pom.xml
index 5f530d4..f62b70b 100644
--- a/hadoop-gremlin/pom.xml
+++ b/hadoop-gremlin/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>hadoop-gremlin</artifactId>
<name>Apache TinkerPop :: Hadoop Gremlin</name>
@@ -174,14 +174,6 @@
</manifestEntries>
</archive>
</configuration>
- <executions>
- <execution>
- <id>test-jar-it-up</id>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/Constants.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/Constants.java
index 2fc5a66..53477b8 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/Constants.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/Constants.java
@@ -45,7 +45,6 @@
public static final String GREMLIN_HADOOP_JARS_IN_DISTRIBUTED_CACHE = "gremlin.hadoop.jarsInDistributedCache";
public static final String HIDDEN_G = Graph.Hidden.hide("g");
public static final String GREMLIN_HADOOP_JOB_PREFIX = "HadoopGremlin: ";
- public static final String GREMLIN_HADOOP_GIRAPH_JOB_PREFIX = "HadoopGremlin(Giraph): ";
// public static final String GREMLIN_HADOOP_MAP_REDUCE_JOB_PREFIX = "HadoopGremlin(MapReduce): ";
public static final String GREMLIN_HADOOP_SPARK_JOB_PREFIX = "HadoopGremlin(Spark): ";
public static final String HADOOP_GREMLIN_LIBS = "HADOOP_GREMLIN_LIBS";
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopConfiguration.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopConfiguration.java
index 9e31225..a8125ea 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopConfiguration.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopConfiguration.java
@@ -98,30 +98,6 @@
}
}
- /**
- * @deprecated As of release 3.2.0, replaced by {@link HadoopConfiguration#getGraphReader()}.
- */
- @Deprecated
- public Class<InputFormat<NullWritable, VertexWritable>> getGraphInputFormat() {
- try {
- return (Class) Class.forName(this.getString(Constants.GREMLIN_HADOOP_GRAPH_READER));
- } catch (final ClassNotFoundException e) {
- throw new RuntimeException(e.getMessage(), e);
- }
- }
-
- /**
- * @deprecated As of release 3.2.0, replaced by {@link HadoopConfiguration#getGraphWriter()}.
- */
- @Deprecated
- public Class<OutputFormat<NullWritable, VertexWritable>> getGraphOutputFormat() {
- try {
- return (Class) Class.forName(this.getString(Constants.GREMLIN_HADOOP_GRAPH_WRITER));
- } catch (final ClassNotFoundException e) {
- throw new RuntimeException(e.getMessage(), e);
- }
- }
-
public String getInputLocation() {
return this.getString(Constants.GREMLIN_HADOOP_INPUT_LOCATION);
}
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java
index 72eee73..ea8334b 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java
@@ -69,21 +69,6 @@
reason = "Hadoop-Gremlin is OLAP-oriented and for OLTP operations, linear-scan joins are required. This particular tests takes many minutes to execute.",
computers = {"ALL"})
@Graph.OptOut(
- test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchTest$Traversals",
- method = "g_V_matchXa_knows_b__c_knows_bX",
- reason = "Giraph does a hard kill on failure and stops threads which stops test cases. Exception handling semantics are correct though.",
- computers = {"org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphGraphComputer"})
-@Graph.OptOut(
- test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchTest$Traversals",
- method = "g_V_matchXa_created_b__c_created_bX_selectXa_b_cX_byXnameX",
- reason = "Giraph does a hard kill on failure and stops threads which stops test cases. Exception handling semantics are correct though.",
- computers = {"org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphGraphComputer"})
-@Graph.OptOut(
- test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchTest$Traversals",
- method = "g_V_out_asXcX_matchXb_knows_a__c_created_eX_selectXcX",
- reason = "Giraph does a hard kill on failure and stops threads which stops test cases. Exception handling semantics are correct though.",
- computers = {"org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphGraphComputer"})
-@Graph.OptOut(
test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest$Traversals",
method = "g_V_both_both_count",
reason = "Hadoop-Gremlin is OLAP-oriented and for OLTP operations, linear-scan joins are required. This particular tests takes many minutes to execute.",
@@ -144,7 +129,7 @@
test = "org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionComputerTest",
method = "*",
reason = "This test makes use of a sideEffect to enforce when a thread interruption is triggered and thus isn't applicable to HadoopGraph",
- computers = {"org.apache.tinkerpop.gremlin.spark.process.computer.SparkGraphComputer", "org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphGraphComputer"})
+ computers = {"org.apache.tinkerpop.gremlin.spark.process.computer.SparkGraphComputer"})
@Graph.OptOut(
test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchTest$CountMatchTraversals",
method = "g_V_matchXa_followedBy_count_isXgtX10XX_b__a_0followedBy_count_isXgtX10XX_bX_count",
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java
index 92c361f..647e004 100644
--- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java
+++ b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java
@@ -18,10 +18,8 @@
*/
package org.apache.tinkerpop.gremlin.hadoop;
-import org.apache.commons.configuration.Configuration;
-import org.apache.tinkerpop.gremlin.AbstractGraphProvider;
+import org.apache.tinkerpop.gremlin.AbstractFileGraphProvider;
import org.apache.tinkerpop.gremlin.LoadGraphWith;
-import org.apache.tinkerpop.gremlin.TestHelper;
import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopEdge;
import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopElement;
import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
@@ -33,17 +31,11 @@
import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoOutputFormat;
import org.apache.tinkerpop.gremlin.process.computer.util.ComputerGraph;
import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONResourceAccess;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoResourceAccess;
-import org.apache.tinkerpop.gremlin.structure.io.script.ScriptResourceAccess;
-import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.List;
import java.util.Map;
-import java.util.Random;
import java.util.Set;
/**
@@ -51,13 +43,9 @@
* @author Stephen Mallette (http://stephen.genoprime.com)
* @author Daniel Kuppitz (http://gremlin.guru)
*/
-public class HadoopGraphProvider extends AbstractGraphProvider {
+public class HadoopGraphProvider extends AbstractFileGraphProvider {
- protected static final Random RANDOM = new Random();
- private boolean graphSONInput = false;
-
- public static Map<String, String> PATHS = new HashMap<>();
- public static final Set<Class> IMPLEMENTATION = Collections.unmodifiableSet(new HashSet<Class>() {{
+ private static final Set<Class> IMPLEMENTATION = Collections.unmodifiableSet(new HashSet<Class>() {{
add(HadoopEdge.class);
add(HadoopElement.class);
add(HadoopGraph.class);
@@ -73,47 +61,6 @@
add(ComputerGraph.ComputerProperty.class);
}});
- static {
- try {
- final List<String> kryoResources = Arrays.asList(
- "tinkerpop-modern-v3d0.kryo",
- "grateful-dead-v3d0.kryo",
- "tinkerpop-classic-v3d0.kryo",
- "tinkerpop-crew-v3d0.kryo",
- "tinkerpop-sink-v3d0.kryo");
- for (final String fileName : kryoResources) {
- PATHS.put(fileName, TestHelper.generateTempFileFromResource(GryoResourceAccess.class, fileName, "").getAbsolutePath().replace('\\', '/'));
- }
-
- final List<String> graphsonResources = Arrays.asList(
- "tinkerpop-modern-typed-v2d0.json",
- "tinkerpop-modern-v3d0.json",
- "grateful-dead-typed-v2d0.json",
- "grateful-dead-v3d0.json",
- "tinkerpop-classic-typed-v2d0.json",
- "tinkerpop-classic-v3d0.json",
- "tinkerpop-crew-typed-v2d0.json",
- "tinkerpop-crew-v3d0.json",
- "tinkerpop-sink-v3d0.json");
- for (final String fileName : graphsonResources) {
- PATHS.put(fileName, TestHelper.generateTempFileFromResource(GraphSONResourceAccess.class, fileName, "").getAbsolutePath().replace('\\', '/'));
- }
-
- final List<String> scriptResources = Arrays.asList(
- "tinkerpop-classic.txt",
- "script-input.groovy",
- "script-output.groovy",
- "grateful-dead.txt",
- "script-input-grateful-dead.groovy",
- "script-output-grateful-dead.groovy");
- for (final String fileName : scriptResources) {
- PATHS.put(fileName, TestHelper.generateTempFileFromResource(ScriptResourceAccess.class, fileName, "").getAbsolutePath().replace('\\', '/'));
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
@Override
public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, final LoadGraphWith.GraphData loadGraphWith) {
this.graphSONInput = RANDOM.nextBoolean();
@@ -127,36 +74,12 @@
}
@Override
- public void clear(final Graph graph, final Configuration configuration) throws Exception {
- if (graph != null)
- graph.close();
- }
-
- @Override
public void loadGraphData(final Graph graph, final LoadGraphWith loadGraphWith, final Class testClass, final String testName) {
- if (loadGraphWith != null) this.loadGraphDataViaHadoopConfig(graph, loadGraphWith.value());
+ if (loadGraphWith != null) ((HadoopGraph) graph).configuration().setInputLocation(getInputLocation(graph, loadGraphWith.value()));
}
@Override
public Set<Class> getImplementations() {
return IMPLEMENTATION;
}
-
- public void loadGraphDataViaHadoopConfig(final Graph g, final LoadGraphWith.GraphData graphData) {
- final String type = this.graphSONInput ? "-v3d0.json" : "-v3d0.kryo";
-
- if (graphData.equals(LoadGraphWith.GraphData.GRATEFUL)) {
- ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("grateful-dead" + type));
- } else if (graphData.equals(LoadGraphWith.GraphData.MODERN)) {
- ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("tinkerpop-modern" + type));
- } else if (graphData.equals(LoadGraphWith.GraphData.CLASSIC)) {
- ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("tinkerpop-classic" + type));
- } else if (graphData.equals(LoadGraphWith.GraphData.CREW)) {
- ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("tinkerpop-crew" + type));
- } else if (graphData.equals(LoadGraphWith.GraphData.SINK)) {
- ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("tinkerpop-sink" + type));
- } else {
- throw new RuntimeException("Could not load graph with " + graphData);
- }
- }
}
diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml
index f1b80f7..ad36fef 100644
--- a/neo4j-gremlin/pom.xml
+++ b/neo4j-gremlin/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>neo4j-gremlin</artifactId>
<name>Apache TinkerPop :: Neo4j Gremlin</name>
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
index 9226822..514ef2b 100644
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
@@ -32,6 +32,7 @@
import java.io.File;
import java.util.HashSet;
+import java.util.Optional;
import java.util.Random;
import java.util.Set;
@@ -49,6 +50,26 @@
add(Neo4jVertexProperty.class);
}};
+ protected Graph.Features features = null;
+
+ @Override
+ public Graph openTestGraph(final Configuration config) {
+ final Graph graph = super.openTestGraph(config);
+
+ // we can just use the initial set of features taken from the first graph generated from the provider because
+ // neo4j feature won't ever change. don't think there is any danger of keeping this instance about even if
+ // the original graph instance goes out of scope.
+ if (null == features) {
+ this.features = graph.features();
+ }
+ return graph;
+ }
+
+ @Override
+ public Optional<Graph.Features> getStaticFeatures() {
+ return Optional.ofNullable(features);
+ }
+
@Override
public void clear(final Graph graph, final Configuration configuration) throws Exception {
if (null != graph) {
@@ -56,7 +77,7 @@
graph.close();
}
- if (configuration.containsKey(Neo4jGraph.CONFIG_DIRECTORY)) {
+ if (configuration != null && configuration.containsKey(Neo4jGraph.CONFIG_DIRECTORY)) {
// this is a non-in-sideEffects configuration so blow away the directory
final File graphDirectory = new File(configuration.getString(Neo4jGraph.CONFIG_DIRECTORY));
deleteDirectory(graphDirectory);
diff --git a/pom.xml b/pom.xml
index b669872..13dd988 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
</parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Apache TinkerPop</name>
<description>A Graph Computing Framework</description>
@@ -123,7 +123,6 @@
<module>gremlin-dotnet</module>
<module>hadoop-gremlin</module>
<module>spark-gremlin</module>
- <module>giraph-gremlin</module>
<module>neo4j-gremlin</module>
<module>gremlin-driver</module>
<module>gremlin-console</module>
@@ -644,15 +643,6 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
- <!-- conflicts with giraph-core (which appears to have more consistent dependencies) -->
- <exclusion>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-core-asl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-mapper-asl</artifactId>
- </exclusion>
<!-- conflict with TinkerPop tests -->
<exclusion>
<groupId>junit</groupId>
@@ -1225,7 +1215,7 @@
<overview>${basedir}/docs/javadoc/overview.html</overview>
<quiet>true</quiet>
<sourcepath>
- giraph-gremlin/src/main/java:gremlin-core/src/main/java:gremlin-driver/src/main/java:gremlin-groovy/src/main/java:gremlin-python/src/main/java:gremlin-server/src/main/java:gremlin-test/src/main/java:hadoop-gremlin/src/main/java:neo4j-gremlin/src/main/java:spark-gremlin/src/main/java:tinkergraph-gremlin/src/main/java
+ gremlin-core/src/main/java:gremlin-driver/src/main/java:gremlin-groovy/src/main/java:gremlin-python/src/main/java:gremlin-server/src/main/java:gremlin-test/src/main/java:hadoop-gremlin/src/main/java:neo4j-gremlin/src/main/java:spark-gremlin/src/main/java:tinkergraph-gremlin/src/main/java
</sourcepath>
</configuration>
</execution>
diff --git a/spark-gremlin/pom.xml b/spark-gremlin/pom.xml
index 024712c..ad3bf43 100644
--- a/spark-gremlin/pom.xml
+++ b/spark-gremlin/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>spark-gremlin</artifactId>
<name>Apache TinkerPop :: Spark Gremlin</name>
@@ -307,63 +307,6 @@
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
- <artifactId>hadoop-gremlin</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-server</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-net</groupId>
- <artifactId>commons-net</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.xerial.snappy</groupId>
- <artifactId>snappy-java</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.avro</groupId>
- <artifactId>avro</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-math3</artifactId>
- </exclusion>
- <exclusion>
- <groupId>io.netty</groupId>
- <artifactId>netty</artifactId>
- </exclusion>
- <exclusion>
- <groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.thoughtworks.paranamer</groupId>
- <artifactId>paranamer</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkergraph-gremlin</artifactId>
<version>${project.version}</version>
<scope>test</scope>
diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/interceptor/SparkStarBarrierInterceptor.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/interceptor/SparkStarBarrierInterceptor.java
index 3c74e5a..de42525 100644
--- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/interceptor/SparkStarBarrierInterceptor.java
+++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/interceptor/SparkStarBarrierInterceptor.java
@@ -45,6 +45,7 @@
import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ComputerVerificationStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
+import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException;
import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
import org.apache.tinkerpop.gremlin.spark.process.computer.SparkMemory;
import org.apache.tinkerpop.gremlin.spark.process.computer.traversal.strategy.SparkVertexProgramInterceptor;
@@ -52,6 +53,7 @@
import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
import org.apache.tinkerpop.gremlin.util.NumberHelper;
import org.apache.tinkerpop.gremlin.util.function.ArrayListSupplier;
+import org.apache.tinkerpop.gremlin.util.function.MeanNumberSupplier;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import java.util.ArrayList;
@@ -96,25 +98,25 @@
// USE SPARK DSL FOR THE RESPECTIVE END REDUCING BARRIER STEP OF THE TRAVERSAL
final Object result;
if (endStep instanceof CountGlobalStep)
- result = nextRDD.map(Traverser::bulk).fold(0l, (a, b) -> a + b);
- else if (endStep instanceof SumGlobalStep)
- result = nextRDD
+ result = nextRDD.map(Traverser::bulk).fold(0L, (a, b) -> a + b);
+ else if (endStep instanceof SumGlobalStep) {
+ result = nextRDD.isEmpty() ? null : nextRDD
.map(traverser -> NumberHelper.mul(traverser.bulk(), (Number) traverser.get()))
.fold(0, NumberHelper::add);
- else if (endStep instanceof MeanGlobalStep)
- result = nextRDD
+ } else if (endStep instanceof MeanGlobalStep) {
+ result = nextRDD.isEmpty() ? null : nextRDD
.map(traverser -> new MeanGlobalStep.MeanNumber((Number) traverser.get(), traverser.bulk()))
- .fold(new MeanGlobalStep.MeanNumber(), MeanGlobalStep.MeanNumber::add)
+ .fold(MeanNumberSupplier.instance().get(), MeanGlobalStep.MeanNumber::add)
.getFinal();
- else if (endStep instanceof MinGlobalStep)
- result = nextRDD
- .map(traverser -> (Number) traverser.get())
- .fold(Integer.MAX_VALUE, NumberHelper::min);
- else if (endStep instanceof MaxGlobalStep)
- result = nextRDD
- .map(traverser -> (Number) traverser.get())
- .fold(Integer.MIN_VALUE, NumberHelper::max);
- else if (endStep instanceof FoldStep) {
+ } else if (endStep instanceof MinGlobalStep) {
+ result = nextRDD.isEmpty() ? null : nextRDD
+ .map(traverser -> (Comparable) traverser.get())
+ .fold(Double.NaN, NumberHelper::min);
+ } else if (endStep instanceof MaxGlobalStep) {
+ result = nextRDD.isEmpty() ? null : nextRDD
+ .map(traverser -> (Comparable) traverser.get())
+ .fold(Double.NaN, NumberHelper::max);
+ } else if (endStep instanceof FoldStep) {
final BinaryOperator biOperator = endStep.getBiOperator();
result = nextRDD.map(traverser -> {
if (endStep.getSeedSupplier() instanceof ArrayListSupplier) {
@@ -148,9 +150,11 @@
///////////////////////////////
// generate the HALTED_TRAVERSERS for the memory
- final TraverserSet<Long> haltedTraversers = new TraverserSet<>();
- haltedTraversers.add(traversal.getTraverserGenerator().generate(result, endStep, 1l)); // all reducing barrier steps produce a result of bulk 1
- memory.set(TraversalVertexProgram.HALTED_TRAVERSERS, haltedTraversers);
+ if (result != null) {
+ final TraverserSet<Long> haltedTraversers = new TraverserSet<>();
+ haltedTraversers.add(traversal.getTraverserGenerator().generate(result, endStep, 1l)); // all reducing barrier steps produce a result of bulk 1
+ memory.set(TraversalVertexProgram.HALTED_TRAVERSERS, haltedTraversers);
+ }
memory.incrIteration(); // any local star graph reduction takes a single iteration
return inputRDD;
}
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGremlinSuite.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGremlinSuite.java
similarity index 100%
rename from hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGremlinSuite.java
rename to spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGremlinSuite.java
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractIoRegistryCheck.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractIoRegistryCheck.java
similarity index 97%
rename from hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractIoRegistryCheck.java
rename to spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractIoRegistryCheck.java
index 8b89fc1..a5f657d 100644
--- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractIoRegistryCheck.java
+++ b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractIoRegistryCheck.java
@@ -19,7 +19,6 @@
package org.apache.tinkerpop.gremlin.hadoop.structure.io;
-
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.RecordWriter;
import org.apache.hadoop.mapreduce.TaskAttemptID;
@@ -34,9 +33,9 @@
import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoInputFormat;
import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoOutputFormat;
import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoRecordWriter;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.ToyIoRegistry;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.ToyPoint;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.ToyTriangle;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.ToyIoRegistry;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.ToyPoint;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.ToyTriangle;
import org.apache.tinkerpop.gremlin.hadoop.structure.util.ConfUtil;
import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
import org.apache.tinkerpop.gremlin.structure.T;
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractStorageCheck.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractStorageCheck.java
similarity index 100%
rename from hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractStorageCheck.java
rename to spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractStorageCheck.java
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/FileSystemStorageCheck.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/FileSystemStorageCheck.java
similarity index 100%
rename from hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/FileSystemStorageCheck.java
rename to spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/FileSystemStorageCheck.java
diff --git a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java
index 051d5f0..c778c6d 100644
--- a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java
+++ b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java
@@ -20,14 +20,24 @@
import org.apache.spark.launcher.SparkLauncher;
import org.apache.spark.serializer.KryoSerializer;
+import org.apache.tinkerpop.gremlin.AbstractFileGraphProvider;
import org.apache.tinkerpop.gremlin.GraphProvider;
import org.apache.tinkerpop.gremlin.LoadGraphWith;
import org.apache.tinkerpop.gremlin.hadoop.Constants;
-import org.apache.tinkerpop.gremlin.hadoop.HadoopGraphProvider;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopEdge;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopElement;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopProperty;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopVertex;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopVertexProperty;
import org.apache.tinkerpop.gremlin.hadoop.structure.io.FileSystemStorageCheck;
import org.apache.tinkerpop.gremlin.hadoop.structure.io.HadoopPools;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.graphson.GraphSONInputFormat;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoInputFormat;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoOutputFormat;
import org.apache.tinkerpop.gremlin.process.computer.Computer;
import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
+import org.apache.tinkerpop.gremlin.process.computer.util.ComputerGraph;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.PageRankTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.PeerPressureTest;
@@ -40,18 +50,50 @@
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShimServiceLoader;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
*/
@GraphProvider.Descriptor(computer = SparkGraphComputer.class)
-public class SparkHadoopGraphProvider extends HadoopGraphProvider {
+public class SparkHadoopGraphProvider extends AbstractFileGraphProvider {
- protected static final String PREVIOUS_SPARK_PROVIDER = "previous.spark.provider";
+ static final String PREVIOUS_SPARK_PROVIDER = "previous.spark.provider";
+
+ public static final Set<Class> IMPLEMENTATION = Collections.unmodifiableSet(new HashSet<Class>() {{
+ add(HadoopEdge.class);
+ add(HadoopElement.class);
+ add(HadoopGraph.class);
+ add(HadoopProperty.class);
+ add(HadoopVertex.class);
+ add(HadoopVertexProperty.class);
+ add(ComputerGraph.class);
+ add(ComputerGraph.ComputerElement.class);
+ add(ComputerGraph.ComputerVertex.class);
+ add(ComputerGraph.ComputerEdge.class);
+ add(ComputerGraph.ComputerVertexProperty.class);
+ add(ComputerGraph.ComputerAdjacentVertex.class);
+ add(ComputerGraph.ComputerProperty.class);
+ }});
+
+ @Override
+ public void loadGraphData(final Graph graph, final LoadGraphWith loadGraphWith, final Class testClass, final String testName) {
+ if (loadGraphWith != null) ((HadoopGraph) graph).configuration().setInputLocation(getInputLocation(graph, loadGraphWith.value()));
+ }
+
+ @Override
+ public Set<Class> getImplementations() {
+ return IMPLEMENTATION;
+ }
@Override
public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, final LoadGraphWith.GraphData loadGraphWith) {
+ this.graphSONInput = RANDOM.nextBoolean();
if (this.getClass().equals(SparkHadoopGraphProvider.class) && !SparkHadoopGraphProvider.class.getCanonicalName().equals(System.getProperty(PREVIOUS_SPARK_PROVIDER, null))) {
Spark.close();
HadoopPools.close();
@@ -59,8 +101,15 @@
System.setProperty(PREVIOUS_SPARK_PROVIDER, SparkHadoopGraphProvider.class.getCanonicalName());
}
- final Map<String, Object> config = super.getBaseConfiguration(graphName, test, testMethodName, loadGraphWith);
- config.put(Constants.GREMLIN_SPARK_PERSIST_CONTEXT, true); // this makes the test suite go really fast
+ final Map<String,Object> config = new HashMap<String, Object>() {{
+ put(Graph.GRAPH, HadoopGraph.class.getName());
+ put(Constants.GREMLIN_HADOOP_GRAPH_READER, graphSONInput ? GraphSONInputFormat.class.getCanonicalName() : GryoInputFormat.class.getCanonicalName());
+ put(Constants.GREMLIN_HADOOP_GRAPH_WRITER, GryoOutputFormat.class.getCanonicalName());
+ put(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, getWorkingDirectory());
+ put(Constants.GREMLIN_HADOOP_JARS_IN_DISTRIBUTED_CACHE, false);
+
+ put(Constants.GREMLIN_SPARK_PERSIST_CONTEXT, true); // this makes the test suite go really fast
+ }};
// toy graph inputRDD does not have corresponding outputRDD so where jobs chain, it fails (failing makes sense)
if (null != loadGraphWith &&
diff --git a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/util/SugarTestHelper.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/util/SugarTestHelper.java
index 334c67f..304f05f 100644
--- a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/util/SugarTestHelper.java
+++ b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/util/SugarTestHelper.java
@@ -19,11 +19,11 @@
package org.apache.tinkerpop.gremlin.spark.util;
import org.apache.tinkerpop.gremlin.groovy.util.MetaRegistryUtil;
-import org.apache.tinkerpop.gremlin.hadoop.HadoopGraphProvider;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.*;
+import org.apache.tinkerpop.gremlin.spark.process.computer.SparkHadoopGraphProvider;
import java.util.HashSet;
import java.util.Set;
@@ -49,7 +49,7 @@
*/
public static void clearRegistry() {
final Set<Class> implementationsToClear = new HashSet<>(CORE_IMPLEMENTATIONS);
- implementationsToClear.addAll(HadoopGraphProvider.IMPLEMENTATION);
+ implementationsToClear.addAll(SparkHadoopGraphProvider.IMPLEMENTATION);
MetaRegistryUtil.clearRegistry(implementationsToClear);
}
diff --git a/tinkergraph-gremlin/pom.xml b/tinkergraph-gremlin/pom.xml
index a6c195b..e5c93f0 100644
--- a/tinkergraph-gremlin/pom.xml
+++ b/tinkergraph-gremlin/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<artifactId>tinkergraph-gremlin</artifactId>
<name>Apache TinkerPop :: TinkerGraph Gremlin</name>