You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by co...@apache.org on 2025/09/05 22:22:11 UTC
(tinkerpop) 02/19: Fixed RangeGlobalStep requirements.
This is an automated email from the ASF dual-hosted git repository.
colegreer pushed a commit to branch repeatLimit
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit cd5a485b6b1631e1d51b585ae655a154c9a4778a
Author: Andrea Child <an...@improving.com>
AuthorDate: Mon Aug 25 19:23:33 2025 -0700
Fixed RangeGlobalStep requirements.
---
.../gremlin/process/traversal/step/filter/RangeGlobalStep.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java
index 5d6dbbab7c..ef8bcaf5a8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java
@@ -33,6 +33,7 @@ import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
@@ -70,7 +71,7 @@ public final class RangeGlobalStep<S> extends FilterStep<S> implements Ranging,
// Determine which counter to use
AtomicLong currentCounter = this.counter;
if (usePerIterationCounters && traverser.loops() > 0) {
- String iterationKey = traverser.getStepId() + ":" + traverser.loops();
+ String iterationKey = this.getId() + ":" + traverser.loops();
currentCounter = perIterationCounters.computeIfAbsent(iterationKey, k -> new AtomicLong(0L));
}
@@ -159,6 +160,12 @@ public final class RangeGlobalStep<S> extends FilterStep<S> implements Ranging,
@Override
public Set<TraverserRequirement> getRequirements() {
+ if (usePerIterationCounters) {
+ final Set<TraverserRequirement> requirements = new HashSet<>();
+ requirements.add(TraverserRequirement.BULK);
+ requirements.add(TraverserRequirement.SINGLE_LOOP);
+ return requirements;
+ }
return Collections.singleton(TraverserRequirement.BULK);
}