You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by pl...@apache.org on 2016/08/12 13:50:50 UTC

[1/2] tinkerpop git commit: remove excess bulk in tail buffer

Repository: tinkerpop
Updated Branches:
  refs/heads/master c25033175 -> cc0c06f41


remove excess bulk in tail buffer


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

Branch: refs/heads/master
Commit: 6d29394225ff49ad12582d8e8e5bfc7b07e9ccfa
Parents: 4571061
Author: Jason Plurad <pl...@us.ibm.com>
Authored: Sat Jul 30 00:04:54 2016 -0400
Committer: Jason Plurad <pl...@us.ibm.com>
Committed: Fri Aug 12 08:29:01 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                |  1 +
 .../traversal/step/filter/TailGlobalStep.java     |  5 ++++-
 .../traversal/step/filter/GroovyTailTest.groovy   |  5 +++++
 .../process/traversal/step/filter/TailTest.java   | 18 ++++++++++++++++++
 4 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6d293942/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 975f6cf..fefffb0 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -29,6 +29,7 @@ TinkerPop 3.1.4 (NOT OFFICIALLY RELEASED YET)
 * Fixed a potential leak of a `ReferenceCounted` resource in Gremlin Server.
 * Renamed distributions to make the prefix "apache-tinkerpop-" as opposed to just "apache-".
 * Fixed a problem (previously thought resolved on 3.1.3) causing Gremlin Server to lock up when parallel requests were submitted on the same session if those parallel requests included a script that blocked indefinitely.
+* Fixed bug in `TailGlobalStep` where excess bulk was not accounted for correctly.
 
 [[release-3-1-3]]
 TinkerPop 3.1.3 (Release Date: July 18, 2016)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6d293942/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java
index 19d3d95..33c7c22 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java
@@ -64,8 +64,11 @@ public final class TailGlobalStep<S> extends AbstractStep<S, S> implements Bypas
             final Traverser.Admin<S> oldest = this.tail.pop();
             // Trim any excess from the oldest traverser.
             final long excess = this.tailBulk - this.limit;
-            if (excess > 0)
+            if (excess > 0) {
                 oldest.setBulk(oldest.bulk() - excess);
+                // Account for the loss of excess in the tail buffer
+                this.tailBulk -= excess;
+            }
             // Account for the loss of bulk in the tail buffer as we emit the oldest traverser.
             this.tailBulk -= oldest.bulk();
             return oldest;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6d293942/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
index 50f4d96..7fac07e 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
@@ -65,6 +65,11 @@ public abstract class GroovyTailTest {
         }
 
         @Override
+        public Traversal<Vertex, Long> get_g_V_repeatXin_outX_timesX3X_tailX7X_count() {
+            TraversalScriptHelper.compute("g.V.repeat(__.in().out()).times(3).tail(7).count()",g)
+        }
+
+        @Override
         public Traversal<Vertex, List<String>> get_g_V_asXaX_out_asXaX_out_asXaX_selectXaX_byXunfold_valuesXnameX_foldX_tailXlocal_2X() {
             TraversalScriptHelper.compute("g.V.as('a').out.as('a').out.as('a').select('a').by(unfold().values('name').fold).tail(local, 2)",g)
         }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6d293942/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailTest.java
index 21bdbe6..738964c 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailTest.java
@@ -28,6 +28,7 @@ import org.junit.runner.RunWith;
 
 import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
 import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.both;
+import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.in;
 import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.limit;
 import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.unfold;
 import static org.apache.tinkerpop.gremlin.process.traversal.Scope.global;
