dsmiley commented on code in PR #1248: URL: https://github.com/apache/solr/pull/1248#discussion_r1056534772
########## solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java: ########## @@ -1222,11 +1222,22 @@ public boolean isDirectUpdatesToLeadersOnly() { /** * If caches are expired they are refreshed after acquiring a lock. use this to set the number of * locks + * + * @deprecated use {@link CloudHttp2SolrClient.Builder#setParallelCacheRefreshes(int)} instead */ + @Deprecated public void setParallelCacheRefreshes(int n) { locks = objectList(n); } + /** + * If caches are expired they are refreshed after acquiring a lock. This method sets the number of + * locks. It is used by the Builder only. + */ + void setParallelCacheRefreshesLocks(int parallelCacheRefreshesLocks) { + locks = objectList(parallelCacheRefreshesLocks); + } + Review Comment: I don't see this used by the builder, I see it used by the constructor. I think we don't need this method; it could be inline'ed. ########## solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java: ########## @@ -134,6 +135,7 @@ protected boolean wasCommError(Throwable rootCause) { /** Constructs {@link CloudHttp2SolrClient} instances from provided configuration. */ public static class Builder { + public int parallelCacheRefreshesLocks = 3; Review Comment: not protected like the rest? Furthermore, even though field order doesn't truly matter, I would put an obscure setting like this last, not first. First ones should be most central/important. ########## solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java: ########## @@ -97,6 +97,7 @@ protected CloudHttp2SolrClient(Builder builder) { } else { this.stateProvider = builder.stateProvider; } + this.setParallelCacheRefreshesLocks(builder.parallelCacheRefreshesLocks); Review Comment: Instead of using a deprecated setter, just set the field directly. Notice the rest of this method sets fields directly. ########## solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java: ########## @@ -249,6 +251,17 @@ public Builder withParallelUpdates(boolean parallelUpdates) { return this; } + /** + * Tells {@link CloudHttp2SolrClient.Builder} if caches are expired then they are refreshed Review Comment: ```suggestion * When caches are expired then they are refreshed ``` "Tells XXX-Builder" seems like useless words -- 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: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org