jtuglu1 commented on code in PR #19136:
URL: https://github.com/apache/druid/pull/19136#discussion_r2928252792
##########
server/src/main/java/org/apache/druid/client/BrokerServerView.java:
##########
@@ -99,6 +105,28 @@ public BrokerServerView(
this.emitter = emitter;
this.brokerViewOfCoordinatorConfig = brokerViewOfCoordinatorConfig;
+ // Compose coordinator filter (clone semantics) with broker blacklist
filter.
+ // Coordinator filter is applied first, then blacklisted nodes are
excluded from the result.
+ this.compositeFilter = (servers, mode) -> {
+ final Int2ObjectRBTreeMap<Set<QueryableDruidServer>> afterCoordFilter =
+ brokerViewOfCoordinatorConfig.getQueryableServers(servers, mode);
+ final BrokerDynamicConfig brokerConfig =
brokerViewOfBrokerConfig.getDynamicConfig();
+ if (brokerConfig == null ||
brokerConfig.getBlacklistedDataNodes().isEmpty()) {
+ return afterCoordFilter;
+ }
+ final Set<String> blacklisted = brokerConfig.getBlacklistedDataNodes();
+ final Int2ObjectRBTreeMap<Set<QueryableDruidServer>> result = new
Int2ObjectRBTreeMap<>();
Review Comment:
This might be a bit expensive – nlogn in # of servers (which hopefully
shouldn't be too bad). It didn't show up in profiles.
--
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]