@@ -35,6 +36,7 @@ import static org.apache.tinkerpop.gremlin.process.traversal.Scope.local;
 import static org.junit.Assert.assertEquals;
 
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -58,6 +60,8 @@ public abstract class TailTest extends AbstractGremlinProcessTest {
 
     public abstract Traversal<Vertex, Vertex> get_g_V_repeatXbothX_timesX3X_tailX7X();
 
+    public abstract Traversal<Vertex, Long> get_g_V_repeatXin_outX_timesX3X_tailX7X_count();
+
     public abstract Traversal<Vertex, List<String>> get_g_V_asXaX_out_asXaX_out_asXaX_selectXaX_byXunfold_valuesXnameX_foldX_tailXlocal_2X();
 
     public abstract Traversal<Vertex, String> get_g_V_asXaX_out_asXaX_out_asXaX_selectXaX_byXunfold_valuesXnameX_foldX_tailXlocal_1X();
@@ -120,6 +124,15 @@ public abstract class TailTest extends AbstractGremlinProcessTest {
         assertEquals(7, counter);
     }
 
+    /** Scenario: Global scope, using repeat (excess BULK) */
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_repeatXin_outX_timesX3X_tailX7X_count() {
+        final Traversal<Vertex, Long> traversal = get_g_V_repeatXin_outX_timesX3X_tailX7X_count();
+        printTraversalForm(traversal);
+        checkResults(Collections.singletonList(7L), traversal);
+    }
+
     /** Scenario: Local scope, List input, N>1 */
     @Test
     @LoadGraphWith(MODERN)
@@ -221,6 +234,11 @@ public abstract class TailTest extends AbstractGremlinProcessTest {
         }
 
         @Override
+        public Traversal<Vertex, Long> get_g_V_repeatXin_outX_timesX3X_tailX7X_count() {
+            return g.V().repeat(in().out()).times(3).tail(7).count();
+        }
+
+        @Override
         public Traversal<Vertex, List<String>> get_g_V_asXaX_out_asXaX_out_asXaX_selectXaX_byXunfold_valuesXnameX_foldX_tailXlocal_2X() {
             return g.V().as("a").out().as("a").out().as("a").<List<String>>select("a").by(unfold().values("name").fold()).tail(local, 2);
         }


Re: [2/2] tinkerpop git commit: Merge remote-tracking branch 'origin/tp31'

Posted by Marko Rodriguez <ok...@gmail.com>.
Simple fix — upmerge from tp31/ wasn’t done prior to edits to master/ on GroovyTailTest. Fixed.

Marko.

> On Aug 12, 2016, at 8:18 AM, Marko Rodriguez <ok...@gmail.com> wrote:
> 
> master/ is not building:
> 
> Tests in error:
>  GroovyTailTest$Traversals>TailTest.g_V_repeatXin_outX_timesX3X_tailX7X_count:131->get_g_V_repeatXin_outX_timesX3X_tailX7X_count:59->propertyMissing:-1 » MissingProperty
>  GroovyTailTest$Traversals>TailTest.g_V_repeatXin_outX_timesX3X_tailX7X_count:131->get_g_V_repeatXin_outX_timesX3X_tailX7X_count:59->propertyMissing:-1 » MissingProperty
> 
> Marko.,
> 
> http://markorodriguez.com
> 
> 
> 
>> On Aug 12, 2016, at 7:50 AM, pluradj@apache.org wrote:
>> 
>> Merge remote-tracking branch 'origin/tp31'
>> 
>> 
>> Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/cc0c06f4
>> Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/cc0c06f4
>> Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/cc0c06f4
>> 
>> Branch: refs/heads/master
>> Commit: cc0c06f41a9679b5fd29722100a2afc0195ab334
>> Parents: c250331 6d29394
>> Author: Jason Plurad <pl...@us.ibm.com>
>> Authored: Fri Aug 12 09:49:51 2016 -0400
>> Committer: Jason Plurad <pl...@us.ibm.com>
>> Committed: Fri Aug 12 09:49:51 2016 -0400
>> 
>> ----------------------------------------------------------------------
>> CHANGELOG.asciidoc                                |  1 +
>> .../traversal/step/filter/TailGlobalStep.java     |  5 ++++-
>> .../traversal/step/filter/GroovyTailTest.groovy   |  5 +++++
>> .../process/traversal/step/filter/TailTest.java   | 18 ++++++++++++++++++
>> 4 files changed, 28 insertions(+), 1 deletion(-)
>> ----------------------------------------------------------------------
>> 
>> 
>> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc0c06f4/CHANGELOG.asciidoc
>> ----------------------------------------------------------------------
>> 
>> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc0c06f4/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java
>> ----------------------------------------------------------------------
>> 
>> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc0c06f4/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
>> ----------------------------------------------------------------------
>> diff --cc gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
>> index 41a7f39,7fac07e..c562233
>> --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
>> +++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
>> @@@ -55,8 -65,13 +55,13 @@@ public abstract class GroovyTailTest 
>>         }
>> 
>>         @Override
>> +         public Traversal<Vertex, Long> get_g_V_repeatXin_outX_timesX3X_tailX7X_count() {
>> +             TraversalScriptHelper.compute("g.V.repeat(__.in().out()).times(3).tail(7).count()",g)
>> +         }
>> + 
>> +         @Override
>>         public Traversal<Vertex, List<String>> get_g_V_asXaX_out_asXaX_out_asXaX_selectXaX_byXunfold_valuesXnameX_foldX_tailXlocal_2X() {
>> -            TraversalScriptHelper.compute("g.V.as('a').out.as('a').out.as('a').select('a').by(unfold().values('name').fold).tail(local, 2)",g)
>> +            new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.as('a').out.as('a').select('a').by(unfold().values('name').fold).tail(local, 2)")
>>         }
>> 
>>         @Override
>> 
> 


Re: [2/2] tinkerpop git commit: Merge remote-tracking branch 'origin/tp31'

Posted by Marko Rodriguez <ok...@gmail.com>.
master/ is not building:

