dlmarion commented on code in PR #5055:
URL: https://github.com/apache/accumulo/pull/5055#discussion_r1842285041
##########
core/src/main/java/org/apache/accumulo/core/clientImpl/InstanceOperationsImpl.java:
##########
@@ -501,6 +501,20 @@ public ServerId getServer(ServerId.Type type, String
resourceGroup, String host,
} else {
return managers.iterator().next();
}
+ case MONITOR:
+ Set<ServerId> monitors = getServers(type, rg2 -> true, hp);
+ if (monitors.isEmpty()) {
+ return null;
+ } else {
+ return monitors.iterator().next();
+ }
+ case GARBAGE_COLLECTOR:
+ Set<ServerId> gc = getServers(type, rg2 -> true, hp);
+ if (gc.isEmpty()) {
+ return null;
+ } else {
+ return gc.iterator().next();
+ }
Review Comment:
I collapsed the cases, but I didn't replace `.iterator().next()` with
`.stream().collect(MoreCollectors.onlyElement())`
--
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]