Radeity commented on code in PR #243:
URL:
https://github.com/apache/incubator-hugegraph-computer/pull/243#discussion_r1202373724
##########
computer-core/src/main/java/org/apache/hugegraph/computer/core/receiver/MessageRecvManager.java:
##########
@@ -103,8 +108,12 @@ public void beforeSuperstep(Config config, int superstep) {
this.messagePartitions = new ComputeMessageRecvPartitions(
this.context, fileGenerator,
this.sortManager);
this.expectedFinishMessages = this.workerCount;
- this.finishMessagesLatch = new CountDownLatch(
- this.expectedFinishMessages);
+ this.finishMessagesFuture = new CompletableFuture<>();
+ if (!this.finishMessageCount.compareAndSet(0,
this.expectedFinishMessages)) {
+ throw new ComputerException("The origin count must be 0");
Review Comment:
UT will fail if using `compareAndSet()` here. Also, I find it doesn't have
concurrency issue, so I modify to directly use `set()`.
--
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]