Tests in error:
  GroovyTailTest$Traversals>TailTest.g_V_repeatXin_outX_timesX3X_tailX7X_count:131->get_g_V_repeatXin_outX_timesX3X_tailX7X_count:59->propertyMissing:-1 » MissingProperty
  GroovyTailTest$Traversals>TailTest.g_V_repeatXin_outX_timesX3X_tailX7X_count:131->get_g_V_repeatXin_outX_timesX3X_tailX7X_count:59->propertyMissing:-1 » MissingProperty

Marko.,

http://markorodriguez.com



> On Aug 12, 2016, at 7:50 AM, pluradj@apache.org wrote:
> 
> Merge remote-tracking branch 'origin/tp31'
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
> Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/cc0c06f4
> Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/cc0c06f4
> Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/cc0c06f4
> 
> Branch: refs/heads/master
> Commit: cc0c06f41a9679b5fd29722100a2afc0195ab334
> Parents: c250331 6d29394
> Author: Jason Plurad <pl...@us.ibm.com>
> Authored: Fri Aug 12 09:49:51 2016 -0400
> Committer: Jason Plurad <pl...@us.ibm.com>
> Committed: Fri Aug 12 09:49:51 2016 -0400
> 
> ----------------------------------------------------------------------
> CHANGELOG.asciidoc                                |  1 +
> .../traversal/step/filter/TailGlobalStep.java     |  5 ++++-
> .../traversal/step/filter/GroovyTailTest.groovy   |  5 +++++
> .../process/traversal/step/filter/TailTest.java   | 18 ++++++++++++++++++
> 4 files changed, 28 insertions(+), 1 deletion(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc0c06f4/CHANGELOG.asciidoc
> ----------------------------------------------------------------------
> 
> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc0c06f4/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java
> ----------------------------------------------------------------------
> 
> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc0c06f4/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
> ----------------------------------------------------------------------
> diff --cc gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
> index 41a7f39,7fac07e..c562233
> --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
> +++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
> @@@ -55,8 -65,13 +55,13 @@@ public abstract class GroovyTailTest 
>          }
> 
>          @Override
> +         public Traversal<Vertex, Long> get_g_V_repeatXin_outX_timesX3X_tailX7X_count() {
> +             TraversalScriptHelper.compute("g.V.repeat(__.in().out()).times(3).tail(7).count()",g)
> +         }
> + 
> +         @Override
>          public Traversal<Vertex, List<String>> get_g_V_asXaX_out_asXaX_out_asXaX_selectXaX_byXunfold_valuesXnameX_foldX_tailXlocal_2X() {
> -            TraversalScriptHelper.compute("g.V.as('a').out.as('a').out.as('a').select('a').by(unfold().values('name').fold).tail(local, 2)",g)
> +            new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.as('a').out.as('a').select('a').by(unfold().values('name').fold).tail(local, 2)")
>          }
> 
>          @Override
> 


[2/2] tinkerpop git commit: Merge remote-tracking branch 'origin/tp31'

Posted by pl...@apache.org.
Merge remote-tracking branch 'origin/tp31'


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

Branch: refs/heads/master
Commit: cc0c06f41a9679b5fd29722100a2afc0195ab334
Parents: c250331 6d29394
Author: Jason Plurad <pl...@us.ibm.com>
Authored: Fri Aug 12 09:49:51 2016 -0400
Committer: Jason Plurad <pl...@us.ibm.com>
Committed: Fri Aug 12 09:49:51 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                |  1 +
 .../traversal/step/filter/TailGlobalStep.java     |  5 ++++-
 .../traversal/step/filter/GroovyTailTest.groovy   |  5 +++++
 .../process/traversal/step/filter/TailTest.java   | 18 ++++++++++++++++++
 4 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc0c06f4/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc0c06f4/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
----------------------------------------------------------------------
diff --cc gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
index 41a7f39,7fac07e..c562233
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
@@@ -55,8 -65,13 +55,13 @@@ public abstract class GroovyTailTest 
          }
  
          @Override
+         public Traversal<Vertex, Long> get_g_V_repeatXin_outX_timesX3X_tailX7X_count() {
+             TraversalScriptHelper.compute("g.V.repeat(__.in().out()).times(3).tail(7).count()",g)
+         }
+ 
+         @Override
          public Traversal<Vertex, List<String>> get_g_V_asXaX_out_asXaX_out_asXaX_selectXaX_byXunfold_valuesXnameX_foldX_tailXlocal_2X() {
 -            TraversalScriptHelper.compute("g.V.as('a').out.as('a').out.as('a').select('a').by(unfold().values('name').fold).tail(local, 2)",g)
 +            new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.as('a').out.as('a').select('a').by(unfold().values('name').fold).tail(local, 2)")
          }
  
          @Override