[2/2] tinkerpop git commit: TranslationStrategy (a test framework strategy) now verifies that the Bytecode submitted to the translator is equal to the bytecode of the generated/translated traversal. T

2016-11-16 Thread okram
TranslationStrategy (a test framework strategy) now verifies that the Bytecode 
submitted to the translator is equal to the bytecode of the 
generated/translated traversal. This was a nightmare to get everything working. 
We had so many little nick nack bugs. In particular, VertexProperty and 
Property GraphSON serialization needs to have their element() serialized or 
else you can't attach/argument. This is still a problem in Gryo and we will 
need to solve it for 3.3.0. In short, lots of test cases added, lots of tweaks 
to the various translators made, graphson.py updated significantly (though 
backwards compatible), etc. Crazy shiiiet.


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

Branch: refs/heads/TINKERPOP-1520
Commit: 6aa6fc5adc47170e1c049bc47970bcaaf54b5ff2
Parents: 997e94f
Author: Marko A. Rodriguez 
Authored: Wed Nov 16 16:08:19 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 16:08:19 2016 -0700

--
 CHANGELOG.asciidoc  |  6 ++
 .../remote/traversal/step/map/RemoteStep.java   |  8 +-
 .../gremlin/process/traversal/Bytecode.java |  4 +-
 .../finalization/MatchAlgorithmStrategy.java|  6 +-
 .../io/graphson/GraphSONSerializersV2d0.java| 98 +---
 .../structure/io/graphson/GraphSONTokens.java   |  1 +
 .../gremlin/structure/io/gryo/GryoMapper.java   | 49 +-
 .../structure/io/gryo/GryoSerializers.java  | 11 +--
 .../gremlin/process/traversal/BytecodeTest.java |  4 +-
 .../ser/GraphSONMessageSerializerV2d0Test.java  |  2 +-
 .../step/map/GroovyPropertiesTest.groovy|  6 ++
 .../step/sideEffect/GroovySackTest.groovy   |  8 +-
 .../gremlin/groovy/jsr223/GroovyTranslator.java | 18 +++-
 .../python/GraphTraversalSourceGenerator.groovy | 11 ++-
 .../gremlin/python/jsr223/PythonTranslator.java | 31 +--
 .../gremlin_python/process/graph_traversal.py   | 11 ++-
 .../jython/gremlin_python/process/strategies.py |  2 +-
 .../jython/gremlin_python/structure/graph.py| 11 ++-
 .../gremlin_python/structure/io/graphson.py | 65 ++---
 .../driver/test_driver_remote_connection.py |  2 +-
 .../jython/tests/structure/io/test_graphson.py  | 38 ++--
 .../main/jython/tests/structure/test_graph.py   | 12 ++-
 .../gremlin/python/jsr223/PythonProvider.java   |  3 -
 .../RemoteGraphGroovyTranslatorProvider.java| 29 +-
 .../process/traversal/CoreTraversalTest.java| 32 +--
 .../traversal/step/map/PropertiesTest.java  | 16 
 .../traversal/step/sideEffect/SackTest.java |  8 +-
 .../decoration/TranslationStrategy.java | 16 +++-
 .../TinkerGraphGroovyTranslatorProvider.java|  4 -
 .../TinkerGraphJavaTranslatorProvider.java  |  2 -
 .../TinkerGraphGraphSONTranslatorProvider.java  |  6 --
 .../gryo/TinkerGraphGryoTranslatorProvider.java |  8 +-
 32 files changed, 393 insertions(+), 135 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6aa6fc5a/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 0613a39..c1f2a17 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,12 @@ 
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~
 
+* Added support for `VertexProperty.element()` and `Property.element()` in 
GraphSON to enable attachment.
+* Added `Vertex`, `Edge`, `VertexProperty`, and `Property` serializers to 
Gremlin-Python and exposed tests that use graph object arguments.
+* `Bytecode.getSourceInstructions()` and `Bytecode.getStepInstructions()` now 
returns `List` instead of `Iterable`.
+* Added various `TraversalStrategy` registrations with `GryoMapper`.
+* Fixed a naming mistake in Gremlin-Python: `IdentityRemoveStrategy` is now 
called `IdentityRemovalStrategy`.
+* Added `TranslationStrategy` test infrastructure that verifies `Bytecode` 
generated from a translation is equal to the original `Bytecode`.
 * Converted Spark process suite tests to "integration" tests.
 * Fixed a bug in `InlineFilterStrategy` having to do with folding 
`HasContainers` into `VertexStep`.
 * Deprecated `HasContainer.makeHasContainers()` which was used to dissect 
`AndP` and shouldn't be used at the TinkerPop-level.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6aa6fc5a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/step/map/RemoteStep.java

[1/2] tinkerpop git commit: TranslationStrategy (a test framework strategy) now verifies that the Bytecode submitted to the translator is equal to the bytecode of the generated/translated traversal. T

2016-11-16 Thread okram
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1520 [created] 6aa6fc5ad


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6aa6fc5a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/gryo/TinkerGraphGryoTranslatorProvider.java
--
diff --git 
a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/gryo/TinkerGraphGryoTranslatorProvider.java
 
b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/gryo/TinkerGraphGryoTranslatorProvider.java
index 720abf2..91e0385 100644
--- 
a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/gryo/TinkerGraphGryoTranslatorProvider.java
+++ 
b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/gryo/TinkerGraphGryoTranslatorProvider.java
@@ -21,11 +21,12 @@ package 
org.apache.tinkerpop.gremlin.tinkergraph.structure.io.gryo;
 
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator;
-import org.apache.tinkerpop.gremlin.process.traversal.CoreTraversalTest;
 import 
org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionComputerTest;
 import 
org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionTest;
 import 
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest;
+import 
org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategyProcessTest;
+import 
org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategyProcessTest;
 import 
org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategy;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider;
@@ -46,8 +47,9 @@ public class TinkerGraphGryoTranslatorProvider extends 
TinkerGraphProvider {
 //
 ProgramTest.Traversals.class.getCanonicalName(),
 TraversalInterruptionTest.class.getCanonicalName(),
-TraversalInterruptionComputerTest.class.getCanonicalName(),
-CoreTraversalTest.class.getCanonicalName()));
+EventStrategyProcessTest.class.getCanonicalName(),
+ElementIdStrategyProcessTest.class.getCanonicalName(),
+TraversalInterruptionComputerTest.class.getCanonicalName()));
 
 
 @Override



tinkerpop git commit: allow users to pass options to docker

2016-11-16 Thread rdale
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1556 [created] 3441f3f5e


allow users to pass options to docker


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

Branch: refs/heads/TINKERPOP-1556
Commit: 3441f3f5e8a70efad4345f8305bed04d980c20a0
Parents: 418fb2a
Author: Robert Dale 
Authored: Wed Nov 16 17:57:38 2016 -0500
Committer: Robert Dale 
Committed: Wed Nov 16 17:57:38 2016 -0500

--
 CHANGELOG.asciidoc | 6 ++
 docker/build.sh| 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3441f3f5/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 14ee66d..10e4121 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -31,6 +31,12 @@ TinkerPop 3.1.6 (Release Date: NOT OFFICIALLY RELEASED YET)
 * Fully shutdown metrics services in Gremlin Server on shutdown.
 * Deprecated `tryRandomCommit()` in `AbstractGremlinTest` - the annotation was 
never added in 3.1.1, and was only deprecated via javadoc.
 * Minor fixes to various test feature requirements in `gremlin-test`.
+* Allow developers to pass options to `docker run` with DOCKER_OPTS 
environment variable
+
+Improvements
+
+
+* TINKERPOP-1556 Allow Hadoop to run on IPv6 systems
 
 [[release-3-1-5]]
 TinkerPop 3.1.5 (Release Date: October 17, 2016)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3441f3f5/docker/build.sh
--
diff --git a/docker/build.sh b/docker/build.sh
index c37a6f5..c314e5e 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -47,6 +47,6 @@ CMD ["sh", "-c", "docker/scripts/build.sh $@"]
 EOF
 
 docker build -t tinkerpop:${BUILD_TAG} .
-docker run --rm -ti tinkerpop:${BUILD_TAG}
+docker run ${DOCKER_OPTS} --rm -ti tinkerpop:${BUILD_TAG}
 
 popd > /dev/null



svn commit: r1769990 - /tinkerpop/site/index.html

2016-11-16 Thread twilmes
Author: twilmes
Date: Wed Nov 16 14:26:11 2016
New Revision: 1769990

URL: http://svn.apache.org/viewvc?rev=1769990=rev
Log:
Deploy TinkerPop homepage

Modified:
tinkerpop/site/index.html

Modified: tinkerpop/site/index.html
URL: 
http://svn.apache.org/viewvc/tinkerpop/site/index.html?rev=1769990=1769989=1769990=diff
==
--- tinkerpop/site/index.html (original)
+++ tinkerpop/site/index.html Wed Nov 16 14:26:11 2016
@@ -359,6 +359,7 @@ limitations under the License.
 http://www.datastax.com/products/datastax-enterprise-graph;>DSEGraph 
- DataStax graph database with OLTP and OLAP support.
 http://tinkerpop.apache.org/docs/current/reference/#giraphgraphcomputer;>Hadoop
 (Giraph) - OLAP graph processor using Giraph.
 http://tinkerpop.apache.org/docs/current/reference/#sparkgraphcomputer;>Hadoop
 (Spark) - OLAP graph processor using Spark.
+   https://github.com/rayokota/hgraphdb;>HGraphDB - 
OLTP graph database running on Apache HBase.
 https://console.ng.bluemix.net/catalog/services/ibm-graph/;>IBM Graph 
- OLTP graph database as a service.
 http://tinkerpop.apache.org/docs/currentg/#neo4j-gremlin;>Neo4j - 
OLTP graph database (embedded).
 https://github.com/SteelBridgeLabs/neo4j-gremlin-bolt;>neo4j-gremlin-bolt
 - OLTP graph database (using Bolt Protocol).




tinkerpop git commit: Added HGraphDB to graph systems listing.

2016-11-16 Thread twilmes
Repository: tinkerpop
Updated Branches:
  refs/heads/master e1f82c422 -> 4334087cd


Added HGraphDB to graph systems listing.


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

Branch: refs/heads/master
Commit: 4334087cde7b0e5a799f54da697fbe21982d05c6
Parents: e1f82c4
Author: Ted Wilmes 
Authored: Wed Nov 16 08:10:31 2016 -0600
Committer: Ted Wilmes 
Committed: Wed Nov 16 08:10:31 2016 -0600

--
 docs/site/home/index.html | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4334087c/docs/site/home/index.html
--
diff --git a/docs/site/home/index.html b/docs/site/home/index.html
index 46cc68e..2a54d2c 100644
--- a/docs/site/home/index.html
+++ b/docs/site/home/index.html
@@ -220,6 +220,7 @@ limitations under the License.
 http://www.datastax.com/products/datastax-enterprise-graph;>DSEGraph 
- DataStax graph database with OLTP and OLAP support.
 http://tinkerpop.apache.org/docs/current/reference/#giraphgraphcomputer;>Hadoop
 (Giraph) - OLAP graph processor using Giraph.
 http://tinkerpop.apache.org/docs/current/reference/#sparkgraphcomputer;>Hadoop
 (Spark) - OLAP graph processor using Spark.
+   https://github.com/rayokota/hgraphdb;>HGraphDB - 
OLTP graph database running on Apache HBase.
 https://console.ng.bluemix.net/catalog/services/ibm-graph/;>IBM Graph 
- OLTP graph database as a service.
 http://tinkerpop.apache.org/docs/currentg/#neo4j-gremlin;>Neo4j - 
OLTP graph database (embedded).
 https://github.com/SteelBridgeLabs/neo4j-gremlin-bolt;>neo4j-gremlin-bolt
 - OLTP graph database (using Bolt Protocol).



[02/11] tinkerpop git commit: found a bug in HasContainer.makeHasContainers() around AndP recurssion. No biggie, just didn't yield ultimate optimization. Found a bug in InlineFilterStrategy where hasL

2016-11-16 Thread okram
found a bug in HasContainer.makeHasContainers() around AndP recurssion. No 
biggie, just didn't yield ultimate optimization. Found a bug in 
InlineFilterStrategy where hasLabel() should only back propagate into 
VertexStep[edges] if the step doesn't already have edge labels. Removed 
HasContainer.makeHasContainers() -- another ticket I'm putting into this 
branch. GraphTraversal.has() is fixed up accordingly with left-fold 
HasContainers and valid Object[] usage. Going to add a few more tests around 
hasXXX() steps.


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

Branch: refs/heads/master
Commit: 4a316c55c3ab1e42ef6568689cadbca0e2fb9ed8
Parents: ffe1b4c
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 08:27:24 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:43:45 2016 -0700

