noblepaul commented on code in PR #1242:
URL: https://github.com/apache/solr/pull/1242#discussion_r1096908318
##########
solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java:
##########
@@ -488,4 +494,27 @@ public interface CollectionStateProps {
String SHARDS = "shards";
String PER_REPLICA_STATE = "perReplicaState";
}
+
+ public static class PrsSupplier implements Supplier<PerReplicaStates> {
+
+ private volatile PerReplicaStates prs;
+
+ private Supplier<PerReplicaStates> supplier;
+
+ public PrsSupplier(Supplier<PerReplicaStates> supplier) {
+ this.supplier = supplier;
+ }
+
+ public PrsSupplier(PerReplicaStates prs) {
+ this.prs = prs;
+ }
+
+ @Override
+ public PerReplicaStates get() {
+ if (prs == null) {
Review Comment:
this object is constructed before `DocCollection` is constructed
##########
solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java:
##########
@@ -488,4 +494,27 @@ public interface CollectionStateProps {
String SHARDS = "shards";
String PER_REPLICA_STATE = "perReplicaState";
}
+
+ public static class PrsSupplier implements Supplier<PerReplicaStates> {
+
+ private volatile PerReplicaStates prs;
+
+ private Supplier<PerReplicaStates> supplier;
+
+ public PrsSupplier(Supplier<PerReplicaStates> supplier) {
+ this.supplier = supplier;
+ }
+
+ public PrsSupplier(PerReplicaStates prs) {
+ this.prs = prs;
+ }
+
+ @Override
+ public PerReplicaStates get() {
+ if (prs == null) {
Review Comment:
this object is created before `DocCollection` is constructed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]