From 23f48caa9196e1156374ece5d12de2f9793773fb Mon Sep 17 00:00:00 2001 From: wucc <77946882+DanGuge@users.noreply.github.com> Date: Thu, 21 Sep 2023 15:29:16 +0800 Subject: [PATCH] fix: code style --- .../apache/hugegraph/traversal/algorithm/HugeTraverser.java | 4 ++-- .../apache/hugegraph/traversal/algorithm/OltpTraverser.java | 4 ++-- .../src/main/java/org/apache/hugegraph/util/Consumers.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/HugeTraverser.java b/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/HugeTraverser.java index 9740811cc7..194576e857 100644 --- a/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/HugeTraverser.java +++ b/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/HugeTraverser.java @@ -1028,8 +1028,8 @@ public class EdgesIterator implements Iterator>, Closeable { public EdgesIterator(EdgesQueryIterator queries) { List> iteratorList = new ArrayList<>(); while (queries.hasNext()) { - iteratorList.add( - graph().edges(queries.next())); + Iterator edges = graph.edges(queries.next()); + iteratorList.add(edges); } this.currentIter = iteratorList.iterator(); } diff --git a/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/OltpTraverser.java b/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/OltpTraverser.java index 0149c9796b..c05d8f89f4 100644 --- a/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/OltpTraverser.java +++ b/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/OltpTraverser.java @@ -285,6 +285,7 @@ public static class ConcurrentVerticesConsumer implements Consumer { private final Set excluded; private final Set neighbors; private final long limit; + private final AtomicInteger count; public ConcurrentVerticesConsumer(Id sourceV, Set excluded, long limit, Set neighbors) { @@ -292,10 +293,9 @@ public ConcurrentVerticesConsumer(Id sourceV, Set excluded, long limit, this.excluded = excluded; this.limit = limit; this.neighbors = neighbors; + this.count = new AtomicInteger(0); } - private final AtomicInteger count = new AtomicInteger(0); - @Override public void accept(EdgeId edgeId) { if (this.limit != NO_LIMIT && count.get() >= this.limit) { diff --git a/hugegraph-core/src/main/java/org/apache/hugegraph/util/Consumers.java b/hugegraph-core/src/main/java/org/apache/hugegraph/util/Consumers.java index 5e1bcd74fc..06e678fd98 100644 --- a/hugegraph-core/src/main/java/org/apache/hugegraph/util/Consumers.java +++ b/hugegraph-core/src/main/java/org/apache/hugegraph/util/Consumers.java @@ -208,7 +208,7 @@ public void provide(V v) throws Throwable { try { this.queue.put(v); } catch (InterruptedException e) { - LOG.warn("Interrupted while enqueue", e); + LOG.warn("Interrupt while queuing QUEUE_END", e); } } }