Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ABD60200B13 for ; Tue, 31 May 2016 14:49:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AACA6160A55; Tue, 31 May 2016 12:49:15 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 92A9A160A4C for ; Tue, 31 May 2016 14:49:14 +0200 (CEST) Received: (qmail 99760 invoked by uid 500); 31 May 2016 12:49:13 -0000 Mailing-List: contact commits-help@tinkerpop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tinkerpop.apache.org Delivered-To: mailing list commits@tinkerpop.apache.org Received: (qmail 99747 invoked by uid 99); 31 May 2016 12:49:13 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2016 12:49:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 5BE181A0C85 for ; Tue, 31 May 2016 12:49:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id hm9kWcQjgzSG for ; Tue, 31 May 2016 12:49:11 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 7296960D36 for ; Tue, 31 May 2016 12:49:10 +0000 (UTC) Received: (qmail 98664 invoked by uid 99); 31 May 2016 12:49:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2016 12:49:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 66E5FE78BE; Tue, 31 May 2016 12:49:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dkuppitz@apache.org To: commits@tinkerpop.incubator.apache.org Date: Tue, 31 May 2016 12:49:38 -0000 Message-Id: <3d892c49f1cd4b3d925c0eae432a884a@git.apache.org> In-Reply-To: <017193bcc916487e98d6ecc0f4b09a89@git.apache.org> References: <017193bcc916487e98d6ecc0f4b09a89@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [31/49] incubator-tinkerpop git commit: Forgot to handle `FilterSteps`. archived-at: Tue, 31 May 2016 12:49:15 -0000 Forgot to handle `FilterSteps`. Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/5d38bbeb Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/5d38bbeb Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/5d38bbeb Branch: refs/heads/TINKERPOP-1298 Commit: 5d38bbeb591a49f5c47ed0aa7d9aece12cf3dd21 Parents: ef53888 Author: Daniel Kuppitz Authored: Thu May 26 22:18:25 2016 +0200 Committer: Daniel Kuppitz Committed: Fri May 27 13:25:39 2016 +0200 ---------------------------------------------------------------------- .../strategy/optimization/RangeByIsCountStrategy.java | 10 +++++----- .../strategy/optimization/RangeByIsCountStrategyTest.java | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5d38bbeb/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategy.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategy.java index 835a8f9..451d561 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategy.java @@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep; import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsStep; import org.apache.tinkerpop.gremlin.process.traversal.step.filter.NotStep; import org.apache.tinkerpop.gremlin.process.traversal.step.filter.RangeGlobalStep; @@ -95,17 +96,16 @@ public final class RangeByIsCountStrategy extends AbstractTraversalStrategy highRange; if (update) { - final boolean isNested = !(parent instanceof EmptyStep); - if (isNested) { + if (parent instanceof EmptyStep) { + useNotStep = true; + } else { if (parent instanceof RepeatStep) { final RepeatStep repeatStep = (RepeatStep) parent; useNotStep = Objects.equals(traversal, repeatStep.getUntilTraversal()) || Objects.equals(traversal, repeatStep.getEmitTraversal()); } else { - useNotStep = parent instanceof SideEffectStep; + useNotStep = parent instanceof FilterStep || parent instanceof SideEffectStep; } - } else { - useNotStep = true; } highRange = highRangeCandidate; useNotStep &= curr.getLabels().isEmpty() && next.getLabels().isEmpty() http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5d38bbeb/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategyTest.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategyTest.java index 8b42e7f..03d5176 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategyTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RangeByIsCountStrategyTest.java @@ -142,6 +142,7 @@ public class RangeByIsCountStrategyTest { {__.out().count().is(without(2, 6, 4)), __.out().limit(6).count().is(without(2, 6, 4))}, {__.map(__.count().is(0)), __.map(__.limit(1).count().is(0))}, {__.flatMap(__.count().is(0)), __.flatMap(__.limit(1).count().is(0))}, + {__.filter(__.count().is(0)), __.filter(__.not(__.identity()))}, {__.sideEffect(__.count().is(0)), __.sideEffect(__.not(__.identity()))}, {__.branch(__.count().is(0)), __.branch(__.limit(1).count().is(0))}, {__.count().is(0).store("x"), __.limit(1).count().is(0).store("x")},