[tinkerpop] branch tp4 updated: minor clean up. done for the day. parallel() will have to wait. have it about 75% working.
This is an automated email from the ASF dual-hosted git repository. okram pushed a commit to branch tp4 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git The following commit(s) were added to refs/heads/tp4 by this push: new a3e2023 minor clean up. done for the day. parallel() will have to wait. have it about 75% working. a3e2023 is described below commit a3e2023279bbea1e059d74e18fa6376ea99c9c26 Author: Marko A. Rodriguez AuthorDate: Wed Apr 3 15:22:34 2019 -0600 minor clean up. done for the day. parallel() will have to wait. have it about 75% working. --- .../main/java/org/apache/tinkerpop/machine/processor/rxjava/RxJava.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/RxJava.java b/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/RxJava.java index cd81390..b665b41 100644 --- a/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/RxJava.java +++ b/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/RxJava.java @@ -69,7 +69,7 @@ public final class RxJava implements Processor { private void prepareFlow() { if (!this.executed) { this.executed = true; -TopologyUtil.compile(Flowable.fromIterable(this.starts), compilation). +TopologyUtil.compile(Flowable.fromIterable(this.starts), this.compilation). doOnNext(this.ends::add). doOnComplete(() -> this.alive.set(Boolean.FALSE)). subscribe();
[tinkerpop] branch tp4 updated: was able to use TopologyUtil.compile() instead of Flowable.publish() to chain flows in rxJava.
This is an automated email from the ASF dual-hosted git repository. okram pushed a commit to branch tp4 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git The following commit(s) were added to refs/heads/tp4 by this push: new b46ffb1 was able to use TopologyUtil.compile() instead of Flowable.publish() to chain flows in rxJava. b46ffb1 is described below commit b46ffb10a8b2a7c0f4107900c822023159826faf Author: Marko A. Rodriguez AuthorDate: Wed Apr 3 15:07:56 2019 -0600 was able to use TopologyUtil.compile() instead of Flowable.publish() to chain flows in rxJava. --- .../tinkerpop/machine/processor/rxjava/util/TopologyUtil.java| 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/util/TopologyUtil.java b/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/util/TopologyUtil.java index a9bee79..71b95bd 100644 --- a/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/util/TopologyUtil.java +++ b/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/util/TopologyUtil.java @@ -77,11 +77,10 @@ public final class TopologyUtil { for (int i = 0; i < branches.getValue().size(); i++) { final Compilation branch = branches.getValue().get(i); final int id = i; -branchFlows.add( -selectorFlow. +branchFlows.add(compile(selectorFlow. filter(list -> list.get(0).equals(null == branches.getKey() ? -1 : id)). -map(list -> (Traverser) list.get(1)). -publish(f -> compile(f, branch))); +map(list -> (Traverser) list.get(1)), +branch)); } } Flowable> sink = (Flowable) flow.filter(t -> false); // branches are the only outputs @@ -117,7 +116,7 @@ public final class TopologyUtil { return list; }); outputs.add(selectorFlow.filter(list -> list.get(0).equals(0)).map(list -> (Traverser) list.get(1))); -flow = selectorFlow.filter(list -> list.get(0).equals(1)).map(list -> (Traverser) list.get(1)).publish(f -> compile(f, repeatBranch.getRepeat())); +flow = compile(selectorFlow.filter(list -> list.get(0).equals(1)).map(list -> (Traverser) list.get(1)), repeatBranch.getRepeat()); selectorFlow = flow.flatMapIterable(t -> { final List list = new ArrayList<>(); if (repeatBranch.hasEndPredicates()) {
[tinkerpop] branch tp4 updated: fixed a bug where repeat loops weren't being updated in RxJava.
This is an automated email from the ASF dual-hosted git repository. okram pushed a commit to branch tp4 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git The following commit(s) were added to refs/heads/tp4 by this push: new b01672b fixed a bug where repeat loops weren't being updated in RxJava. b01672b is described below commit b01672b067195df27f17755ebb56d0d16e00e8d5 Author: Marko A. Rodriguez AuthorDate: Wed Apr 3 15:04:14 2019 -0600 fixed a bug where repeat loops weren't being updated in RxJava. --- .../tinkerpop/machine/processor/rxjava/util/TopologyUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/util/TopologyUtil.java b/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/util/TopologyUtil.java index 4146623..a9bee79 100644 --- a/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/util/TopologyUtil.java +++ b/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/util/TopologyUtil.java @@ -126,16 +126,16 @@ public final class TopologyUtil { list.add(List.of(0, t.repeatDone(repeatBranch))); } else if (4 == repeatBranch.getEmitLocation() && repeatBranch.getEmit().filterTraverser(t)) { list.add(List.of(0, t.repeatDone(repeatBranch))); -list.add(List.of(1, t)); +list.add(List.of(1, t.repeatLoop(repeatBranch))); } else -list.add(List.of(1, t)); +list.add(List.of(1, t.repeatLoop(repeatBranch))); } else if (3 == repeatBranch.getEmitLocation()) { if (repeatBranch.getEmit().filterTraverser(t)) list.add(List.of(0, t.repeatDone(repeatBranch))); if (4 == repeatBranch.getUntilLocation() && repeatBranch.getUntil().filterTraverser(t)) list.add(List.of(0, t.repeatDone(repeatBranch))); else -list.add(List.of(1, t)); +list.add(List.of(1, t.repeatLoop(repeatBranch))); } } else list.add(List.of(1, t.repeatLoop(repeatBranch)));
[tinkerpop] branch TINKERPOP-2181 updated (ecced7b -> db335da)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch TINKERPOP-2181 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git. discard ecced7b TINKERPOP-2181 Allow ctrl+c to break a command in Gremlin Console new 9334272 TINKERPOP-2180: Make sure user.working_dir is still respected properly new db335da TINKERPOP-2181 Allow ctrl+c to break a command in Gremlin Console This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (ecced7b) \ N -- N -- N refs/heads/TINKERPOP-2181 (db335da) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 14078 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: gremlin-console/src/main/bin/gremlin.sh | 13 + 1 file changed, 9 insertions(+), 4 deletions(-)
[GitHub] [tinkerpop] spmallette commented on a change in pull request #1087: TINKERPOP-2191 Implement EdgeLabelVerificationStrategy
spmallette commented on a change in pull request #1087: TINKERPOP-2191 Implement EdgeLabelVerificationStrategy URL: https://github.com/apache/tinkerpop/pull/1087#discussion_r271913920 ## File path: docs/src/upgrade/release-3.3.x.asciidoc ## @@ -27,6 +27,44 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima Please see the link:https://github.com/apache/tinkerpop/blob/3.3.7/CHANGELOG.asciidoc#release-3-3-7[changelog] for a complete list of all the modifications that are part of this release. +=== Upgrading for Providers + + Detection of Anti-Patterns + +This release adds a strategy named `EdgeLabelVerificationStrategy`. The strategy will not be added by default to the traversal source, however, providers can add it explicitly to encourage (or enforce) +users to always specify at least one edge label. `EdgeLabelVerificationStrategy` can be configured to either throw an exception if no edge label was specified, log a warning or do both. + +[source,text] + +gremlin> // throw an exception if edge label was not specified +gremlin> g = TinkerFactory.createModern().traversal().withStrategies(EdgeLabelVerificationStrategy.build().throwException().create()) +==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard] +gremlin> g.V(1).out('knows') +==>v[2] +==>v[4] +gremlin> g.V(1).out() +The provided traversal contains a vertex step without any specified edge label: VertexStep(OUT,vertex) +Type ':help' or ':h' for help. +Display stack trace? [yN] + + +[source,text] + +gremlin> // log a warning if edge label was not specified (Log4j has to be configured properly) +gremlin> g = TinkerFactory.createModern().traversal().withStrategies(EdgeLabelVerificationStrategy.build().logWarning().create()) Review comment: `logWarning()` is good - nice This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [tinkerpop] spmallette commented on a change in pull request #1087: TINKERPOP-2191 Implement EdgeLabelVerificationStrategy
spmallette commented on a change in pull request #1087: TINKERPOP-2191 Implement EdgeLabelVerificationStrategy URL: https://github.com/apache/tinkerpop/pull/1087#discussion_r271913768 ## File path: docs/src/upgrade/release-3.3.x.asciidoc ## @@ -27,6 +27,44 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima Please see the link:https://github.com/apache/tinkerpop/blob/3.3.7/CHANGELOG.asciidoc#release-3-3-7[changelog] for a complete list of all the modifications that are part of this release. +=== Upgrading for Providers + + Detection of Anti-Patterns + +This release adds a strategy named `EdgeLabelVerificationStrategy`. The strategy will not be added by default to the traversal source, however, providers can add it explicitly to encourage (or enforce) +users to always specify at least one edge label. `EdgeLabelVerificationStrategy` can be configured to either throw an exception if no edge label was specified, log a warning or do both. + +[source,text] + +gremlin> // throw an exception if edge label was not specified +gremlin> g = TinkerFactory.createModern().traversal().withStrategies(EdgeLabelVerificationStrategy.build().throwException().create()) +==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard] +gremlin> g.V(1).out('knows') +==>v[2] +==>v[4] +gremlin> g.V(1).out() +The provided traversal contains a vertex step without any specified edge label: VertexStep(OUT,vertex) Review comment: This is good. A couple of questions: 1. Can the message get any more helpful somehow? Maybe it should say more about "why" this is important? Just a suggestion: "Always specify edge labels which restrict traversal paths ensuring optimal performance - the following steps need edge labels: VertexStep(OUT,vertex)". 2. I guess my second question relates to my message - It looks like the strategy throws the exception as soon as it runs into a problem. Would it be better to collect all the problems at once and report them in batch for fixing? 3. I don't suppose we have a way to convert "VertexStep(OUT,vertex)` to simple `out()` do we? Maybe `GroovyTranslator` somehow? would be nice to actually somehow show the user exactly where they messed up in code rather than the `Step` representation, but perhaps that's not possible. I sorta think `profile()` would be more user friendly that way if it could be done. Maybe not something for this PR, but just something to think about. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [tinkerpop] spmallette opened a new pull request #1090: TINKERPOP-2182 Removed gperfutils dependencies in Console
spmallette opened a new pull request #1090: TINKERPOP-2182 Removed gperfutils dependencies in Console URL: https://github.com/apache/tinkerpop/pull/1090 https://issues.apache.org/jira/browse/TINKERPOP-2182 Pretty straightforward. Made sure that the upgrade docs explained how to continue to use this feature if that is needed. All tests pass with `docker/build.sh -t -i` VOTE +1 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[tinkerpop] branch tp4 updated: got repeat() working.
This is an automated email from the ASF dual-hosted git repository. okram pushed a commit to branch tp4 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git The following commit(s) were added to refs/heads/tp4 by this push: new c7ee5a0 got repeat() working. c7ee5a0 is described below commit c7ee5a0c93f8f54509a2c82971ae6c108f2caec8 Author: Marko A. Rodriguez AuthorDate: Wed Apr 3 13:36:10 2019 -0600 got repeat() working. --- .../processor/rxjava/util/TopologyUtil.java| 91 +++--- .../machine/processor/rxjava/RxJavaTest.java | 83 +++- 2 files changed, 143 insertions(+), 31 deletions(-) diff --git a/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/util/TopologyUtil.java b/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/util/TopologyUtil.java index b6b0e4a..4146623 100644 --- a/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/util/TopologyUtil.java +++ b/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/util/TopologyUtil.java @@ -27,6 +27,7 @@ import org.apache.tinkerpop.machine.function.FlatMapFunction; import org.apache.tinkerpop.machine.function.InitialFunction; import org.apache.tinkerpop.machine.function.MapFunction; import org.apache.tinkerpop.machine.function.ReduceFunction; +import org.apache.tinkerpop.machine.function.branch.RepeatBranch; import org.apache.tinkerpop.machine.processor.rxjava.BranchFlow; import org.apache.tinkerpop.machine.processor.rxjava.FilterFlow; import org.apache.tinkerpop.machine.processor.rxjava.FlatMapFlow; @@ -46,6 +47,8 @@ import java.util.Map; */ public final class TopologyUtil { +private static final int MAX_ITERATIONS = 20; + public static Flowable> compile(final Flowable> source, final Compilation compilation) { final TraverserFactory traverserFactory = compilation.getTraverserFactory(); Flowable> sink = (Flowable) source; @@ -55,34 +58,6 @@ public final class TopologyUtil { return sink; } -/* - private final void stageInput() { -if (this.hasStartPredicates) { -final Traverser traverser = this.inputTraversers.isEmpty() ? this.previousStep.next() : this.inputTraversers.remove(); -if (1 == this.untilLocation) { -if (this.untilCompilation.filterTraverser(traverser)) { -this.outputTraversers.add(traverser); -} else if (2 == this.emitLocation && this.emitCompilation.filterTraverser(traverser)) { - this.outputTraversers.add(traverser.repeatDone(this.repeatBranch)); -this.repeat.addTraverser(traverser); -} else -this.repeat.addTraverser(traverser); -} else if (1 == this.emitLocation) { -if (this.emitCompilation.filterTraverser(traverser)) - this.outputTraversers.add(traverser.repeatDone(this.repeatBranch)); -if (2 == this.untilLocation && this.untilCompilation.filterTraverser(traverser)) - this.outputTraversers.add(traverser.repeatDone(this.repeatBranch)); -else -this.repeat.addTraverser(traverser); -} -} else { -this.repeat.addTraverser(this.inputTraversers.isEmpty() ? this.previousStep.next() : this.inputTraversers.remove()); -} -} - - - */ - private static Flowable> extend(Flowable> flow, final CFunction function, final TraverserFactory traverserFactory) { if (function instanceof MapFunction) return flow.map(new MapFlow<>((MapFunction) function)); @@ -114,6 +89,66 @@ public final class TopologyUtil { sink = sink.mergeWith(branchFlow); } return sink; +} else if (function instanceof RepeatBranch) { +final RepeatBranch repeatBranch = (RepeatBranch) function; +final List>> outputs = new ArrayList<>(); +for (int i = 0; i < MAX_ITERATIONS; i++) { +Flowable selectorFlow = flow.flatMapIterable(t -> { +final List list = new ArrayList<>(); +if (repeatBranch.hasStartPredicates()) { +if (1 == repeatBranch.getUntilLocation()) { +if (repeatBranch.getUntil().filterTraverser(t)) { +list.add(List.of(0, t.repeatDone(repeatBranch))); +} else if (2 == repeatBranch.getEmitLocation() && repeatBranch.getEmit().filterTraverser(t)) { +list.add(List.of(1, t)); +list.add(List.of(0, t.repeatDone(repeatBranch))); +} else +list.add(List.of(1, t)); +
[tinkerpop] branch tp4 updated: first stub at RxJavaProcessor. everything works except for repeat(). I'm all confused and lost. Need to think.
This is an automated email from the ASF dual-hosted git repository. okram pushed a commit to branch tp4 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git The following commit(s) were added to refs/heads/tp4 by this push: new 414211a first stub at RxJavaProcessor. everything works except for repeat(). I'm all confused and lost. Need to think. 414211a is described below commit 414211abde8d2f5f257b67f50ff4b192655db104 Author: Marko A. Rodriguez AuthorDate: Wed Apr 3 12:49:50 2019 -0600 first stub at RxJavaProcessor. everything works except for repeat(). I'm all confused and lost. Need to think. --- .../machine/function/branch/BranchBranch.java | 3 +- java/machine/processor/pom.xml | 1 + java/machine/processor/rxjava/pom.xml | 71 .../machine/processor/rxjava/BranchFlow.java | 51 + .../machine/processor/rxjava/FilterFlow.java | 40 +++ .../machine/processor/rxjava/FlatMapFlow.java | 40 +++ .../machine/processor/rxjava/MapFlow.java | 40 +++ .../machine/processor/rxjava/ReduceFlow.java | 41 +++ .../tinkerpop/machine/processor/rxjava/RxJava.java | 84 +++ .../machine/processor/rxjava/RxJavaProcessor.java | 42 .../processor/rxjava/strategy/RxJavaStrategy.java | 38 +++ .../processor/rxjava/util/TopologyUtil.java| 120 + .../machine/processor/rxjava/RxJavaTest.java | 68 13 files changed, 638 insertions(+), 1 deletion(-) diff --git a/java/machine/machine-core/src/main/java/org/apache/tinkerpop/machine/function/branch/BranchBranch.java b/java/machine/machine-core/src/main/java/org/apache/tinkerpop/machine/function/branch/BranchBranch.java index 13f182c..165a87d 100644 --- a/java/machine/machine-core/src/main/java/org/apache/tinkerpop/machine/function/branch/BranchBranch.java +++ b/java/machine/machine-core/src/main/java/org/apache/tinkerpop/machine/function/branch/BranchBranch.java @@ -27,6 +27,7 @@ import org.apache.tinkerpop.machine.function.BranchFunction; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -68,7 +69,7 @@ public final class BranchBranch extends AbstractFunction implements public static BranchBranch compile(final Instruction instruction) { final Object[] args = instruction.args(); -final Map, List>> branches = new HashMap<>(); +final Map, List>> branches = new LinkedHashMap<>(); for (int i = 0; i < args.length; i = i + 2) { final Compilation predicate = Symbols.DEFAULT.equals(args[i]) ? null : Compilation.compile(args[i]); final Compilation branch = Compilation.compile(args[i + 1]); diff --git a/java/machine/processor/pom.xml b/java/machine/processor/pom.xml index f23513c..6a34820 100644 --- a/java/machine/processor/pom.xml +++ b/java/machine/processor/pom.xml @@ -27,5 +27,6 @@ limitations under the License. pipes beam +rxjava \ No newline at end of file diff --git a/java/machine/processor/rxjava/pom.xml b/java/machine/processor/rxjava/pom.xml new file mode 100644 index 000..d41d44f --- /dev/null +++ b/java/machine/processor/rxjava/pom.xml @@ -0,0 +1,71 @@ + +http://maven.apache.org/POM/4.0.0; + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> +4.0.0 + +processor +org.apache.tinkerpop +4.0.0-SNAPSHOT + +Apache TinkerPop :: Machine :: RxJava +rxjava + + +org.apache.tinkerpop +machine-core +${project.version} + + +io.reactivex.rxjava2 +rxjava +2.2.8 + + + +org.apache.tinkerpop +gremlin +${project.version} +test + + +org.apache.tinkerpop +blueprints +${project.version} +test + + + +${basedir}/target +${project.artifactId}-${project.version} + + +${basedir}/src/test/resources + + + + + +org.apache.maven.plugins +maven-surefire-plugin + + +org.apache.maven.plugins +maven-failsafe-plugin + + + + \ No newline at end of file diff --git a/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/BranchFlow.java b/java/machine/processor/rxjava/src/main/java/org/apache/tinkerpop/machine/processor/rxjava/BranchFlow.java new file mode 100644 index 000..5b0d7b7 --- /dev/null +++
[tinkerpop] branch TINKERPOP-2182 updated (1cbe307 -> bb5c453)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch TINKERPOP-2182 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git. discard 1cbe307 TINKERPOP-2182 Removed gperfutils dependencies in Console new 9334272 TINKERPOP-2180: Make sure user.working_dir is still respected properly new bb5c453 TINKERPOP-2182 Removed gperfutils dependencies in Console This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (1cbe307) \ N -- N -- N refs/heads/TINKERPOP-2182 (bb5c453) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 14078 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: gremlin-console/src/main/bin/gremlin.sh | 13 + 1 file changed, 9 insertions(+), 4 deletions(-)
[tinkerpop] 01/01: Implemented EdgeLabelVerificationStrategy
This is an automated email from the ASF dual-hosted git repository. dkuppitz pushed a commit to branch TINKERPOP-2191 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 402e5401ddd5e4898013b972842d0db781664147 Author: Daniel Kuppitz AuthorDate: Thu Mar 14 15:05:09 2019 -0700 Implemented EdgeLabelVerificationStrategy --- CHANGELOG.asciidoc | 2 +- docs/src/upgrade/release-3.3.x.asciidoc| 38 + .../tinkerpop/gremlin/jsr223/CoreImports.java | 2 + .../EdgeLabelVerificationStrategy.java | 130 ++ .../structure/io/graphson/GraphSONModule.java | 5 + .../gremlin/structure/io/gryo/GryoVersion.java | 7 +- .../EdgeLabelVerificationStrategyTest.java | 188 + 7 files changed, 369 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 88df8ad..106761a 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -24,7 +24,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima === TinkerPop 3.3.7 (Release Date: NOT OFFICIALLY RELEASED YET) * Ensure `gremlin.sh` works when directories contain spaces - +* Implemented `EdgeLabelVerificationStrategy` [[release-3-3-6]] === TinkerPop 3.3.6 (Release Date: March 18, 2019) diff --git a/docs/src/upgrade/release-3.3.x.asciidoc b/docs/src/upgrade/release-3.3.x.asciidoc index c1911d3..a5ece72 100644 --- a/docs/src/upgrade/release-3.3.x.asciidoc +++ b/docs/src/upgrade/release-3.3.x.asciidoc @@ -27,6 +27,44 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima Please see the link:https://github.com/apache/tinkerpop/blob/3.3.7/CHANGELOG.asciidoc#release-3-3-7[changelog] for a complete list of all the modifications that are part of this release. +=== Upgrading for Providers + + Detection of Anti-Patterns + +This release adds a strategy named `EdgeLabelVerificationStrategy`. The strategy will not be added by default to the traversal source, however, providers can add it explicitly to encourage (or enforce) +users to always specify at least one edge label. `EdgeLabelVerificationStrategy` can be configured to either throw an exception if no edge label was specified, log a warning or do both. + +[source,text] + +gremlin> // throw an exception if edge label was not specified +gremlin> g = TinkerFactory.createModern().traversal().withStrategies(EdgeLabelVerificationStrategy.build().throwException().create()) +==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard] +gremlin> g.V(1).out('knows') +==>v[2] +==>v[4] +gremlin> g.V(1).out() +The provided traversal contains a vertex step without any specified edge label: VertexStep(OUT,vertex) +Type ':help' or ':h' for help. +Display stack trace? [yN] + + +[source,text] + +gremlin> // log a warning if edge label was not specified (Log4j has to be configured properly) +gremlin> g = TinkerFactory.createModern().traversal().withStrategies(EdgeLabelVerificationStrategy.build().logWarning().create()) +==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard] +gremlin> g.V(1).out('knows') +==>v[2] +==>v[4] +gremlin> g.V(1).out() +WARN org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.EdgeLabelVerificationStrategy - The provided traversal contains a vertex step without any specified edge label: VertexStep(OUT,vertex) +==>v[3] +==>v[2] +==>v[4] + + +See: link:https://issues.apache.org/jira/browse/TINKERPOP-2191[TINKERPOP-2191] + == TinkerPop 3.3.6 *Release Date: March 18, 2019* diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java index 576d0de..e298951 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java @@ -86,6 +86,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.Orde import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.PathProcessorStrategy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.CountStrategy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ComputerVerificationStrategy; +import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.EdgeLabelVerificationStrategy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.LambdaRestrictionStrategy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.StandardVerificationStrategy; @@ -241,6 +242,7 @@ public final class CoreImports { CLASS_IMPORTS.add(LambdaRestrictionStrategy.class); CLASS_IMPORTS.add(ReadOnlyStrategy.class);
[tinkerpop] branch TINKERPOP-2191 updated (ce7c5ea -> 402e540)
This is an automated email from the ASF dual-hosted git repository. dkuppitz pushed a change to branch TINKERPOP-2191 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git. omit ce7c5ea Implemented EdgeLabelVerificationStrategy add 70c8f7e Bump GMavenPlus to 1.6.3 CTR add 9334272 TINKERPOP-2180: Make sure user.working_dir is still respected properly new 402e540 Implemented EdgeLabelVerificationStrategy This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (ce7c5ea) \ N -- N -- N refs/heads/TINKERPOP-2191 (402e540) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: gremlin-console/src/main/bin/gremlin.sh | 13 + pom.xml | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-)
[GitHub] [tinkerpop] spmallette commented on issue #1089: TINKERPOP-2180: Make sure user.working_dir is still respected properly
spmallette commented on issue #1089: TINKERPOP-2180: Make sure user.working_dir is still respected properly URL: https://github.com/apache/tinkerpop/pull/1089#issuecomment-479610675 merged via CTR to fix integration tests for Gremlin Console This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[tinkerpop] branch master updated: TINKERPOP-2180: Make sure user.working_dir is still respected properly
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git The following commit(s) were added to refs/heads/master by this push: new 9334272 TINKERPOP-2180: Make sure user.working_dir is still respected properly new 32f6c6a Merge branch 'tp33' 9334272 is described below commit 9334272171ecddc0ec890f4ebe7e39ef1ad5339c Author: Eduard Tudenhoefner AuthorDate: Wed Apr 3 18:44:36 2019 +0200 TINKERPOP-2180: Make sure user.working_dir is still respected properly --- gremlin-console/src/main/bin/gremlin.sh | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gremlin-console/src/main/bin/gremlin.sh b/gremlin-console/src/main/bin/gremlin.sh index 6253ee1..b12983f 100755 --- a/gremlin-console/src/main/bin/gremlin.sh +++ b/gremlin-console/src/main/bin/gremlin.sh @@ -92,15 +92,20 @@ while getopts ":l" opt; do esac done -JAVA_OPTIONS="${JAVA_OPTIONS} -Duser.working_dir=${USER_DIR} -Dtinkerpop.ext=${USER_EXT_DIR:-${SYSTEM_EXT_DIR}} -Dlog4j.configuration=conf/log4j-console.properties -Dgremlin.log4j.level=$GREMLIN_LOG_LEVEL" -JAVA_OPTIONS=$(awk -v RS=' ' '!/^$/ {if (!x[$0]++) print}' <<< "${JAVA_OPTIONS}" | grep -v '^$' | paste -sd ' ' -) +JVM_OPTS=() +if [ ! -z "${JAVA_OPTIONS}" ]; then +JVM_OPTS+=( "${JAVA_OPTIONS}" ) +fi + +JVM_OPTS+=( "-Duser.working_dir=${USER_DIR}" "-Dtinkerpop.ext=${USER_EXT_DIR:-${SYSTEM_EXT_DIR}}" "-Dlog4j.configuration=conf/log4j-console.properties" "-Dgremlin.log4j.level=$GREMLIN_LOG_LEVEL" ) +JVM_OPTS=$(awk -v RS=' ' '!/^$/ {if (!x[$0]++) print}' <<< "${JVM_OPTS}" | grep -v '^$' | paste -sd ' ' -) if [ -n "$SCRIPT_DEBUG" ]; then # in debug mode enable debugging of :install command -JAVA_OPTIONS="${JAVA_OPTIONS} -Divy.message.logger.level=4 -Dgroovy.grape.report.downloads=true" +JVM_OPTS="${JAVA_OPTIONS} -Divy.message.logger.level=4 -Dgroovy.grape.report.downloads=true" echo "CLASSPATH: $CLASSPATH" set -x fi # Start the JVM, execute the application, and return its exit code -exec $JAVA "$JAVA_OPTIONS" org.apache.tinkerpop.gremlin.console.Console "$@" +exec $JAVA "${JVM_OPTS[@]}" org.apache.tinkerpop.gremlin.console.Console "$@"
[tinkerpop] branch tp33 updated (70c8f7e -> 9334272)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch tp33 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git. from 70c8f7e Bump GMavenPlus to 1.6.3 CTR add 9334272 TINKERPOP-2180: Make sure user.working_dir is still respected properly No new revisions were added by this update. Summary of changes: gremlin-console/src/main/bin/gremlin.sh | 13 + 1 file changed, 9 insertions(+), 4 deletions(-)
[GitHub] [tinkerpop] spmallette merged pull request #1089: TINKERPOP-2180: Make sure user.working_dir is still respected properly
spmallette merged pull request #1089: TINKERPOP-2180: Make sure user.working_dir is still respected properly URL: https://github.com/apache/tinkerpop/pull/1089 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [tinkerpop] nastra opened a new pull request #1089: TINKERPOP-2180: Make sure user.working_dir is still respected properly
nastra opened a new pull request #1089: TINKERPOP-2180: Make sure user.working_dir is still respected properly URL: https://github.com/apache/tinkerpop/pull/1089 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services