You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2015/05/13 22:58:20 UTC
incubator-tinkerpop git commit: GroovyBranchTest test was the right
synxtax -- fixed. ComputerVerificationStrategy is now aware of Java8 lambdas.
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/master b6a270de2 -> 2e62d5b82
GroovyBranchTest test was the right synxtax -- fixed. ComputerVerificationStrategy is now aware of Java8 lambdas.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/2e62d5b8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/2e62d5b8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/2e62d5b8
Branch: refs/heads/master
Commit: 2e62d5b824513a837626536d2a3875f89326b9ad
Parents: b6a270d
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed May 13 14:58:12 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed May 13 14:58:12 2015 -0600
----------------------------------------------------------------------
.../strategy/verification/ComputerVerificationStrategy.java | 3 ++-
.../process/traversal/step/branch/GroovyBranchTest.groovy | 8 ++++----
2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2e62d5b8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
index 8e26a5d..a436e6c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
@@ -77,7 +77,8 @@ public final class ComputerVerificationStrategy extends AbstractTraversalStrateg
try {
Serializer.serializeObject(traversal);
} catch (final IOException e) {
- throw new ComputerVerificationException("The provided traversal is not serializable and thus, can not be distributed across a cluster", traversal);
+ if (e.getMessage().contains("$$Lambda")) // java8 lambda which is unserializable
+ throw new ComputerVerificationException("The provided traversal contains a Java8 lambda which is not serializable and can not be distributed across a cluster", traversal);
}
////
if (!(traversal.getStartStep() instanceof GraphStep))
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2e62d5b8/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyBranchTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyBranchTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyBranchTest.groovy
index e31418d..8f41d26 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyBranchTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyBranchTest.groovy
@@ -37,10 +37,10 @@ public abstract class GroovyBranchTest {
@Override
public Traversal<Vertex, Object> get_g_V_branchXlabelX_optionXperson__ageX_optionXsoftware__langX_optionXsoftware__nameX() {
TraversalScriptHelper.compute("""
- g.V.branch(__.label)
- .option('person', __.age)
- .option('software', __.lang)
- .option('software', __.name)
+ g.V.branch{it.get().label() == 'person' ? 'a' : 'b'}
+ .option('a', __.age)
+ .option('b', __.lang)
+ .option('b', __.name)
""", g)
}
}