Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-17877: fix: don't eagerly fetch DistributedCollectionCommandContext

David Smileyb9be5737969a
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/DistributedCollectionCommandContext.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/DistributedCollectionCommandContext.java
index 1e440a534fc..386778b886b 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/DistributedCollectionCommandContext.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/DistributedCollectionCommandContext.java
@@ -27,16 +27,12 @@ import org.apache.solr.handler.component.ShardHandler;
public class DistributedCollectionCommandContext implements CollectionCommandContext {
private final CoreContainer coreContainer;
- private final DistributedClusterStateUpdater distributedClusterStateUpdater;
private final ExecutorService executorService;
public DistributedCollectionCommandContext(
CoreContainer coreContainer, ExecutorService executorService) {
// note: coreContainer.getZkController() is not yet instantiated; don't call it right now
this.coreContainer = coreContainer;
- this.distributedClusterStateUpdater =
- new DistributedClusterStateUpdater(
- coreContainer.getConfig().getCloudConfig().getDistributedClusterStateUpdates());
this.executorService = executorService;
}
@@ -69,7 +65,7 @@ public class DistributedCollectionCommandContext implements CollectionCommandCon
@Override
public DistributedClusterStateUpdater getDistributedClusterStateUpdater() {
- return this.distributedClusterStateUpdater;
+ return this.coreContainer.getZkController().getDistributedClusterStateUpdater();
}
@Override