suneet-s commented on a change in pull request #9302: Not use for CoordinatorRuleManager.rules URL: https://github.com/apache/druid/pull/9302#discussion_r373872657
########## File path: server/src/main/java/org/apache/druid/server/router/CoordinatorRuleManager.java ########## @@ -58,7 +57,7 @@ private final ObjectMapper jsonMapper; private final Supplier<TieredBrokerConfig> config; - private final AtomicReference<ConcurrentHashMap<String, List<Rule>>> rules; + private final AtomicReference<Map<String, List<Rule>>> rules; Review comment: +1 - I missed that. Perhaps the best approach here is to keep the definition of the variable to `AtomicReference<Map<String, List<Rule>>>` And add 2 unit tests to ensure 1 - we can not add to/ remove from the map 2 - we can not mutate the rules for an entry in a map. This way if someone changes this behavior in the future we can catch it easily, and changing the type of Map/ List is easy as well. ---------------------------------------------------------------- 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]
