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_r276327188
##########
File path:
server/src/main/java/org/apache/druid/server/coordinator/CuratorLoadQueuePeon.java
##########
@@ -431,34 +389,28 @@ public int getType()
return type;
}
- public SegmentId getSegmentId()
+ public String getSegmentIdentifier()
{
- return segment.getId();
+ return segment.getId().toString();
}
public long getSegmentSize()
{
return segment.getSize();
}
- public void addCallbacks(Collection<LoadPeonCallback> newCallbacks)
- {
- synchronized (callbacks) {
- callbacks.addAll(newCallbacks);
- }
- }
-
public void addCallback(LoadPeonCallback newCallback)
{
synchronized (callbacks) {
callbacks.add(newCallback);
}
}
- public List<LoadPeonCallback> getCallbacks()
+ LoadPeonCallback[] getCallbacks()
{
synchronized (callbacks) {
- return callbacks;
+ // Return a copy so that callers get a consistent view
+ return callbacks.toArray(new LoadPeonCallback[0]);
Review comment:
Can call `ImmutableList.copyOf()` and still use `List` interface?
----------------------------------------------------------------
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]