noblepaul commented on code in PR #1242: URL: https://github.com/apache/solr/pull/1242#discussion_r1061966859
########## solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java: ########## @@ -465,7 +467,11 @@ public boolean isPerReplicaState() { } public PerReplicaStates getPerReplicaStates() { - return perReplicaStates; + return prsSupplier != null ? prsSupplier.get() : null; Review Comment: > What is the purpose of fetching prs state lazily. PRS changes all the time. it has to be always fetched just in time > would be good to make doccollection object immutable We cannot make `DocCollection` immutable. it defeats the purpose. PRS states change too frequently. If we make make copies of these very large objects every-time a PRS entry is modified, we end up creating several times more objects than in non-PRS collections -- 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