leventov commented on a change in pull request #7088: Improve parallelism of
zookeeper based segment change processing
URL: https://github.com/apache/incubator-druid/pull/7088#discussion_r277352511
##########
File path:
server/src/main/java/org/apache/druid/server/coordinator/CuratorLoadQueuePeon.java
##########
@@ -406,11 +409,11 @@ public void addCallback(LoadPeonCallback newCallback)
}
}
- LoadPeonCallback[] getCallbacks()
+ List<LoadPeonCallback> snapshotCallbacks()
{
synchronized (callbacks) {
// Return a copy so that callers get a consistent view
Review comment:
The risk is not just "inconsistency" (not very clear what does it mean), the
risk is `NullPointerException`, `ArrayIndexOutOfBoundsException`.
When I stumbled upon this comment, I wondered what "inconsistency" is meant
and had to look around the code to understand. This is what we want to avoid -
comments and code that leaves more questions than answers to code readers.
The comment that I suggested might not be very clear as well. If you think
so, this means that the comment should be even bigger, maybe combining
information from our comments.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]