You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/03/27 16:14:01 UTC
[1/4] incubator-tinkerpop git commit: Add ReadOnlyStrategy to the
default import customizer.
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/master 2e2639748 -> 08a916c25
Add ReadOnlyStrategy to the default import customizer.
It is now accessible in the console/script engine.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/bdf654fc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/bdf654fc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/bdf654fc
Branch: refs/heads/master
Commit: bdf654fcb14e3bf0998948baa7f8004d6a34c38b
Parents: 354afb6
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Mar 27 10:56:47 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Mar 27 10:56:47 2015 -0400
----------------------------------------------------------------------
.../tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bdf654fc/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
index a48dffb..32ba659 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
@@ -39,6 +39,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent
import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMetrics;
import org.apache.tinkerpop.gremlin.structure.Compare;
import org.apache.tinkerpop.gremlin.structure.Contains;
@@ -90,6 +91,7 @@ public abstract class AbstractImportCustomizerProvider implements ImportCustomiz
imports.add(GraphTraversal.class.getPackage().getName() + DOT_STAR);
imports.add(ComputerTraversalEngine.class.getPackage().getName() + DOT_STAR);
imports.add(PartitionStrategy.class.getPackage().getName() + DOT_STAR); // decoration strategies
+ imports.add(ReadOnlyStrategy.class.getPackage().getName() + DOT_STAR); // verification strategies
imports.add(Event.class.getPackage().getName() + DOT_STAR); // eventing
staticImports.add(__.class.getCanonicalName() + DOT_STAR);
staticImports.add(TraversalOptionParent.Pick.class.getCanonicalName() + DOT_STAR);
[4/4] incubator-tinkerpop git commit: Merge remote-tracking branch
'origin/master'
Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/master'
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/08a916c2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/08a916c2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/08a916c2
Branch: refs/heads/master
Commit: 08a916c25449a5455035571c6b376783d66ddaea
Parents: 444b798 2e26397
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Mar 27 11:13:51 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Mar 27 11:13:51 2015 -0400
----------------------------------------------------------------------
docs/src/acknowledgements.asciidoc | 2 +
docs/src/index.asciidoc | 2 -
docs/src/tinkerpop-contributors.asciidoc | 65 -------------------
docs/static/images/arangodb-logo.png | Bin 27024 -> 0 bytes
docs/static/images/aurelius-logo.png | Bin 43320 -> 0 bytes
docs/static/images/bigdata-logo.png | Bin 7813 -> 0 bytes
docs/static/images/clark-and-parsia-logo.png | Bin 8822 -> 0 bytes
docs/static/images/foundationdb-logo.png | Bin 33395 -> 0 bytes
docs/static/images/jhapl-logo.png | Bin 4652 -> 0 bytes
docs/static/images/lambda-zen-logo.png | Bin 24940 -> 0 bytes
docs/static/images/neotechnology-logo.png | Bin 11800 -> 0 bytes
docs/static/images/objectivity-logo.png | Bin 69054 -> 0 bytes
docs/static/images/orientechnologies-logo.png | Bin 2955 -> 0 bytes
.../images/sparsity-technologies-logo.png | Bin 80863 -> 0 bytes
14 files changed, 2 insertions(+), 67 deletions(-)
----------------------------------------------------------------------
[3/4] incubator-tinkerpop git commit: Add docs for ReadOnlyStrategy.
Posted by sp...@apache.org.
Add docs for ReadOnlyStrategy.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/444b7988
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/444b7988
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/444b7988
Branch: refs/heads/master
Commit: 444b7988fffc35361a492ab8fa842eab4a7d13ee
Parents: 10943e4
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Mar 27 11:13:07 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Mar 27 11:13:07 2015 -0400
----------------------------------------------------------------------
docs/src/the-traversal.asciidoc | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/444b7988/docs/src/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/the-traversal.asciidoc b/docs/src/the-traversal.asciidoc
index 29084b2..a517f23 100644
--- a/docs/src/the-traversal.asciidoc
+++ b/docs/src/the-traversal.asciidoc
@@ -1656,6 +1656,11 @@ gB.V()
By writing elements to particular partitions and then restricting read partitions, the developer is able to create multiple graphs within a single address space. Moreover, by supporting references between partitions, it is possible to merge those multiple graphs (i.e. join partitions).
+ReadOnlyStrategy
+================
+
+`ReadOnlyStrategy` is largely self-explanatory. A `Traversal` that has this strategy applied will throw an `IllegalStateException` if the `Traversal` has any mutating steps within it.
+
Domain Specific Languages
-------------------------
[2/4] incubator-tinkerpop git commit: ReadOnlyStrategy was not
checking for all Mutating steps.
Posted by sp...@apache.org.
ReadOnlyStrategy was not checking for all Mutating steps.
Added tests in support of all Mutating steps.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/10943e42
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/10943e42
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/10943e42
Branch: refs/heads/master
Commit: 10943e4206c861a58b5ff2795bdddaa459673d83
Parents: bdf654f
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Mar 27 11:03:04 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Mar 27 11:03:04 2015 -0400
----------------------------------------------------------------------
.../traversal/strategy/verification/ReadOnlyStrategy.java | 6 ++++--
.../strategy/verification/ReadOnlyStrategyTest.java | 9 ++++++++-
2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/10943e42/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategy.java
index 05acda1..0718953 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategy.java
@@ -19,11 +19,13 @@
package org.apache.tinkerpop.gremlin.process.traversal.strategy.verification;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddEdgeByPathStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
/**
+ * Detects steps marked with {@link Mutating} and throw an {@link IllegalStateException} if one is found.
+ *
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
public final class ReadOnlyStrategy extends AbstractTraversalStrategy {
@@ -35,7 +37,7 @@ public final class ReadOnlyStrategy extends AbstractTraversalStrategy {
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
- if (traversal.getSteps().stream().filter(step -> step instanceof AddEdgeByPathStep).findAny().isPresent())
+ if (traversal.getSteps().stream().anyMatch(step -> step instanceof Mutating))
throw new IllegalStateException("The provided traversal has a mutating step and thus is not read only");
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/10943e42/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategyTest.java
index d66283c..5974e37 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategyTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategyTest.java
@@ -22,6 +22,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy;
import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
@@ -46,7 +47,13 @@ public class ReadOnlyStrategyTest {
{"addE(IN)", __.addE(Direction.IN, "test", "test")},
{"addE(IN,args)", __.addE(Direction.IN, "test", "test", "this", "that")},
{"addE(OUT)", __.addE(Direction.OUT, "test", "test")},
- {"addE(OUT,args)", __.addE(Direction.OUT, "test", "test", "this", "that")}});
+ {"addE(OUT,args)", __.addE(Direction.OUT, "test", "test", "this", "that")},
+ {"outE().property(k,v)", __.outE().property("test", "test")},
+ {"out().properties(k).property(k,v)", __.out().properties("test").property("test", "that")},
+ {"out().property(k,v)", __.out().property("test", "test")},
+ {"out().property(Cardinality,k,v)", __.out().property(VertexProperty.Cardinality.list, "test", "test")},
+ {"addV(args)", __.addV("test", "test", "this", "that")},
+ {"addV()", __.addV()}});
}
@Parameterized.Parameter(value = 0)