uds5501 commented on code in PR #18314:
URL: https://github.com/apache/druid/pull/18314#discussion_r2229019475
##########
server/src/main/java/org/apache/druid/client/BrokerServerView.java:
##########
@@ -436,4 +446,42 @@ public List<ImmutableDruidServer> getDruidServers()
.map(queryableDruidServer ->
queryableDruidServer.getServer().toImmutableDruidServer())
.collect(Collectors.toList());
}
+
+ @Override
+ public Map<RowKey, Long> getAvailableSegmentCount()
+ {
+ return CollectionUtils.mapValues(segmentAvailableCount, AtomicLong::get);
+ }
+
+ private static long incrementAndGetLong(ConcurrentHashMap<RowKey,
AtomicLong> counters, RowKey key)
+ {
+ AtomicLong counter = counters.get(key);
+ if (counter == null) {
+ counter = counters.computeIfAbsent(key, k -> new AtomicLong());
+ }
+ return counter.incrementAndGet();
Review Comment:
fair, used it now
--
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]