coldestlin commented on code in PR #15993:
URL:
https://github.com/apache/dolphinscheduler/pull/15993#discussion_r1599694213
##########
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/MasterPriorityQueue.java:
##########
@@ -80,15 +80,23 @@ public void clear() {
private void refreshMasterList() {
hostIndexMap.clear();
- Iterator<Server> iterator = queue.iterator();
int index = 0;
- while (iterator.hasNext()) {
- Server server = iterator.next();
+ for (Server server: getOrderedElements()) {
String addr = NetUtils.getAddr(server.getHost(), server.getPort());
hostIndexMap.put(addr, index);
index += 1;
}
+ }
+ /**
+ * get ordered collection of priority queue
+ *
+ * @return ordered collection
+ */
+ private Server[] getOrderedElements() {
Review Comment:
Accepted
--
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]