You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/12/21 00:26:35 UTC

[GitHub] [solr] noblepaul commented on a diff in pull request #1242: SOLR-16580: Avoid making copies of DocCollection for PRS updates

noblepaul commented on code in PR #1242:
URL: https://github.com/apache/solr/pull/1242#discussion_r1053868722


##########
solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java:
##########
@@ -488,4 +468,35 @@ public interface CollectionStateProps {
     String SHARDS = "shards";
     String PER_REPLICA_STATE = "perReplicaState";
   }
+
+  public static class PrsSupplier implements Supplier<PerReplicaStates> {
+
+    protected volatile PerReplicaStates prs;
+
+    PrsSupplier() {}
+
+    PrsSupplier(PerReplicaStates prs) {
+      this.prs = prs;
+    }
+
+    @Override
+    public PerReplicaStates get() {
+      return prs;
+    }
+  }
+
+  public static final ThreadLocal<DocCollection.PrsSupplier> REPLICASTATES_PROVIDER =

Review Comment:
   Yes, there is. The  only reason why I used the ThreadLocal Option was to minimize the changes. However, I think I should explore that route



-- 
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-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org