[ https://issues.apache.org/jira/browse/SOLR-16507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17703331#comment-17703331 ]
Andrzej Bialecki commented on SOLR-16507: ----------------------------------------- Thanks [~dsmiley] for bringing this to my attention. The reason we used the existing NodeStateProvider abstraction in the replica placement code was that retrieving per-node metrics is messy and quirky, all of which is hidden in SolrClientNodeStateProvider. The internal structure (snitches and co) can and should be refactored and simplified because these concepts are not used anywhere else anymore, they are legacy abstractions from the time when they were used for collection rules DSL. However, IMHO something like NodeStateProvider still has its place. No matter what you replace it with, the complexity of retrieving per-node attributes will still be present somewhere- and hiding it in a NodeStateProvider (or similar concept) as a high-level API at least gives us a possibility of reuse. If we were to put all this nasty code into AttributeFetcherImpl then we would pretty much limit its usefulness only to the placement code. SolrCloudManager is perhaps no longer useful anymore and can be factored out, but IMHO something equivalent to NodeStateProvider is still needed. Re. "snitchSession" - this is now used only in `ImplicitSnitch` for caching the node roles, in order to avoid loading this data from ZK for every node. > Remove NodeStateProvider & Snitch > --------------------------------- > > Key: SOLR-16507 > URL: https://issues.apache.org/jira/browse/SOLR-16507 > Project: Solr > Issue Type: Task > Reporter: David Smiley > Priority: Major > Labels: newdev > > The NodeStateProvider is a relic relating to the old autoscaling framework > that was removed in Solr 9. The only remaining usage of it is for > SplitShardCmd to check the disk space. For this, it could use the metrics > api. > I think we'll observe that Snitch and other classes in > org.apache.solr.common.cloud.rule can be removed as well, as it's related to > NodeStateProvider. > Only > org.apache.solr.cluster.placement.impl.AttributeFetcherImpl#getMetricSnitchTag > and org.apache.solr.cluster.placement.impl.NodeMetricImpl refer to some > constants in the code to be removed. Those constants could move out, > consolidated somewhere we think is appropriate. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org