javeme commented on code in PR #2312:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2312#discussion_r1331486714


##########
hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/HugeTraverser.java:
##########
@@ -1017,29 +1017,31 @@ public Set<Edge> getEdges(Iterator<Id> vertexIter) {
     }
 
     public class EdgesIterator implements Iterator<Iterator<Edge>>, Closeable {
-        private final Iterator<Iterator<Edge>> currentIt;
 
-        public EdgesIterator(EdgesQueryIterator queryIterator) {
+        private final Iterator<Iterator<Edge>> currentIter;
+
+        public EdgesIterator(EdgesQueryIterator queries) {
             List<Iterator<Edge>> iteratorList = new ArrayList<>();
-            while (queryIterator.hasNext()) {
-                iteratorList.add(graph().edges(queryIterator.next()));
+            while (queries.hasNext()) {
+                iteratorList.add(
+                        graph().edges(queries.next()));

Review Comment:
   prefer:
   ```java
   Iterator<Edge> edges = graph().edges(queries.next())
   iteratorList.add(edges)
   ```



##########
hugegraph-core/src/main/java/org/apache/hugegraph/util/Consumers.java:
##########
@@ -175,16 +213,29 @@ public void provide(V v) throws Throwable {
         }
     }
 
+    private void putQueueEnd() {
+        if (this.executor != null) {
+            try {
+                this.queue.put(QUEUE_END);
+            } catch (InterruptedException e) {
+                LOG.warn("Interrupted while enqueue", e);

Review Comment:
   Interrupt while queuing QUEUE_END



##########
hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/OltpTraverser.java:
##########
@@ -295,6 +294,8 @@ public ConcurrentVerticesConsumer(Id sourceV, Set<Id> 
excluded, long limit,
             this.neighbors = neighbors;
         }
 
+        private final AtomicInteger count = new AtomicInteger(0);

Review Comment:
   sorry it means moving `count = new AtomicInteger(0)` into the constructor



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to