--
 .../upgrade/release-3.2.x-incubating.asciidoc   | 22 +++
 .../traversal/dsl/graph/GraphTraversal.java | 29 
 .../traversal/step/util/HasContainer.java   | 26 ++
 .../optimization/InlineFilterStrategy.java  | 20 +-
 .../optimization/FilterRankingStrategyTest.java | 18 ++--
 .../optimization/InlineFilterStrategyTest.java  | 11 +---
 .../step/sideEffect/Neo4jGraphStep.java | 11 ++--
 .../Neo4jGraphStepStrategyTest.java |  6 ++--
 .../step/sideEffect/TinkerGraphStep.java|  9 +-
 .../TinkerGraphStepStrategyTest.java|  4 +--
 10 files changed, 111 insertions(+), 45 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4a316c55/docs/src/upgrade/release-3.2.x-incubating.asciidoc
--
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc 
b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 8574b88..0fd7498 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -61,6 +61,28 @@ Upgrading for Providers
 Graph Database Providers
 
 
+HasContainer AndP Splitting

+
+Previously, `GraphTraversal` made it easy for providers to analyze 
`P`-predicates in `HasContainers`, but always
+splitting `AndP` predicates into their component parts. This helper behavior 
is no longer provided because,
+1.) `AndP` can be inserted into a `XXXStep` in other ways, 2.) the providers 
`XXXStep` should process `AndP`
+regardless of `GraphTraversal` helper, and 3.) the `GraphTraversal` helper did 
not recursively split.
+A simple way to split `AndP` in any custom `XXXStep` that implements 
`HasContainerHolder` is to use the following method:
+
+[source,java]
+
+@Override
+public void addHasContainer(final HasContainer hasContainer) {
+  if (hasContainer.getPredicate() instanceof AndP) {
+for (final P predicate : ((AndP) 
hasContainer.getPredicate()).getPredicates()) {
+  this.addHasContainer(new HasContainer(hasContainer.getKey(), predicate));
+}
+  } else
+this.hasContainers.add(hasContainer);
+}
+
+
 Duplicate Multi-Properties
 ++
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4a316c55/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
--
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 d8f7888..fae2d67 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
@@ -148,7 +148,6 @@ import 
org.apache.tinkerpop.gremlin.util.function.ConstantSupplier;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
@@ -926,8 +925,14 @@ public interface GraphTraversal extends Traversal {
 }
 
 public default GraphTraversal has(final T accessor, final Object 
value) {
-this.asAdmin().getBytecode().addStep(Symbols.has, accessor, value);
-return TraversalHelper.addHasContainer(this.asAdmin(), new 
HasContainer(accessor.getAccessor(), value instanceof P ? (P) value : 
P.eq(value)));
+if (value instanceof 

[03/11] tinkerpop git commit: fixed up the hasXXX() methods to account of P and Object differently. Will go through and create a TraversalHelper.addHasContainer() method which will left append or righ

2016-11-16 Thread okram
fixed up the hasXXX() methods to account of P and Object differently. Will go 
through and create a TraversalHelper.addHasContainer() method which will left 
append or right append depending on Traversal state. this will simplify methods 
signficiantly.


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

Branch: refs/heads/master
Commit: 05bfb029c20fd21cba468b4bf25cbab322526807
Parents: 8c1391c
Author: Marko A. Rodriguez 
Authored: Mon Nov 14 13:46:00 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:43:45 2016 -0700

--
 .../traversal/dsl/graph/GraphTraversal.java | 114 +++
 .../gremlin/process/traversal/dsl/graph/__.java |  43 +--
 .../traversal/step/filter/HasStepTest.java  |  12 +-
 3 files changed, 128 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/05bfb029/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
--
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 e875513..7543c32 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
@@ -147,8 +147,10 @@ import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.util.function.ConstantSupplier;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
@@ -994,38 +996,106 @@ public interface GraphTraversal extends 
Traversal {
 return this.asAdmin().addStep(new NotStep<>(this.asAdmin(), 
__.values(propertyKey)));
 }
 
-public default GraphTraversal has(final T accessor, final Object 
value, final Object... values) {
-if (value instanceof Object[]) {
-final Object[] arr = (Object[]) value;
-if (values.length == 0) {
-if (arr.length == 1) {
-return has(accessor, P.eq(arr[0]));
+public default GraphTraversal hasLabel(final String label, final 
String... otherLabels) {
+final String[] labels = new String[otherLabels.length + 1];
+labels[0] = label;
+System.arraycopy(otherLabels, 0, labels, 1, otherLabels.length);
+this.asAdmin().getBytecode().addStep(Symbols.hasLabel, labels);
+if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
+((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new 
HasContainer(T.label.getAccessor(), labels.length == 1 ? P.eq(labels[0]) : 
P.within(labels)));
+return this;
+} else
+return this.asAdmin().addStep(new HasStep(this.asAdmin(), new 
HasContainer(T.label.getAccessor(), labels.length == 1 ? P.eq(labels[0]) : 
P.within(labels;
+}
+
+public default GraphTraversal hasLabel(final P predicate) {
+this.asAdmin().getBytecode().addStep(Symbols.hasLabel, predicate);
+if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
+((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new 
HasContainer(T.label.getAccessor(), predicate));
+return this;
+} else
+return this.asAdmin().addStep(new HasStep(this.asAdmin(), new 
HasContainer(T.label.getAccessor(), predicate)));
+}
+
+public default GraphTraversal hasId(final Object id, final Object... 
otherIds) {
+if (id instanceof P)
+return this.hasId((P) id);
+else {
+final List ids = new ArrayList<>();
+if (id.getClass().isArray()) {
+for (final Object i : (Object[]) id) {
+ids.add(i);
 }
-return has(accessor, P.within(arr));
-}
-} else if (values.length == 0) {
-return has(accessor, value instanceof P ? (P) value : P.eq(value));
+} else
+ids.add(id);
+Collections.addAll(ids, otherIds);
+this.asAdmin().getBytecode().addStep(Symbols.hasId, ids.toArray());
+if 

[10/11] tinkerpop git commit: updated upgrade with links to the respective tickets.

2016-11-16 Thread okram
updated upgrade with links to the respective tickets.


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

Branch: refs/heads/master
Commit: 9323011a3abd08330c462a02a0aa4fdfff3ed602
Parents: 09eb0c3
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 12:15:35 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 docs/src/upgrade/release-3.2.x-incubating.asciidoc | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9323011a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
--
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc 
b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 0fd7498..29b7833 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -83,13 +83,17 @@ public void addHasContainer(final HasContainer 
hasContainer) {
 }
 
 
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1482[TINKERPOP-1482],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1502[TINKERPOP-1502]
+
+
 Duplicate Multi-Properties
 ++
 
 Added `supportsDuplicateMultiProperties` to `VertexFeatures` so that graph 
provider who only support unique values as
 multi-properties have more flexibility in describing their graph capabilities.
 
-See: https://issues.apache.org/jira/browse/TINKERPOP-919[TINKERPOP-919]
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-919[TINKERPOP-919]
 
 Deprecated Performance OptIn
 



[06/11] tinkerpop git commit: caught another bug in FilterRankStrategy. We really need to get the max rank of the traversal parent's nested steps. Effects AndStep, OrStep, WhereTraversalStep, WherePre

2016-11-16 Thread okram
caught another bug in FilterRankStrategy. We really need to get the max rank of 
the traversal parent's nested steps. Effects AndStep, OrStep, 
WhereTraversalStep, WherePredicateStep, DedupStep, OrderStep. This ensures that 
filter(where().by()) isn't pushed forward cause its wrapped in filter().


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

Branch: refs/heads/master
Commit: 997e94fb489afc10cc9bcfc6c92106f021ca1045
Parents: 226633f
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 13:46:44 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 .../optimization/FilterRankingStrategy.java | 41 ++--
 .../optimization/FilterRankingStrategyTest.java |  4 +-
 2 files changed, 33 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/997e94fb/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
index 15040f7..3649615 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
@@ -120,32 +120,51 @@ public final class FilterRankingStrategy extends 
AbstractTraversalStrategy traversal : 
parent.getLocalChildren()) {
+for (final Step step : traversal.getSteps()) {
+final int stepRank = getStepRank(step);
+if (stepRank > maxStepRank)
+maxStepRank = stepRank;
+}
+}
+return maxStepRank;
 }
 
 private static boolean usesLabels(final Step step, final Set 
labels) {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/997e94fb/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
--
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
index b32ae2a..11f390b 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
@@ -112,10 +112,12 @@ public class FilterRankingStrategyTest {
 {__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).and(has("age"), has("name")), 
Collections.emptyList()},
 {__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")).by("age"), 
__.as("a").out().has("age").has("name").where(P.eq("a")).by("age"), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).has("age").has("name"), 
Collections.singletonList(InlineFilterStrategy.instance())},
+{__.as("a").out().and(has("age"), 
has("name")).filter(__.where(P.eq("a"))), 
__.as("a").out().where(P.eq("a")).has("age").has("name"), 
Collections.singletonList(InlineFilterStrategy.instance())},
+{__.as("a").out().and(has("age"), 
has("name")).filter(__.where(P.eq("a")).by("age")), 
__.as("a").out().has("age").has("name").where(P.eq("a")).by("age"), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {has("value", 0).filter(out()).dedup(), has("value", 
0).filter(out()).dedup(), Collections.emptyList()},
 {has("value", 0).or(has("name"), has("age")).has("value", 
1).dedup(), has("value", 0).has("value", 1).or(has("name"), 
has("age")).dedup(), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {has("value", 0).or(out(), 
in()).as(Graph.Hidden.hide("x")).has("value", 1).dedup(), has("value", 
0).has("value", 1).or(outE(), inE()).dedup(), 

[11/11] tinkerpop git commit: Merge branch 'tp32'

2016-11-16 Thread okram
Merge branch 'tp32'


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

Branch: refs/heads/master
Commit: e1f82c422024f58349eab3458f51f42e384c5883
Parents: cad9cd2 997e94f
Author: Marko A. Rodriguez 
Authored: Wed Nov 16 06:36:49 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 06:36:49 2016 -0700

--
 CHANGELOG.asciidoc  |   5 +
 .../upgrade/release-3.2.x-incubating.asciidoc   |  28 +++-
 .../traversal/dsl/graph/GraphTraversal.java | 130 +--
 .../gremlin/process/traversal/dsl/graph/__.java |  43 --
 .../traversal/step/util/HasContainer.java   |  26 ++--
 .../optimization/FilterRankingStrategy.java |  43 --
 .../optimization/InlineFilterStrategy.java  |  20 ++-
 .../process/traversal/util/TraversalHelper.java |  17 +++
 .../traversal/step/filter/HasStepTest.java  |  12 +-
 .../optimization/FilterRankingStrategyTest.java |  27 ++--
 .../optimization/InlineFilterStrategyTest.java  |  12 +-
 .../step/filter/GroovyWhereTest.groovy  |   5 +
 .../traversal/step/filter/WhereTest.java|  16 +++
 .../step/sideEffect/Neo4jGraphStep.java |  11 +-
 .../Neo4jGraphStepStrategyTest.java |  12 +-
 .../step/sideEffect/TinkerGraphStep.java|   9 +-
 .../TinkerGraphStepStrategyTest.java|  10 +-
 17 files changed, 316 insertions(+), 110 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1f82c42/CHANGELOG.asciidoc
--

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1f82c42/docs/src/upgrade/release-3.2.x-incubating.asciidoc
--

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1f82c42/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
--

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1f82c42/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java
--



[08/11] tinkerpop git commit: more test cases around where().by(). all still good in the hood.

2016-11-16 Thread okram
more test cases around where().by(). all still good in the hood.


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

Branch: refs/heads/master
Commit: 226633f32c483a3b2e67ad011a9664cc464f516f
Parents: 9323011
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 12:22:54 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 .../strategy/optimization/FilterRankingStrategyTest.java | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/226633f3/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
--
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
index 577e160..b32ae2a 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
@@ -108,6 +108,10 @@ public class FilterRankingStrategyTest {
 {filter(out()).dedup().has("value", 0), has("value", 
0).filter(out()).dedup(), Collections.emptyList()},
 {__.as("a").out().has("age").where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).has("age"), Collections.emptyList()},
 {__.as("a").out().has("age").where(P.eq("a")).by("age"), 
__.as("a").out().has("age").where(P.eq("a")).by("age"), 
Collections.emptyList()},
+{__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")).by("age"), __.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")).by("age"), Collections.emptyList()},
+{__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).and(has("age"), has("name")), 
Collections.emptyList()},
+{__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")).by("age"), 
__.as("a").out().has("age").has("name").where(P.eq("a")).by("age"), 
Collections.singletonList(InlineFilterStrategy.instance())},
+{__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).has("age").has("name"), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {has("value", 0).filter(out()).dedup(), has("value", 
0).filter(out()).dedup(), Collections.emptyList()},
 {has("value", 0).or(has("name"), has("age")).has("value", 
1).dedup(), has("value", 0).has("value", 1).or(has("name"), 
has("age")).dedup(), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {has("value", 0).or(out(), 
in()).as(Graph.Hidden.hide("x")).has("value", 1).dedup(), has("value", 
0).has("value", 1).or(outE(), inE()).dedup(), 
TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},



[05/11] tinkerpop git commit: added TraversalHelper.addHasContainer() which will either append a HasStep with container or if the traverasl ends with a HasContainerHolder, fold the container into the

2016-11-16 Thread okram
added TraversalHelper.addHasContainer() which will either append a HasStep with 
container or if the traverasl ends with a HasContainerHolder, fold the 
container into the holder. This just makes the code in GraphTravesrsal cleaner 
with less copy/paste.


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

Branch: refs/heads/master
Commit: ffe1b4c18ef4c66f259d3b9c6a80046261dbf38c
Parents: 05bfb02
Author: Marko A. Rodriguez 
Authored: Mon Nov 14 15:44:40 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:43:45 2016 -0700

--
 .../traversal/dsl/graph/GraphTraversal.java | 94 
 .../process/traversal/util/TraversalHelper.java | 17 
 2 files changed, 33 insertions(+), 78 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ffe1b4c1/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
--
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 7543c32..d8f7888 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,7 +36,6 @@ import 
org.apache.tinkerpop.gremlin.process.traversal.lambda.LoopTraversal;
 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.HasContainerHolder;
 import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating;
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
@@ -51,7 +50,6 @@ import 
org.apache.tinkerpop.gremlin.process.traversal.step.filter.ConnectiveStep
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.filter.CyclicPathStep;
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupGlobalStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DropStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsStep;
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.filter.LambdaFilterStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.NotStep;
@@ -908,20 +906,12 @@ public interface GraphTraversal extends 
Traversal {
 
 public default GraphTraversal has(final String propertyKey, final 
P predicate) {
 this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, 
predicate);
-if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
-((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new HasContainer(propertyKey, 
predicate));
-return this;
-} else
-return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(propertyKey, predicate)));
+return TraversalHelper.addHasContainer(this.asAdmin(), new 
HasContainer(propertyKey, predicate));
 }
 
 public default GraphTraversal has(final T accessor, final P 
predicate) {
 this.asAdmin().getBytecode().addStep(Symbols.has, accessor, predicate);
-if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
-((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new 
HasContainer(accessor.getAccessor(), predicate));
-return this;
-} else
-return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(accessor.getAccessor(), predicate)));
+return TraversalHelper.addHasContainer(this.asAdmin(), new 
HasContainer(accessor.getAccessor(), predicate));
 }
 
 public default GraphTraversal has(final String propertyKey, final 
Object value) {
@@ -931,45 +921,25 @@ public interface GraphTraversal extends 
Traversal {
 return this.has(propertyKey, (Traversal) value);
 else {
 this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, 
value);
-if (this.asAdmin().getEndStep() instanceof 

[07/11] tinkerpop git commit: fixed a FilterRankStrategy bug that was introduced with where().by(). Added test cases to verify behavior. Updated CHANGELOG.

2016-11-16 Thread okram
fixed a FilterRankStrategy bug that was introduced with where().by(). Added 
test cases to verify behavior. Updated CHANGELOG.


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

Branch: refs/heads/master
Commit: 248ccc685720535e93b1b2ac3adc94443e697c68
Parents: 0d4ee56
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 12:10:22 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 CHANGELOG.asciidoc  |  5 +
 .../optimization/FilterRankingStrategy.java | 12 +++-
 .../optimization/FilterRankingStrategyTest.java |  3 +++
 .../traversal/step/filter/GroovyWhereTest.groovy|  5 +
 .../process/traversal/step/filter/WhereTest.java| 16 
 5 files changed, 36 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/248ccc68/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 7c4d41f..0613a39 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -27,6 +27,11 @@ TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~
 
 * Converted Spark process suite tests to "integration" tests.
+* Fixed a bug in `InlineFilterStrategy` having to do with folding 
`HasContainers` into `VertexStep`.
+* Deprecated `HasContainer.makeHasContainers()` which was used to dissect 
`AndP` and shouldn't be used at the TinkerPop-level.
+* `GraphTraversal.has()` now will try and fold-left `HasContainer` if end step 
is a `HasContainerHolder`.
+* Created explicit `P`-predicate methods for `GraphTraversal.hasXXX()`.
+* Fixed a bug in `FilterRankStrategy` around `where().by()` ordering.
 * Added another optimization in `RangeByIsCountStrategy`, that removes 
`count().is()` altogether if it's not needed.
 * Fixed a OLAP `MatchStep.clone()`-bug that occurs when the `match()` is in a 
local child.
 * Added another optimization in `RangeByIsCountStrategy`, that removes 
`count().is()` altogether if it's not needed.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/248ccc68/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
index 2f8061b..4ff485a 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
@@ -126,7 +126,7 @@ public final class FilterRankingStrategy extends 
AbstractTraversalStrategyhttp://git-wip-us.apache.org/repos/asf/tinkerpop/blob/248ccc68/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
--
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
index fbeeef5..577e160 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization;
 
+import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@ -105,6 +106,8 @@ public class FilterRankingStrategyTest {
 {__.dedup().has("value", 0).or(not(has("age")), has("age", 
10)).has("value", 1), __.has("value", 0).has("value", 1).or(not(has("age")), 
has("age", 10)).dedup(), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {__.dedup().filter(out()).has("value", 0), 

[01/11] tinkerpop git commit: added more test cases around has() handling.

2016-11-16 Thread okram
Repository: tinkerpop
Updated Branches:
  refs/heads/master cad9cd2e0 -> e1f82c422


added more test cases around has() handling.


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

Branch: refs/heads/master
Commit: 0d4ee569c48c6fab92cd23203dc0fb27af7cfece
Parents: 4a316c5
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 10:00:24 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:43:45 2016 -0700

--
 .../strategy/optimization/InlineFilterStrategyTest.java| 1 +
 .../strategy/optimization/Neo4jGraphStepStrategyTest.java  | 6 ++
 .../strategy/optimization/TinkerGraphStepStrategyTest.java | 6 ++
 3 files changed, 13 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0d4ee569/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
--
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
index 0d02fe4..924182b 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
@@ -113,6 +113,7 @@ public class InlineFilterStrategyTest {
 {V().match(as("a").has("age", 10).has("name", 
"marko").as("b")), V().has("age", 10).has("name", "marko").as("a", "b")},
 {V().match(as("a").has("age", 10).has("name", 
"marko").as("b"), as("a").out("knows").as("c")), V().has("age", 10).has("name", 
"marko").as("a", "b").match(as("a").out("knows").as("c"))},
 {V().match(as("a").out("knows").as("c"), as("a").has("age", 
10).has("name", "marko").as("b")), V().has("age", 10).has("name", 
"marko").as("a", "b").match(as("a").out("knows").as("c"))},
+{V().match(as("a").out("knows").as("c"), as("a").has("age", 
10).has("name", "marko").as("b"), as("a").has("name", "bob")), V().has("age", 
10).has("name", "marko").has("name", "bob").as("a", 
"b").match(as("a").out("knows").as("c"))},
 {V().match(as("a").has("age", 10).as("b"), 
as("a").filter(has("name")).as("b")), V().has("age", 10).as("a", 
"b").match(as("a").has("name").as("b"))},
 //
 {filter(dedup()), filter(dedup())},

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0d4ee569/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
--
diff --git 
a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
 
b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
index a6b0862..77a2610 100644
--- 
a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
+++ 
b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
@@ -123,6 +123,12 @@ public class Neo4jGraphStepStrategyTest {
 g_V("name", eq("marko"), "lang", eq("java"), "name", 
eq("bob"), "age", eq(10).or(gt(32))).dedup().as("a"), 
TraversalStrategies.GlobalCache.getStrategies(Neo4jGraph.class).toList()},
 {__.V().has("name", "marko").or(not(has("age")), has("age", 
gt(32))).has("name", "bob").has("lang", "java"),
 g_V("name", eq("marko"), "name", eq("bob"), "lang", 
eq("java")).or(not(filter(properties("age"))), has("age", gt(32))), 
TraversalStrategies.GlobalCache.getStrategies(Neo4jGraph.class).toList()},
+{__.V().has("name", 
P.eq("marko").or(P.eq("bob").and(P.eq("stephen".out("knows"),
+g_V("name", 
eq("marko").or(P.eq("bob").and(P.eq("stephen".out("knows"), 
Collections.emptyList()},
+{__.V().has("name", 
P.eq("marko").and(P.eq("bob").and(P.eq("stephen".out("knows"),
+g_V("name", eq("marko"), "name", eq("bob"), "name", 
eq("stephen")).out("knows"), Collections.emptyList()},
+

[09/11] tinkerpop git commit: moved where().by() a bit further down in the FilterRankStrategy ranking as OrStep and AndStep can have has(xxx) analyses.

2016-11-16 Thread okram
moved where().by() a bit further down in the FilterRankStrategy ranking as 
OrStep and AndStep can have has(xxx) analyses.


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

Branch: refs/heads/master
Commit: 09eb0c33136b34da52500d4989dc0075c8fc1179
Parents: 248ccc6
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 12:13:45 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 .../traversal/strategy/optimization/FilterRankingStrategy.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/09eb0c33/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
index 4ff485a..15040f7 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
@@ -134,11 +134,11 @@ public final class FilterRankingStrategy extends 
AbstractTraversalStrategy

[04/11] tinkerpop git commit: first push on 'left-append' of has() containers.

2016-11-16 Thread okram
first push on 'left-append' of has() containers.


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

Branch: refs/heads/master
Commit: 8c1391cfb83cce58246dbd20dec559a71f4e76c8
Parents: 265f39b
Author: Marko A. Rodriguez 
Authored: Mon Nov 14 12:54:07 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:43:45 2016 -0700

--
 .../traversal/dsl/graph/GraphTraversal.java | 57 ++--
 1 file changed, 41 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8c1391cf/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
--
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 088a4de..e875513 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.LoopTraversal;
 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.HasContainerHolder;
 import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating;
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
@@ -905,12 +906,20 @@ public interface GraphTraversal extends 
Traversal {
 
 public default GraphTraversal has(final String propertyKey, final 
P predicate) {
 this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, 
predicate);
-return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(propertyKey, predicate)));
+if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
+((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new HasContainer(propertyKey, 
predicate));
+return this;
+} else
+return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(propertyKey, predicate)));
 }
 
 public default GraphTraversal has(final T accessor, final P 
predicate) {
 this.asAdmin().getBytecode().addStep(Symbols.has, accessor, predicate);
-return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(accessor.getAccessor(), predicate)));
+if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
+((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new 
HasContainer(accessor.getAccessor(), predicate));
+return this;
+} else
+return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(accessor.getAccessor(), predicate)));
 }
 
 public default GraphTraversal has(final String propertyKey, final 
Object value) {
@@ -918,29 +927,47 @@ public interface GraphTraversal extends 
Traversal {
 return this.has(propertyKey, (P) value);
 else if (value instanceof Traversal)
 return this.has(propertyKey, (Traversal) value);
-else
-return this.has(propertyKey, P.eq(value));
+else {
+this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, 
value);
+if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
+((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new HasContainer(propertyKey, 
P.eq(value)));
+return this;
+} else
+return this.asAdmin().addStep(new HasStep(this.asAdmin(), new 
HasContainer(propertyKey, P.eq(value;
+}
 }
 
 public default GraphTraversal has(final T accessor, final Object 
value) {
 this.asAdmin().getBytecode().addStep(Symbols.has, accessor, value);
-return value instanceof P ?
-this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(accessor.getAccessor(), (P) value))) :
-

[07/10] tinkerpop git commit: updated upgrade with links to the respective tickets.

2016-11-16 Thread okram
updated upgrade with links to the respective tickets.


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

Branch: refs/heads/tp32
Commit: 9323011a3abd08330c462a02a0aa4fdfff3ed602
Parents: 09eb0c3
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 12:15:35 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 docs/src/upgrade/release-3.2.x-incubating.asciidoc | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9323011a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
--
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc 
b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 0fd7498..29b7833 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -83,13 +83,17 @@ public void addHasContainer(final HasContainer 
hasContainer) {
 }
 
 
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1482[TINKERPOP-1482],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1502[TINKERPOP-1502]
+
+
 Duplicate Multi-Properties
 ++
 
 Added `supportsDuplicateMultiProperties` to `VertexFeatures` so that graph 
provider who only support unique values as
 multi-properties have more flexibility in describing their graph capabilities.
 
-See: https://issues.apache.org/jira/browse/TINKERPOP-919[TINKERPOP-919]
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-919[TINKERPOP-919]
 
 Deprecated Performance OptIn
 



[03/10] tinkerpop git commit: added TraversalHelper.addHasContainer() which will either append a HasStep with container or if the traverasl ends with a HasContainerHolder, fold the container into the

2016-11-16 Thread okram
added TraversalHelper.addHasContainer() which will either append a HasStep with 
container or if the traverasl ends with a HasContainerHolder, fold the 
container into the holder. This just makes the code in GraphTravesrsal cleaner 
with less copy/paste.


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

Branch: refs/heads/tp32
Commit: ffe1b4c18ef4c66f259d3b9c6a80046261dbf38c
Parents: 05bfb02
Author: Marko A. Rodriguez 
Authored: Mon Nov 14 15:44:40 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:43:45 2016 -0700

--
 .../traversal/dsl/graph/GraphTraversal.java | 94 
 .../process/traversal/util/TraversalHelper.java | 17 
 2 files changed, 33 insertions(+), 78 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ffe1b4c1/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
--
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 7543c32..d8f7888 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,7 +36,6 @@ import 
org.apache.tinkerpop.gremlin.process.traversal.lambda.LoopTraversal;
 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.HasContainerHolder;
 import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating;
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
@@ -51,7 +50,6 @@ import 
org.apache.tinkerpop.gremlin.process.traversal.step.filter.ConnectiveStep
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.filter.CyclicPathStep;
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupGlobalStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DropStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsStep;
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.filter.LambdaFilterStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.NotStep;
@@ -908,20 +906,12 @@ public interface GraphTraversal extends 
Traversal {
 
 public default GraphTraversal has(final String propertyKey, final 
P predicate) {
 this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, 
predicate);
-if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
-((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new HasContainer(propertyKey, 
predicate));
-return this;
-} else
-return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(propertyKey, predicate)));
+return TraversalHelper.addHasContainer(this.asAdmin(), new 
HasContainer(propertyKey, predicate));
 }
 
 public default GraphTraversal has(final T accessor, final P 
predicate) {
 this.asAdmin().getBytecode().addStep(Symbols.has, accessor, predicate);
-if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
-((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new 
HasContainer(accessor.getAccessor(), predicate));
-return this;
-} else
-return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(accessor.getAccessor(), predicate)));
+return TraversalHelper.addHasContainer(this.asAdmin(), new 
HasContainer(accessor.getAccessor(), predicate));
 }
 
 public default GraphTraversal has(final String propertyKey, final 
Object value) {
@@ -931,45 +921,25 @@ public interface GraphTraversal extends 
Traversal {
 return this.has(propertyKey, (Traversal) value);
 else {
 this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, 
value);
-if (this.asAdmin().getEndStep() instanceof 

[10/10] tinkerpop git commit: moved where().by() a bit further down in the FilterRankStrategy ranking as OrStep and AndStep can have has(xxx) analyses.

2016-11-16 Thread okram
moved where().by() a bit further down in the FilterRankStrategy ranking as 
OrStep and AndStep can have has(xxx) analyses.


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

Branch: refs/heads/tp32
Commit: 09eb0c33136b34da52500d4989dc0075c8fc1179
Parents: 248ccc6
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 12:13:45 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 .../traversal/strategy/optimization/FilterRankingStrategy.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/09eb0c33/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
index 4ff485a..15040f7 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
@@ -134,11 +134,11 @@ public final class FilterRankingStrategy extends 
AbstractTraversalStrategy

[06/10] tinkerpop git commit: caught another bug in FilterRankStrategy. We really need to get the max rank of the traversal parent's nested steps. Effects AndStep, OrStep, WhereTraversalStep, WherePre

2016-11-16 Thread okram
caught another bug in FilterRankStrategy. We really need to get the max rank of 
the traversal parent's nested steps. Effects AndStep, OrStep, 
WhereTraversalStep, WherePredicateStep, DedupStep, OrderStep. This ensures that 
filter(where().by()) isn't pushed forward cause its wrapped in filter().


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

Branch: refs/heads/tp32
Commit: 997e94fb489afc10cc9bcfc6c92106f021ca1045
Parents: 226633f
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 13:46:44 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 .../optimization/FilterRankingStrategy.java | 41 ++--
 .../optimization/FilterRankingStrategyTest.java |  4 +-
 2 files changed, 33 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/997e94fb/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
index 15040f7..3649615 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
@@ -120,32 +120,51 @@ public final class FilterRankingStrategy extends 
AbstractTraversalStrategy traversal : 
parent.getLocalChildren()) {
+for (final Step step : traversal.getSteps()) {
+final int stepRank = getStepRank(step);
+if (stepRank > maxStepRank)
+maxStepRank = stepRank;
+}
+}
+return maxStepRank;
 }
 
 private static boolean usesLabels(final Step step, final Set 
labels) {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/997e94fb/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
--
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
index b32ae2a..11f390b 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
@@ -112,10 +112,12 @@ public class FilterRankingStrategyTest {
 {__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).and(has("age"), has("name")), 
Collections.emptyList()},
 {__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")).by("age"), 
__.as("a").out().has("age").has("name").where(P.eq("a")).by("age"), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).has("age").has("name"), 
Collections.singletonList(InlineFilterStrategy.instance())},
+{__.as("a").out().and(has("age"), 
has("name")).filter(__.where(P.eq("a"))), 
__.as("a").out().where(P.eq("a")).has("age").has("name"), 
Collections.singletonList(InlineFilterStrategy.instance())},
+{__.as("a").out().and(has("age"), 
has("name")).filter(__.where(P.eq("a")).by("age")), 
__.as("a").out().has("age").has("name").where(P.eq("a")).by("age"), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {has("value", 0).filter(out()).dedup(), has("value", 
0).filter(out()).dedup(), Collections.emptyList()},
 {has("value", 0).or(has("name"), has("age")).has("value", 
1).dedup(), has("value", 0).has("value", 1).or(has("name"), 
has("age")).dedup(), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {has("value", 0).or(out(), 
in()).as(Graph.Hidden.hide("x")).has("value", 1).dedup(), has("value", 
0).has("value", 1).or(outE(), inE()).dedup(), 

[05/10] tinkerpop git commit: fixed up the hasXXX() methods to account of P and Object differently. Will go through and create a TraversalHelper.addHasContainer() method which will left append or righ

2016-11-16 Thread okram
fixed up the hasXXX() methods to account of P and Object differently. Will go 
through and create a TraversalHelper.addHasContainer() method which will left 
append or right append depending on Traversal state. this will simplify methods 
signficiantly.


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

Branch: refs/heads/tp32
Commit: 05bfb029c20fd21cba468b4bf25cbab322526807
Parents: 8c1391c
Author: Marko A. Rodriguez 
Authored: Mon Nov 14 13:46:00 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:43:45 2016 -0700

--
 .../traversal/dsl/graph/GraphTraversal.java | 114 +++
 .../gremlin/process/traversal/dsl/graph/__.java |  43 +--
 .../traversal/step/filter/HasStepTest.java  |  12 +-
 3 files changed, 128 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/05bfb029/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
--
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 e875513..7543c32 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
@@ -147,8 +147,10 @@ import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.util.function.ConstantSupplier;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
@@ -994,38 +996,106 @@ public interface GraphTraversal extends 
Traversal {
 return this.asAdmin().addStep(new NotStep<>(this.asAdmin(), 
__.values(propertyKey)));
 }
 
-public default GraphTraversal has(final T accessor, final Object 
value, final Object... values) {
-if (value instanceof Object[]) {
-final Object[] arr = (Object[]) value;
-if (values.length == 0) {
-if (arr.length == 1) {
-return has(accessor, P.eq(arr[0]));
+public default GraphTraversal hasLabel(final String label, final 
String... otherLabels) {
+final String[] labels = new String[otherLabels.length + 1];
+labels[0] = label;
+System.arraycopy(otherLabels, 0, labels, 1, otherLabels.length);
+this.asAdmin().getBytecode().addStep(Symbols.hasLabel, labels);
+if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
+((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new 
HasContainer(T.label.getAccessor(), labels.length == 1 ? P.eq(labels[0]) : 
P.within(labels)));
+return this;
+} else
+return this.asAdmin().addStep(new HasStep(this.asAdmin(), new 
HasContainer(T.label.getAccessor(), labels.length == 1 ? P.eq(labels[0]) : 
P.within(labels;
+}
+
+public default GraphTraversal hasLabel(final P predicate) {
+this.asAdmin().getBytecode().addStep(Symbols.hasLabel, predicate);
+if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
+((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new 
HasContainer(T.label.getAccessor(), predicate));
+return this;
+} else
+return this.asAdmin().addStep(new HasStep(this.asAdmin(), new 
HasContainer(T.label.getAccessor(), predicate)));
+}
+
+public default GraphTraversal hasId(final Object id, final Object... 
otherIds) {
+if (id instanceof P)
+return this.hasId((P) id);
+else {
+final List ids = new ArrayList<>();
+if (id.getClass().isArray()) {
+for (final Object i : (Object[]) id) {
+ids.add(i);
 }
-return has(accessor, P.within(arr));
-}
-} else if (values.length == 0) {
-return has(accessor, value instanceof P ? (P) value : P.eq(value));
+} else
+ids.add(id);
+Collections.addAll(ids, otherIds);
+this.asAdmin().getBytecode().addStep(Symbols.hasId, ids.toArray());
+if 

[01/10] tinkerpop git commit: added more test cases around has() handling.

2016-11-16 Thread okram
Repository: tinkerpop
Updated Branches:
  refs/heads/tp32 265f39bbf -> 997e94fb4


added more test cases around has() handling.


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

Branch: refs/heads/tp32
Commit: 0d4ee569c48c6fab92cd23203dc0fb27af7cfece
Parents: 4a316c5
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 10:00:24 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:43:45 2016 -0700

--
 .../strategy/optimization/InlineFilterStrategyTest.java| 1 +
 .../strategy/optimization/Neo4jGraphStepStrategyTest.java  | 6 ++
 .../strategy/optimization/TinkerGraphStepStrategyTest.java | 6 ++
 3 files changed, 13 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0d4ee569/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
--
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
index 0d02fe4..924182b 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
@@ -113,6 +113,7 @@ public class InlineFilterStrategyTest {
 {V().match(as("a").has("age", 10).has("name", 
"marko").as("b")), V().has("age", 10).has("name", "marko").as("a", "b")},
 {V().match(as("a").has("age", 10).has("name", 
"marko").as("b"), as("a").out("knows").as("c")), V().has("age", 10).has("name", 
"marko").as("a", "b").match(as("a").out("knows").as("c"))},
 {V().match(as("a").out("knows").as("c"), as("a").has("age", 
10).has("name", "marko").as("b")), V().has("age", 10).has("name", 
"marko").as("a", "b").match(as("a").out("knows").as("c"))},
+{V().match(as("a").out("knows").as("c"), as("a").has("age", 
10).has("name", "marko").as("b"), as("a").has("name", "bob")), V().has("age", 
10).has("name", "marko").has("name", "bob").as("a", 
"b").match(as("a").out("knows").as("c"))},
 {V().match(as("a").has("age", 10).as("b"), 
as("a").filter(has("name")).as("b")), V().has("age", 10).as("a", 
"b").match(as("a").has("name").as("b"))},
 //
 {filter(dedup()), filter(dedup())},

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0d4ee569/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
--
diff --git 
a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
 
b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
index a6b0862..77a2610 100644
--- 
a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
+++ 
b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
@@ -123,6 +123,12 @@ public class Neo4jGraphStepStrategyTest {
 g_V("name", eq("marko"), "lang", eq("java"), "name", 
eq("bob"), "age", eq(10).or(gt(32))).dedup().as("a"), 
TraversalStrategies.GlobalCache.getStrategies(Neo4jGraph.class).toList()},
 {__.V().has("name", "marko").or(not(has("age")), has("age", 
gt(32))).has("name", "bob").has("lang", "java"),
 g_V("name", eq("marko"), "name", eq("bob"), "lang", 
eq("java")).or(not(filter(properties("age"))), has("age", gt(32))), 
TraversalStrategies.GlobalCache.getStrategies(Neo4jGraph.class).toList()},
+{__.V().has("name", 
P.eq("marko").or(P.eq("bob").and(P.eq("stephen".out("knows"),
+g_V("name", 
eq("marko").or(P.eq("bob").and(P.eq("stephen".out("knows"), 
Collections.emptyList()},
+{__.V().has("name", 
P.eq("marko").and(P.eq("bob").and(P.eq("stephen".out("knows"),
+g_V("name", eq("marko"), "name", eq("bob"), "name", 
eq("stephen")).out("knows"), Collections.emptyList()},
+

[04/10] tinkerpop git commit: first push on 'left-append' of has() containers.

2016-11-16 Thread okram
first push on 'left-append' of has() containers.


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

Branch: refs/heads/tp32
Commit: 8c1391cfb83cce58246dbd20dec559a71f4e76c8
Parents: 265f39b
Author: Marko A. Rodriguez 
Authored: Mon Nov 14 12:54:07 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:43:45 2016 -0700

--
 .../traversal/dsl/graph/GraphTraversal.java | 57 ++--
 1 file changed, 41 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8c1391cf/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
--
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 088a4de..e875513 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.LoopTraversal;
 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.HasContainerHolder;
 import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating;
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
@@ -905,12 +906,20 @@ public interface GraphTraversal extends 
Traversal {
 
 public default GraphTraversal has(final String propertyKey, final 
P predicate) {
 this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, 
predicate);
-return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(propertyKey, predicate)));
+if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
+((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new HasContainer(propertyKey, 
predicate));
+return this;
+} else
+return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(propertyKey, predicate)));
 }
 
 public default GraphTraversal has(final T accessor, final P 
predicate) {
 this.asAdmin().getBytecode().addStep(Symbols.has, accessor, predicate);
-return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(accessor.getAccessor(), predicate)));
+if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
+((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new 
HasContainer(accessor.getAccessor(), predicate));
+return this;
+} else
+return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(accessor.getAccessor(), predicate)));
 }
 
 public default GraphTraversal has(final String propertyKey, final 
Object value) {
@@ -918,29 +927,47 @@ public interface GraphTraversal extends 
Traversal {
 return this.has(propertyKey, (P) value);
 else if (value instanceof Traversal)
 return this.has(propertyKey, (Traversal) value);
-else
-return this.has(propertyKey, P.eq(value));
+else {
+this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, 
value);
+if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
+((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new HasContainer(propertyKey, 
P.eq(value)));
+return this;
+} else
+return this.asAdmin().addStep(new HasStep(this.asAdmin(), new 
HasContainer(propertyKey, P.eq(value;
+}
 }
 
 public default GraphTraversal has(final T accessor, final Object 
value) {
 this.asAdmin().getBytecode().addStep(Symbols.has, accessor, value);
-return value instanceof P ?
-this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(accessor.getAccessor(), (P) value))) :
-

[02/10] tinkerpop git commit: found a bug in HasContainer.makeHasContainers() around AndP recurssion. No biggie, just didn't yield ultimate optimization. Found a bug in InlineFilterStrategy where hasL

2016-11-16 Thread okram
found a bug in HasContainer.makeHasContainers() around AndP recurssion. No 
biggie, just didn't yield ultimate optimization. Found a bug in 
InlineFilterStrategy where hasLabel() should only back propagate into 
VertexStep[edges] if the step doesn't already have edge labels. Removed 
HasContainer.makeHasContainers() -- another ticket I'm putting into this 
branch. GraphTraversal.has() is fixed up accordingly with left-fold 
HasContainers and valid Object[] usage. Going to add a few more tests around 
hasXXX() steps.


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

Branch: refs/heads/tp32
Commit: 4a316c55c3ab1e42ef6568689cadbca0e2fb9ed8
Parents: ffe1b4c
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 08:27:24 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:43:45 2016 -0700

--
 .../upgrade/release-3.2.x-incubating.asciidoc   | 22 +++
 .../traversal/dsl/graph/GraphTraversal.java | 29 
 .../traversal/step/util/HasContainer.java   | 26 ++
 .../optimization/InlineFilterStrategy.java  | 20 +-
 .../optimization/FilterRankingStrategyTest.java | 18 ++--
 .../optimization/InlineFilterStrategyTest.java  | 11 +---
 .../step/sideEffect/Neo4jGraphStep.java | 11 ++--
 .../Neo4jGraphStepStrategyTest.java |  6 ++--
 .../step/sideEffect/TinkerGraphStep.java|  9 +-
 .../TinkerGraphStepStrategyTest.java|  4 +--
 10 files changed, 111 insertions(+), 45 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4a316c55/docs/src/upgrade/release-3.2.x-incubating.asciidoc
--
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc 
b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 8574b88..0fd7498 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -61,6 +61,28 @@ Upgrading for Providers
 Graph Database Providers
 
 
+HasContainer AndP Splitting

+
+Previously, `GraphTraversal` made it easy for providers to analyze 
`P`-predicates in `HasContainers`, but always
+splitting `AndP` predicates into their component parts. This helper behavior 
is no longer provided because,
+1.) `AndP` can be inserted into a `XXXStep` in other ways, 2.) the providers 
`XXXStep` should process `AndP`
+regardless of `GraphTraversal` helper, and 3.) the `GraphTraversal` helper did 
not recursively split.
+A simple way to split `AndP` in any custom `XXXStep` that implements 
`HasContainerHolder` is to use the following method:
+
+[source,java]
+
+@Override
+public void addHasContainer(final HasContainer hasContainer) {
+  if (hasContainer.getPredicate() instanceof AndP) {
+for (final P predicate : ((AndP) 
hasContainer.getPredicate()).getPredicates()) {
+  this.addHasContainer(new HasContainer(hasContainer.getKey(), predicate));
+}
+  } else
+this.hasContainers.add(hasContainer);
+}
+
+
 Duplicate Multi-Properties
 ++
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4a316c55/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
--
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 d8f7888..fae2d67 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
@@ -148,7 +148,6 @@ import 
org.apache.tinkerpop.gremlin.util.function.ConstantSupplier;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
@@ -926,8 +925,14 @@ public interface GraphTraversal extends Traversal {
 }
 
 public default GraphTraversal has(final T accessor, final Object 
value) {
-this.asAdmin().getBytecode().addStep(Symbols.has, accessor, value);
-return TraversalHelper.addHasContainer(this.asAdmin(), new 
HasContainer(accessor.getAccessor(), value instanceof P ? (P) value : 
P.eq(value)));
+if (value instanceof P)

[09/10] tinkerpop git commit: more test cases around where().by(). all still good in the hood.

2016-11-16 Thread okram
more test cases around where().by(). all still good in the hood.


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

Branch: refs/heads/tp32
Commit: 226633f32c483a3b2e67ad011a9664cc464f516f
Parents: 9323011
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 12:22:54 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 .../strategy/optimization/FilterRankingStrategyTest.java | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/226633f3/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
--
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
index 577e160..b32ae2a 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
@@ -108,6 +108,10 @@ public class FilterRankingStrategyTest {
 {filter(out()).dedup().has("value", 0), has("value", 
0).filter(out()).dedup(), Collections.emptyList()},
 {__.as("a").out().has("age").where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).has("age"), Collections.emptyList()},
 {__.as("a").out().has("age").where(P.eq("a")).by("age"), 
__.as("a").out().has("age").where(P.eq("a")).by("age"), 
Collections.emptyList()},
+{__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")).by("age"), __.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")).by("age"), Collections.emptyList()},
+{__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).and(has("age"), has("name")), 
Collections.emptyList()},
+{__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")).by("age"), 
__.as("a").out().has("age").has("name").where(P.eq("a")).by("age"), 
Collections.singletonList(InlineFilterStrategy.instance())},
+{__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).has("age").has("name"), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {has("value", 0).filter(out()).dedup(), has("value", 
0).filter(out()).dedup(), Collections.emptyList()},
 {has("value", 0).or(has("name"), has("age")).has("value", 
1).dedup(), has("value", 0).has("value", 1).or(has("name"), 
has("age")).dedup(), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {has("value", 0).or(out(), 
in()).as(Graph.Hidden.hide("x")).has("value", 1).dedup(), has("value", 
0).has("value", 1).or(outE(), inE()).dedup(), 
TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},



[08/10] tinkerpop git commit: fixed a FilterRankStrategy bug that was introduced with where().by(). Added test cases to verify behavior. Updated CHANGELOG.

2016-11-16 Thread okram
fixed a FilterRankStrategy bug that was introduced with where().by(). Added 
test cases to verify behavior. Updated CHANGELOG.


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

Branch: refs/heads/tp32
Commit: 248ccc685720535e93b1b2ac3adc94443e697c68
Parents: 0d4ee56
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 12:10:22 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 CHANGELOG.asciidoc  |  5 +
 .../optimization/FilterRankingStrategy.java | 12 +++-
 .../optimization/FilterRankingStrategyTest.java |  3 +++
 .../traversal/step/filter/GroovyWhereTest.groovy|  5 +
 .../process/traversal/step/filter/WhereTest.java| 16 
 5 files changed, 36 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/248ccc68/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 7c4d41f..0613a39 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -27,6 +27,11 @@ TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~
 
 * Converted Spark process suite tests to "integration" tests.
+* Fixed a bug in `InlineFilterStrategy` having to do with folding 
`HasContainers` into `VertexStep`.
+* Deprecated `HasContainer.makeHasContainers()` which was used to dissect 
`AndP` and shouldn't be used at the TinkerPop-level.
+* `GraphTraversal.has()` now will try and fold-left `HasContainer` if end step 
is a `HasContainerHolder`.
+* Created explicit `P`-predicate methods for `GraphTraversal.hasXXX()`.
+* Fixed a bug in `FilterRankStrategy` around `where().by()` ordering.
 * Added another optimization in `RangeByIsCountStrategy`, that removes 
`count().is()` altogether if it's not needed.
 * Fixed a OLAP `MatchStep.clone()`-bug that occurs when the `match()` is in a 
local child.
 * Added another optimization in `RangeByIsCountStrategy`, that removes 
`count().is()` altogether if it's not needed.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/248ccc68/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
index 2f8061b..4ff485a 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
@@ -126,7 +126,7 @@ public final class FilterRankingStrategy extends 
AbstractTraversalStrategyhttp://git-wip-us.apache.org/repos/asf/tinkerpop/blob/248ccc68/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
--
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
index fbeeef5..577e160 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization;
 
+import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@ -105,6 +106,8 @@ public class FilterRankingStrategyTest {
 {__.dedup().has("value", 0).or(not(has("age")), has("age", 
10)).has("value", 1), __.has("value", 0).has("value", 1).or(not(has("age")), 
has("age", 10)).dedup(), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {__.dedup().filter(out()).has("value", 0), 

[11/29] tinkerpop git commit: Merge commit 'c20d814' into tp32

2016-11-16 Thread okram
Merge commit 'c20d814' into tp32


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

Branch: refs/heads/TINKERPOP-1502
Commit: eaa26170c4b2d7738f29c9f9de223db9ae374d64
Parents: ad01fa1 c20d814
Author: Robert Dale 
Authored: Mon Nov 14 20:54:22 2016 -0500
Committer: Robert Dale 
Committed: Mon Nov 14 20:54:22 2016 -0500

--
 docs/src/reference/the-graph.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/eaa26170/docs/src/reference/the-graph.asciidoc
--



[23/29] tinkerpop git commit: added more test cases around has() handling.

2016-11-16 Thread okram
added more test cases around has() handling.


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

Branch: refs/heads/TINKERPOP-1502
Commit: 0d4ee569c48c6fab92cd23203dc0fb27af7cfece
Parents: 4a316c5
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 10:00:24 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:43:45 2016 -0700

--
 .../strategy/optimization/InlineFilterStrategyTest.java| 1 +
 .../strategy/optimization/Neo4jGraphStepStrategyTest.java  | 6 ++
 .../strategy/optimization/TinkerGraphStepStrategyTest.java | 6 ++
 3 files changed, 13 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0d4ee569/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
--
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
index 0d02fe4..924182b 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategyTest.java
@@ -113,6 +113,7 @@ public class InlineFilterStrategyTest {
 {V().match(as("a").has("age", 10).has("name", 
"marko").as("b")), V().has("age", 10).has("name", "marko").as("a", "b")},
 {V().match(as("a").has("age", 10).has("name", 
"marko").as("b"), as("a").out("knows").as("c")), V().has("age", 10).has("name", 
"marko").as("a", "b").match(as("a").out("knows").as("c"))},
 {V().match(as("a").out("knows").as("c"), as("a").has("age", 
10).has("name", "marko").as("b")), V().has("age", 10).has("name", 
"marko").as("a", "b").match(as("a").out("knows").as("c"))},
+{V().match(as("a").out("knows").as("c"), as("a").has("age", 
10).has("name", "marko").as("b"), as("a").has("name", "bob")), V().has("age", 
10).has("name", "marko").has("name", "bob").as("a", 
"b").match(as("a").out("knows").as("c"))},
 {V().match(as("a").has("age", 10).as("b"), 
as("a").filter(has("name")).as("b")), V().has("age", 10).as("a", 
"b").match(as("a").has("name").as("b"))},
 //
 {filter(dedup()), filter(dedup())},

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0d4ee569/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
--
diff --git 
a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
 
b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
index a6b0862..77a2610 100644
--- 
a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
+++ 
b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
@@ -123,6 +123,12 @@ public class Neo4jGraphStepStrategyTest {
 g_V("name", eq("marko"), "lang", eq("java"), "name", 
eq("bob"), "age", eq(10).or(gt(32))).dedup().as("a"), 
TraversalStrategies.GlobalCache.getStrategies(Neo4jGraph.class).toList()},
 {__.V().has("name", "marko").or(not(has("age")), has("age", 
gt(32))).has("name", "bob").has("lang", "java"),
 g_V("name", eq("marko"), "name", eq("bob"), "lang", 
eq("java")).or(not(filter(properties("age"))), has("age", gt(32))), 
TraversalStrategies.GlobalCache.getStrategies(Neo4jGraph.class).toList()},
+{__.V().has("name", 
P.eq("marko").or(P.eq("bob").and(P.eq("stephen".out("knows"),
+g_V("name", 
eq("marko").or(P.eq("bob").and(P.eq("stephen".out("knows"), 
Collections.emptyList()},
+{__.V().has("name", 
P.eq("marko").and(P.eq("bob").and(P.eq("stephen".out("knows"),
+g_V("name", eq("marko"), "name", eq("bob"), "name", 
eq("stephen")).out("knows"), Collections.emptyList()},
+{__.V().has("name", 

[28/29] tinkerpop git commit: moved where().by() a bit further down in the FilterRankStrategy ranking as OrStep and AndStep can have has(xxx) analyses.

2016-11-16 Thread okram
moved where().by() a bit further down in the FilterRankStrategy ranking as 
OrStep and AndStep can have has(xxx) analyses.


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

Branch: refs/heads/TINKERPOP-1502
Commit: 09eb0c33136b34da52500d4989dc0075c8fc1179
Parents: 248ccc6
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 12:13:45 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 .../traversal/strategy/optimization/FilterRankingStrategy.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/09eb0c33/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
index 4ff485a..15040f7 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
@@ -134,11 +134,11 @@ public final class FilterRankingStrategy extends 
AbstractTraversalStrategy

[13/29] tinkerpop git commit: Merge branch 'tp31' into tp32

2016-11-16 Thread okram
Merge branch 'tp31' into tp32


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

Branch: refs/heads/TINKERPOP-1502
Commit: 02f166407dfdeff3fd2e98a57cb6b6229ac9aa80
Parents: eaa2617 26db14e
Author: Stephen Mallette 
Authored: Tue Nov 15 09:33:27 2016 -0500
Committer: Stephen Mallette 
Committed: Tue Nov 15 09:33:27 2016 -0500

--
 .../gremlin/server/handler/SaslAuthenticationHandler.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--




[04/29] tinkerpop git commit: fixed a GroupStep serialization bug that was introduced many tickets ago -- don't know why we didn't notice it. simple fix.

2016-11-16 Thread okram
fixed a GroupStep serialization bug that was introduced many tickets ago -- 
don't know why we didn't notice it. simple fix.


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

Branch: refs/heads/TINKERPOP-1502
Commit: ad01fa1efff39f9a19a7afc70023d1cad203c29b
Parents: d0f0202
Author: Marko A. Rodriguez 
Authored: Mon Nov 14 16:14:43 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Mon Nov 14 16:14:55 2016 -0700

--
 .../tinkerpop/gremlin/process/traversal/step/map/GroupStep.java   | 3 +--
 .../process/traversal/step/sideEffect/GroupSideEffectStep.java| 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ad01fa1e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroupStep.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroupStep.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroupStep.java
index 174c1ad..7d80d69 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroupStep.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroupStep.java
@@ -130,8 +130,7 @@ public final class GroupStep extends 
ReducingBarrierStep>
 if (null != this.keyTraversal)
 clone.keyTraversal = this.keyTraversal.clone();
 clone.valueTraversal = this.valueTraversal.clone();
-if (null != this.preTraversal)
-clone.preTraversal = this.preTraversal.clone();
+clone.preTraversal = (Traversal.Admin) 
GroupStep.generatePreTraversal(clone.valueTraversal);
 return clone;
 }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ad01fa1e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStep.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStep.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStep.java
index cf69c4c..0e8a4f5 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStep.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStep.java
@@ -121,8 +121,7 @@ public final class GroupSideEffectStep extends 
SideEffectStep implem
 if (null != this.keyTraversal)
 clone.keyTraversal = this.keyTraversal.clone();
 clone.valueTraversal = this.valueTraversal.clone();
-if (null != this.preTraversal)
-clone.preTraversal = this.preTraversal.clone();
+clone.preTraversal = (Traversal.Admin) 
GroupStep.generatePreTraversal(clone.valueTraversal);
 return clone;
 }
 



[21/29] tinkerpop git commit: first push on 'left-append' of has() containers.

2016-11-16 Thread okram
first push on 'left-append' of has() containers.


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

Branch: refs/heads/TINKERPOP-1502
Commit: 8c1391cfb83cce58246dbd20dec559a71f4e76c8
Parents: 265f39b
Author: Marko A. Rodriguez 
Authored: Mon Nov 14 12:54:07 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:43:45 2016 -0700

--
 .../traversal/dsl/graph/GraphTraversal.java | 57 ++--
 1 file changed, 41 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8c1391cf/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
--
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 088a4de..e875513 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.LoopTraversal;
 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.HasContainerHolder;
 import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating;
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
@@ -905,12 +906,20 @@ public interface GraphTraversal extends 
Traversal {
 
 public default GraphTraversal has(final String propertyKey, final 
P predicate) {
 this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, 
predicate);
-return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(propertyKey, predicate)));
+if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
+((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new HasContainer(propertyKey, 
predicate));
+return this;
+} else
+return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(propertyKey, predicate)));
 }
 
 public default GraphTraversal has(final T accessor, final P 
predicate) {
 this.asAdmin().getBytecode().addStep(Symbols.has, accessor, predicate);
-return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(accessor.getAccessor(), predicate)));
+if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
+((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new 
HasContainer(accessor.getAccessor(), predicate));
+return this;
+} else
+return this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(accessor.getAccessor(), predicate)));
 }
 
 public default GraphTraversal has(final String propertyKey, final 
Object value) {
@@ -918,29 +927,47 @@ public interface GraphTraversal extends 
Traversal {
 return this.has(propertyKey, (P) value);
 else if (value instanceof Traversal)
 return this.has(propertyKey, (Traversal) value);
-else
-return this.has(propertyKey, P.eq(value));
+else {
+this.asAdmin().getBytecode().addStep(Symbols.has, propertyKey, 
value);
+if (this.asAdmin().getEndStep() instanceof HasContainerHolder) {
+((HasContainerHolder) 
this.asAdmin().getEndStep()).addHasContainer(new HasContainer(propertyKey, 
P.eq(value)));
+return this;
+} else
+return this.asAdmin().addStep(new HasStep(this.asAdmin(), new 
HasContainer(propertyKey, P.eq(value;
+}
 }
 
 public default GraphTraversal has(final T accessor, final Object 
value) {
 this.asAdmin().getBytecode().addStep(Symbols.has, accessor, value);
-return value instanceof P ?
-this.asAdmin().addStep(new HasStep(this.asAdmin(), 
HasContainer.makeHasContainers(accessor.getAccessor(), (P) value))) :
-

[18/29] tinkerpop git commit: found an unuse field in TraversalRing and a minor optimization in StringFactory around using isEmpty() vs. size() == 0. CTR.

2016-11-16 Thread okram
found an unuse field in TraversalRing and a minor optimization in StringFactory 
around using isEmpty() vs. size() ==  0. CTR.


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

Branch: refs/heads/TINKERPOP-1502
Commit: c2462374ad9ff716d78216afd4a025f7fecf0f14
Parents: 5040b54
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 16:09:28 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Tue Nov 15 16:09:28 2016 -0700

--
 .../process/traversal/util/TraversalRing.java|  6 +-
 .../gremlin/structure/util/StringFactory.java| 19 +--
 2 files changed, 10 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2462374/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalRing.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalRing.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalRing.java
index d6d10c0..7500fc4 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalRing.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalRing.java
@@ -19,11 +19,9 @@
 package org.apache.tinkerpop.gremlin.process.traversal.util;
 
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.lambda.IdentityTraversal;
 
 import java.io.Serializable;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
@@ -32,12 +30,11 @@ import java.util.List;
  */
 public final class TraversalRing implements Serializable, Cloneable {
 
-private IdentityTraversal identityTraversal = new IdentityTraversal<>();
 private List> traversals = new ArrayList<>();
 private int currentTraversal = -1;
 
 public TraversalRing(final Traversal.Admin... traversals) {
-this.traversals = new ArrayList<>(Arrays.asList(traversals));
+Collections.addAll(this.traversals, traversals);
 }
 
 public Traversal.Admin next() {
@@ -79,7 +76,6 @@ public final class TraversalRing implements 
Serializable, Cloneable {
 try {
 final TraversalRing clone = (TraversalRing) 
super.clone();
 clone.traversals = new ArrayList<>();
-clone.identityTraversal = new IdentityTraversal<>();
 for (final Traversal.Admin traversal : this.traversals) {
 clone.addTraversal(traversal.clone());
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2462374/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/StringFactory.java
--
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 e129531..bcead2d 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
@@ -213,21 +213,20 @@ public final class StringFactory {
 final List strings = Stream.of(arguments)
 .filter(o -> null != o)
 .filter(o -> {
-if (o instanceof TraversalRing) {
-return ((TraversalRing) o).size() > 0;
-} else if (o instanceof Collection) {
-return ((Collection) o).size() > 0;
-} else if (o instanceof Map) {
-return ((Map) o).size() > 0;
-} else {
-return o.toString().length() > 0;
-}
+if (o instanceof TraversalRing)
+return !((TraversalRing) o).isEmpty();
+else if (o instanceof Collection)
+return !((Collection) o).isEmpty();
+else if (o instanceof Map)
+return !((Map) o).isEmpty();
+else
+return !o.toString().isEmpty();
 })
 .map(o -> {
 final String string = o.toString();
 return string.contains("$") ? "lambda" : string;

[29/29] tinkerpop git commit: more test cases around where().by(). all still good in the hood.

2016-11-16 Thread okram
more test cases around where().by(). all still good in the hood.


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

Branch: refs/heads/TINKERPOP-1502
Commit: 226633f32c483a3b2e67ad011a9664cc464f516f
Parents: 9323011
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 12:22:54 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 .../strategy/optimization/FilterRankingStrategyTest.java | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/226633f3/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
--
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
index 577e160..b32ae2a 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
@@ -108,6 +108,10 @@ public class FilterRankingStrategyTest {
 {filter(out()).dedup().has("value", 0), has("value", 
0).filter(out()).dedup(), Collections.emptyList()},
 {__.as("a").out().has("age").where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).has("age"), Collections.emptyList()},
 {__.as("a").out().has("age").where(P.eq("a")).by("age"), 
__.as("a").out().has("age").where(P.eq("a")).by("age"), 
Collections.emptyList()},
+{__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")).by("age"), __.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")).by("age"), Collections.emptyList()},
+{__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).and(has("age"), has("name")), 
Collections.emptyList()},
+{__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")).by("age"), 
__.as("a").out().has("age").has("name").where(P.eq("a")).by("age"), 
Collections.singletonList(InlineFilterStrategy.instance())},
+{__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).has("age").has("name"), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {has("value", 0).filter(out()).dedup(), has("value", 
0).filter(out()).dedup(), Collections.emptyList()},
 {has("value", 0).or(has("name"), has("age")).has("value", 
1).dedup(), has("value", 0).has("value", 1).or(has("name"), 
has("age")).dedup(), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {has("value", 0).or(out(), 
in()).as(Graph.Hidden.hide("x")).has("value", 1).dedup(), has("value", 
0).has("value", 1).or(outE(), inE()).dedup(), 
TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},



[27/29] tinkerpop git commit: fixed a FilterRankStrategy bug that was introduced with where().by(). Added test cases to verify behavior. Updated CHANGELOG.

2016-11-16 Thread okram
fixed a FilterRankStrategy bug that was introduced with where().by(). Added 
test cases to verify behavior. Updated CHANGELOG.


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

Branch: refs/heads/TINKERPOP-1502
Commit: 248ccc685720535e93b1b2ac3adc94443e697c68
Parents: 0d4ee56
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 12:10:22 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 CHANGELOG.asciidoc  |  5 +
 .../optimization/FilterRankingStrategy.java | 12 +++-
 .../optimization/FilterRankingStrategyTest.java |  3 +++
 .../traversal/step/filter/GroovyWhereTest.groovy|  5 +
 .../process/traversal/step/filter/WhereTest.java| 16 
 5 files changed, 36 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/248ccc68/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 7c4d41f..0613a39 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -27,6 +27,11 @@ TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~
 
 * Converted Spark process suite tests to "integration" tests.
+* Fixed a bug in `InlineFilterStrategy` having to do with folding 
`HasContainers` into `VertexStep`.
+* Deprecated `HasContainer.makeHasContainers()` which was used to dissect 
`AndP` and shouldn't be used at the TinkerPop-level.
+* `GraphTraversal.has()` now will try and fold-left `HasContainer` if end step 
is a `HasContainerHolder`.
+* Created explicit `P`-predicate methods for `GraphTraversal.hasXXX()`.
+* Fixed a bug in `FilterRankStrategy` around `where().by()` ordering.
 * Added another optimization in `RangeByIsCountStrategy`, that removes 
`count().is()` altogether if it's not needed.
 * Fixed a OLAP `MatchStep.clone()`-bug that occurs when the `match()` is in a 
local child.
 * Added another optimization in `RangeByIsCountStrategy`, that removes 
`count().is()` altogether if it's not needed.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/248ccc68/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
index 2f8061b..4ff485a 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
@@ -126,7 +126,7 @@ public final class FilterRankingStrategy extends 
AbstractTraversalStrategyhttp://git-wip-us.apache.org/repos/asf/tinkerpop/blob/248ccc68/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
--
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
index fbeeef5..577e160 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization;
 
+import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@ -105,6 +106,8 @@ public class FilterRankingStrategyTest {
 {__.dedup().has("value", 0).or(not(has("age")), has("age", 
10)).has("value", 1), __.has("value", 0).has("value", 1).or(not(has("age")), 
has("age", 10)).dedup(), 
Collections.singletonList(InlineFilterStrategy.instance())},
 

[17/29] tinkerpop git commit: Changed some spark-gremlin tests to integration tests.

2016-11-16 Thread okram
Changed some spark-gremlin tests to integration tests.

This change cuts the build time in about half on my system. Dicussed here 
https://lists.apache.org/thread.html/7a37a3967ad15e8cd30a2bc29e15bf266f44df040f482f94e09b1e8e@%3Cdev.tinkerpop.apache.org%3E
 CTR


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

Branch: refs/heads/TINKERPOP-1502
Commit: 5040b54449d0786f2e6a3127851fc42252162257
Parents: 64609a7
Author: Stephen Mallette 
Authored: Tue Nov 15 10:55:06 2016 -0500
Committer: Stephen Mallette 
Committed: Tue Nov 15 10:55:06 2016 -0500

--
 CHANGELOG.asciidoc  |   1 +
 .../SparkGraphComputerProcessIntegrateTest.java |  32 ++
 .../computer/SparkGraphComputerProcessTest.java |  32 --
 ...GraphComputerGroovyProcessIntegrateTest.java |  33 ++
 .../SparkGraphComputerGroovyProcessTest.java|  33 --
 .../PersistedInputOutputRDDIntegrateTest.java   | 358 +++
 .../io/PersistedInputOutputRDDTest.java | 358 ---
 7 files changed, 424 insertions(+), 423 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5040b544/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 3d963c9..7c4d41f 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ 
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~
 
+* Converted Spark process suite tests to "integration" tests.
 * Added another optimization in `RangeByIsCountStrategy`, that removes 
`count().is()` altogether if it's not needed.
 * Fixed a OLAP `MatchStep.clone()`-bug that occurs when the `match()` is in a 
local child.
 * Added another optimization in `RangeByIsCountStrategy`, that removes 
`count().is()` altogether if it's not needed.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5040b544/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputerProcessIntegrateTest.java
--
diff --git 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputerProcessIntegrateTest.java
 
b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputerProcessIntegrateTest.java
new file mode 100644
index 000..f38dcf5
--- /dev/null
+++ 
b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputerProcessIntegrateTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.spark.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 = SparkHadoopGraphProvider.class, graph = 
HadoopGraph.class)
+public class SparkGraphComputerProcessIntegrateTest {
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5040b544/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputerProcessTest.java
--
diff --git 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputerProcessTest.java
 
b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputerProcessTest.java
deleted file mode 100644
index 

[05/29] tinkerpop git commit: TINKERPOP-1538 Fixed broken test that needed to use TestClientFactory

2016-11-16 Thread okram
TINKERPOP-1538 Fixed broken test that needed to use TestClientFactory


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

Branch: refs/heads/TINKERPOP-1502
Commit: 18781cd3e370f1abbfb0f6d2ae481e272d0c03d4
Parents: 70570bd
Author: Stephen Mallette 
Authored: Mon Nov 14 18:40:44 2016 -0500
Committer: Stephen Mallette 
Committed: Mon Nov 14 18:49:28 2016 -0500

--
 .../tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/18781cd3/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
--
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 daf4df6..d51ff8d 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
@@ -734,7 +734,7 @@ public class GremlinDriverIntegrateTest extends 
AbstractGremlinServerIntegration
 
 @Test
 public void shouldWorkWithGraphSONExtendedV2Serialization() throws 
Exception {
-final Cluster cluster = 
Cluster.build("localhost").serializer(Serializers.GRAPHSON_V2D0).create();
+final Cluster cluster = 
TestClientFactory.build().serializer(Serializers.GRAPHSON_V2D0).create();
 final Client client = cluster.connect();
 
 final Instant now = Instant.now();



[02/29] tinkerpop git commit: TINKERPOP-1538 Use non-default port for gremlin server tests

2016-11-16 Thread okram
TINKERPOP-1538 Use non-default port for gremlin server tests

Used something other than 8182 to run the gremlin server tests to avoid port 
conflicts if gremlin server happens to be running in the background.


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

Branch: refs/heads/TINKERPOP-1502
Commit: 569753e3be41828887cdfa8085d4744ff955bb0d
Parents: 1e554ca
Author: Stephen Mallette 
Authored: Sun Nov 13 09:03:13 2016 -0500
Committer: Stephen Mallette 
Committed: Sun Nov 13 16:51:06 2016 -0500

--
 CHANGELOG.asciidoc  |  1 +
 .../src/main/java/Service.java  |  2 +-
 .../src/test/java/ServiceTest.java  |  2 +-
 .../src/test/resources/gremlin-server.yaml  |  2 +-
 .../plugin/gremlin-server-integration.yaml  |  2 +-
 .../gremlin/console/groovy/plugin/remote.yaml   |  2 +-
 .../AbstractGremlinServerPerformanceTest.java   |  2 +-
 .../server/GremlinAdditionPerformanceTest.java  |  2 +-
 .../server/GremlinDriverIntegrateTest.java  | 92 ++--
 .../server/GremlinResultSetIntegrateTest.java   |  2 +-
 .../server/GremlinServerAuthIntegrateTest.java  | 24 ++---
 .../GremlinServerAuthOldIntegrateTest.java  | 25 +++---
 .../server/GremlinServerHttpIntegrateTest.java  | 92 ++--
 .../server/GremlinServerIntegrateTest.java  | 66 +++---
 .../GremlinServerSessionIntegrateTest.java  | 17 ++--
 .../server/GremlinTraversalPerformanceTest.java |  2 +-
 .../gremlin/server/TestClientFactory.java   | 60 +
 .../server/gremlin-server-integration.yaml  |  2 +-
 .../server/gremlin-server-performance.yaml  |  2 +-
 19 files changed, 234 insertions(+), 165 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/569753e3/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index a8006d4..14ee66d 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -27,6 +27,7 @@ TinkerPop 3.1.6 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~
 
 * Returned a confirmation on session close from Gremlin Server.
+* Use non-default port for running tests on Gremlin Server.
 * Fully shutdown metrics services in Gremlin Server on shutdown.
 * Deprecated `tryRandomCommit()` in `AbstractGremlinTest` - the annotation was 
never added in 3.1.1, and was only deprecated via javadoc.
 * Minor fixes to various test feature requirements in `gremlin-test`.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/569753e3/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
--
diff --git 
a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
 
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
index b2e9de6..2561d39 100644
--- 
a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
+++ 
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
@@ -32,7 +32,7 @@ public class Service implements AutoCloseable {
 /**
  * There typically needs to be only one Cluster instance in an application.
  */
-private final Cluster cluster = Cluster.open();
+private final Cluster cluster = Cluster.build().port(45940).create();
 
 /**
  * Use the Cluster instance to construct different Client instances (e.g. 
one for sessionless communication

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/569753e3/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
--
diff --git 
a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
 
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
index 6f7d5c3..d888f46 100644
--- 
a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
+++ 
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
@@ -78,7 +78,7 @@ public class ServiceTest {
 
 @Test
 public void shouldCreateGraph() throws Exception {
-List 

[07/29] tinkerpop git commit: TINKERPOP-1538 Use non-default port for gremlin server tests

2016-11-16 Thread okram
TINKERPOP-1538 Use non-default port for gremlin server tests

Used something other than 8182 to run the gremlin server tests to avoid port 
conflicts if gremlin server happens to be running in the background.


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

Branch: refs/heads/TINKERPOP-1502
Commit: 83ac683266418343684f35300eb088af23143fcc
Parents: ad01fa1
Author: Stephen Mallette 
Authored: Sun Nov 13 09:03:13 2016 -0500
Committer: Stephen Mallette 
Committed: Mon Nov 14 18:49:28 2016 -0500

--
 CHANGELOG.asciidoc  |  1 +
 .../src/main/java/Service.java  |  2 +-
 .../src/test/java/ServiceTest.java  |  2 +-
 .../src/test/resources/gremlin-server.yaml  |  2 +-
 .../plugin/gremlin-server-integration.yaml  |  2 +-
 .../gremlin/console/groovy/plugin/remote.yaml   |  2 +-
 .../AbstractGremlinServerPerformanceTest.java   |  2 +-
 .../server/GremlinAdditionPerformanceTest.java  |  2 +-
 .../server/GremlinDriverIntegrateTest.java  | 94 ++--
 .../server/GremlinResultSetIntegrateTest.java   |  2 +-
 .../server/GremlinServerAuthIntegrateTest.java  | 24 ++---
 .../GremlinServerAuthOldIntegrateTest.java  | 25 +++---
 .../server/GremlinServerHttpIntegrateTest.java  | 92 +--
 .../server/GremlinServerIntegrateTest.java  | 68 +++---
 .../GremlinServerSessionIntegrateTest.java  | 17 ++--
 .../server/GremlinTraversalPerformanceTest.java |  2 +-
 .../gremlin/server/TestClientFactory.java   | 60 +
 .../server/gremlin-server-integration.yaml  |  2 +-
 .../server/gremlin-server-performance.yaml  |  2 +-
 19 files changed, 236 insertions(+), 167 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index ccbbc89..7041489 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -540,6 +540,7 @@ TinkerPop 3.1.6 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~
 
 * Returned a confirmation on session close from Gremlin Server.
+* Use non-default port for running tests on Gremlin Server.
 * Fully shutdown metrics services in Gremlin Server on shutdown.
 * Deprecated `tryRandomCommit()` in `AbstractGremlinTest` - the annotation was 
never added in 3.1.1, and was only deprecated via javadoc.
 * Minor fixes to various test feature requirements in `gremlin-test`.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
--
diff --git 
a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
 
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
index b2e9de6..2561d39 100644
--- 
a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
+++ 
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
@@ -32,7 +32,7 @@ public class Service implements AutoCloseable {
 /**
  * There typically needs to be only one Cluster instance in an application.
  */
-private final Cluster cluster = Cluster.open();
+private final Cluster cluster = Cluster.build().port(45940).create();
 
 /**
  * Use the Cluster instance to construct different Client instances (e.g. 
one for sessionless communication

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
--
diff --git 
a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
 
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
index 6f7d5c3..d888f46 100644
--- 
a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
+++ 
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
@@ -78,7 +78,7 @@ public class ServiceTest {
 
 @Test
 public void shouldCreateGraph() throws Exception {
-List 

[20/29] tinkerpop git commit: found a bug in HasContainer.makeHasContainers() around AndP recurssion. No biggie, just didn't yield ultimate optimization. Found a bug in InlineFilterStrategy where hasL

2016-11-16 Thread okram
found a bug in HasContainer.makeHasContainers() around AndP recurssion. No 
biggie, just didn't yield ultimate optimization. Found a bug in 
InlineFilterStrategy where hasLabel() should only back propagate into 
VertexStep[edges] if the step doesn't already have edge labels. Removed 
HasContainer.makeHasContainers() -- another ticket I'm putting into this 
branch. GraphTraversal.has() is fixed up accordingly with left-fold 
HasContainers and valid Object[] usage. Going to add a few more tests around 
hasXXX() steps.


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

Branch: refs/heads/TINKERPOP-1502
Commit: 4a316c55c3ab1e42ef6568689cadbca0e2fb9ed8
Parents: ffe1b4c
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 08:27:24 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:43:45 2016 -0700

--
 .../upgrade/release-3.2.x-incubating.asciidoc   | 22 +++
 .../traversal/dsl/graph/GraphTraversal.java | 29 
 .../traversal/step/util/HasContainer.java   | 26 ++
 .../optimization/InlineFilterStrategy.java  | 20 +-
 .../optimization/FilterRankingStrategyTest.java | 18 ++--
 .../optimization/InlineFilterStrategyTest.java  | 11 +---
 .../step/sideEffect/Neo4jGraphStep.java | 11 ++--
 .../Neo4jGraphStepStrategyTest.java |  6 ++--
 .../step/sideEffect/TinkerGraphStep.java|  9 +-
 .../TinkerGraphStepStrategyTest.java|  4 +--
 10 files changed, 111 insertions(+), 45 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4a316c55/docs/src/upgrade/release-3.2.x-incubating.asciidoc
--
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc 
b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 8574b88..0fd7498 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -61,6 +61,28 @@ Upgrading for Providers
 Graph Database Providers
 
 
+HasContainer AndP Splitting

+
+Previously, `GraphTraversal` made it easy for providers to analyze 
`P`-predicates in `HasContainers`, but always
+splitting `AndP` predicates into their component parts. This helper behavior 
is no longer provided because,
+1.) `AndP` can be inserted into a `XXXStep` in other ways, 2.) the providers 
`XXXStep` should process `AndP`
+regardless of `GraphTraversal` helper, and 3.) the `GraphTraversal` helper did 
not recursively split.
+A simple way to split `AndP` in any custom `XXXStep` that implements 
`HasContainerHolder` is to use the following method:
+
+[source,java]
+
+@Override
+public void addHasContainer(final HasContainer hasContainer) {
+  if (hasContainer.getPredicate() instanceof AndP) {
+for (final P predicate : ((AndP) 
hasContainer.getPredicate()).getPredicates()) {
+  this.addHasContainer(new HasContainer(hasContainer.getKey(), predicate));
+}
+  } else
+this.hasContainers.add(hasContainer);
+}
+
+
 Duplicate Multi-Properties
 ++
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4a316c55/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
--
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 d8f7888..fae2d67 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
@@ -148,7 +148,6 @@ import 
org.apache.tinkerpop.gremlin.util.function.ConstantSupplier;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
@@ -926,8 +925,14 @@ public interface GraphTraversal extends Traversal {
 }
 
 public default GraphTraversal has(final T accessor, final Object 
value) {
-this.asAdmin().getBytecode().addStep(Symbols.has, accessor, value);
-return TraversalHelper.addHasContainer(this.asAdmin(), new 
HasContainer(accessor.getAccessor(), value instanceof P ? (P) value : 
P.eq(value)));
+if (value 

[15/29] tinkerpop git commit: Merge branch 'TINKERPOP-1538-tp32' into tp32

2016-11-16 Thread okram
Merge branch 'TINKERPOP-1538-tp32' into tp32


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

Branch: refs/heads/TINKERPOP-1502
Commit: bc4e0905c6c9d53d991066650041288c05ffbebc
Parents: 02f1664 b803dce
Author: Stephen Mallette 
Authored: Tue Nov 15 09:34:53 2016 -0500
Committer: Stephen Mallette 
Committed: Tue Nov 15 09:34:53 2016 -0500

--
 CHANGELOG.asciidoc  |  2 +
 .../src/main/java/Service.java  |  2 +-
 .../src/test/java/ServiceTest.java  |  2 +-
 .../src/test/resources/gremlin-server.yaml  |  2 +-
 .../plugin/gremlin-server-integration.yaml  |  2 +-
 .../gremlin/console/groovy/plugin/remote.yaml   |  2 +-
 .../driver/remote/DriverRemoteConnection.java   |  6 +-
 gremlin-python/pom.xml  |  7 +-
 .../driver/test_driver_remote_connection.py | 12 +--
 .../driver/gremlin-server-modern-secure-py.yaml |  4 +-
 .../driver/remote/RemoteGraphProvider.java  |  5 +-
 .../AbstractGremlinServerPerformanceTest.java   |  2 +-
 .../server/GremlinAdditionPerformanceTest.java  |  2 +-
 .../server/GremlinDriverIntegrateTest.java  | 98 ++--
 .../server/GremlinResultSetIntegrateTest.java   |  4 +-
 .../server/GremlinServerAuthIntegrateTest.java  | 24 +++--
 .../GremlinServerAuthOldIntegrateTest.java  | 25 ++---
 .../server/GremlinServerHttpIntegrateTest.java  | 94 +--
 .../server/GremlinServerIntegrateTest.java  | 74 ---
 .../GremlinServerSessionIntegrateTest.java  | 22 ++---
 .../server/GremlinTraversalPerformanceTest.java |  2 +-
 .../gremlin/server/TestClientFactory.java   | 60 
 .../remote/gremlin-server-integration.yaml  |  2 +-
 .../server/gremlin-server-integration.yaml  |  2 +-
 .../server/gremlin-server-performance.yaml  |  2 +-
 25 files changed, 266 insertions(+), 193 deletions(-)
--




[25/29] tinkerpop git commit: caught another bug in FilterRankStrategy. We really need to get the max rank of the traversal parent's nested steps. Effects AndStep, OrStep, WhereTraversalStep, WherePre

2016-11-16 Thread okram
caught another bug in FilterRankStrategy. We really need to get the max rank of 
the traversal parent's nested steps. Effects AndStep, OrStep, 
WhereTraversalStep, WherePredicateStep, DedupStep, OrderStep. This ensures that 
filter(where().by()) isn't pushed forward cause its wrapped in filter().


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

Branch: refs/heads/TINKERPOP-1502
Commit: 997e94fb489afc10cc9bcfc6c92106f021ca1045
Parents: 226633f
Author: Marko A. Rodriguez 
Authored: Tue Nov 15 13:46:44 2016 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Nov 16 05:44:18 2016 -0700

--
 .../optimization/FilterRankingStrategy.java | 41 ++--
 .../optimization/FilterRankingStrategyTest.java |  4 +-
 2 files changed, 33 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/997e94fb/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
index 15040f7..3649615 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
@@ -120,32 +120,51 @@ public final class FilterRankingStrategy extends 
AbstractTraversalStrategy traversal : 
parent.getLocalChildren()) {
+for (final Step step : traversal.getSteps()) {
+final int stepRank = getStepRank(step);
+if (stepRank > maxStepRank)
+maxStepRank = stepRank;
+}
+}
+return maxStepRank;
 }
 
 private static boolean usesLabels(final Step step, final Set 
labels) {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/997e94fb/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
--
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
index b32ae2a..11f390b 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
@@ -112,10 +112,12 @@ public class FilterRankingStrategyTest {
 {__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).and(has("age"), has("name")), 
Collections.emptyList()},
 {__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")).by("age"), 
__.as("a").out().has("age").has("name").where(P.eq("a")).by("age"), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {__.as("a").out().and(has("age"), 
has("name")).where(P.eq("a")), 
__.as("a").out().where(P.eq("a")).has("age").has("name"), 
Collections.singletonList(InlineFilterStrategy.instance())},
+{__.as("a").out().and(has("age"), 
has("name")).filter(__.where(P.eq("a"))), 
__.as("a").out().where(P.eq("a")).has("age").has("name"), 
Collections.singletonList(InlineFilterStrategy.instance())},
+{__.as("a").out().and(has("age"), 
has("name")).filter(__.where(P.eq("a")).by("age")), 
__.as("a").out().has("age").has("name").where(P.eq("a")).by("age"), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {has("value", 0).filter(out()).dedup(), has("value", 
0).filter(out()).dedup(), Collections.emptyList()},
 {has("value", 0).or(has("name"), has("age")).has("value", 
1).dedup(), has("value", 0).has("value", 1).or(has("name"), 
has("age")).dedup(), 
Collections.singletonList(InlineFilterStrategy.instance())},
 {has("value", 0).or(out(), 
in()).as(Graph.Hidden.hide("x")).has("value", 1).dedup(), has("value", 
0).has("value", 1).or(outE(), inE()).dedup(), 

[09/29] tinkerpop git commit: TINKERPOP-1538 Fixed up test logic after merge.

2016-11-16 Thread okram
TINKERPOP-1538 Fixed up test logic after merge.


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

Branch: refs/heads/TINKERPOP-1502
Commit: b803dce99bc31339410d3b60857d3364cb788d7a
Parents: 18781cd
Author: Stephen Mallette 
Authored: Mon Nov 14 18:50:59 2016 -0500
Committer: Stephen Mallette 
Committed: Mon Nov 14 18:50:59 2016 -0500

--
 .../tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java   | 2 +-
 .../gremlin/server/GremlinServerSessionIntegrateTest.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b803dce9/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
--
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 d51ff8d..a8164b5 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
@@ -178,7 +178,7 @@ public class GremlinDriverIntegrateTest extends 
AbstractGremlinServerIntegration
 public void shouldKeepAliveForWebSockets() throws Exception {
 // keep the connection pool size at 1 to remove the possibility of 
lots of connections trying to ping which will
 // complicate the assertion logic
-final Cluster cluster = Cluster.build().
+final Cluster cluster = TestClientFactory.build().
 minConnectionPoolSize(1).
 maxConnectionPoolSize(1).
 keepAliveInterval(1000).create();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b803dce9/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
--
diff --git 
a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
 
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
index 434bda8..6b89f53 100644
--- 
a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
+++ 
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
@@ -127,7 +127,7 @@ public class GremlinServerSessionIntegrateTest  extends 
AbstractGremlinServerInt
 final Cluster cluster1 = TestClientFactory.open();
 final Client client1 = cluster1.connect(name.getMethodName());
 client1.submit("graph.addVertex()").all().join();
-final Cluster cluster2 = TestClientFactory.open()
+final Cluster cluster2 = TestClientFactory.open();
 final Client client2 = cluster2.connect(name.getMethodName());
 client2.submit("1+1").all().join();
 



[06/29] tinkerpop git commit: TINKERPOP-1538 Use non-default port for gremlin server tests

2016-11-16 Thread okram
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83ac6832/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
--
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 15db36d..7240509 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
@@ -40,7 +40,6 @@ import 
org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteTraversalSideEffec
 import org.apache.tinkerpop.gremlin.driver.ser.Serializers;
 import org.apache.tinkerpop.gremlin.driver.simple.NioClient;
 import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient;
-import org.apache.tinkerpop.gremlin.driver.simple.WebSocketClient;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
 import 
org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.CompileStaticCustomizerProvider;
 import 
org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ConfigurationCustomizerProvider;
@@ -163,7 +162,10 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
 settings.ssl.overrideSslContext(createServerSslContext());
 break;
 case "shouldStartWithDefaultSettings":
-return new Settings();
+// test with defaults exception for port because we want to 
keep testing off of 8182
+final Settings defaultSettings = new Settings();
+defaultSettings.port = TestClientFactory.PORT;
+return settings;
 case "shouldUseSimpleSandbox":
 settings.scriptEngines.get("gremlin-groovy").config = 
getScriptEngineConfForSimpleSandbox();
 break;
@@ -237,7 +239,7 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
 
 @Test
 public void shouldUseBaseScript() throws Exception {
-final Cluster cluster = Cluster.open();
+final Cluster cluster = TestClientFactory.open();
 final Client client = cluster.connect(name.getMethodName());
 
 assertEquals("hello, stephen", 
client.submit("hello('stephen')").all().get().get(0).getString());
@@ -247,7 +249,7 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
 
 @Test
 public void shouldUseInterpreterMode() throws Exception {
-final Cluster cluster = Cluster.open();
+final Cluster cluster = TestClientFactory.open();
 final Client client = cluster.connect(name.getMethodName());
 
 client.submit("def subtractAway(x,y){x-y};[]").all().get();
@@ -269,7 +271,7 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
 
 @Test
 public void shouldNotUseInterpreterMode() throws Exception {
-final Cluster cluster = Cluster.open();
+final Cluster cluster = TestClientFactory.open();
 final Client client = cluster.connect(name.getMethodName());
 
 client.submit("def subtractAway(x,y){x-y};[]").all().get();
@@ -291,7 +293,7 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
 
 @Test
 public void shouldUseSimpleSandbox() throws Exception {
-final Cluster cluster = Cluster.open();
+final Cluster cluster = TestClientFactory.open();
 final Client client = cluster.connect();
 
 assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
@@ -311,7 +313,7 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
 public void shouldStartWithDefaultSettings() {
 // just quickly validate that results are returning given defaults. no 
graphs are config'd with defaults
 // so just eval a groovy script.
-final Cluster cluster = Cluster.open();
+final Cluster cluster = TestClientFactory.open();
 final Client client = cluster.connect();
 
 final ResultSet results = client.submit("[1,2,3,4,5,6,7,8,9]");
@@ -323,7 +325,7 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
 
 @Test
 public void shouldEnableSsl() {
-final Cluster cluster = Cluster.build().enableSsl(true).create();
+final Cluster cluster = 
TestClientFactory.build().enableSsl(true).create();
 final Client client = cluster.connect();
 
 try {
@@ -341,7 +343,7 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
 builder.trustManager(InsecureTrustManagerFactory.INSTANCE);
 builder.sslProvider(SslProvider.JDK);
 
-final Cluster cluster =