Class DistributedClusterStateUpdater

java.lang.Object
org.apache.solr.cloud.DistributedClusterStateUpdater

public class DistributedClusterStateUpdater extends Object
Gives access to distributed cluster state update methods and allows code to inquire whether distributed state update is enabled.
  • Constructor Details

    • DistributedClusterStateUpdater

      public DistributedClusterStateUpdater(boolean useDistributedStateUpdate)
      Builds an instance with the specified behavior regarding distribution of state updates, allowing to know distributed updates are not enabled (parameter useDistributedStateUpdate is false), or when they are (parameter is true), gives access to methods and classes allowing the execution of the updates.
      Parameters:
      useDistributedStateUpdate - when this parameter is false, only method expected to ever be called on this instance is isDistributedStateUpdate(), and it will return false.
  • Method Details

    • createStateChangeRecorder

      public DistributedClusterStateUpdater.StateChangeRecorder createStateChangeRecorder(String collectionName, boolean isCollectionCreation)
      Create a new instance of DistributedClusterStateUpdater.StateChangeRecorder for a given collection and a given intention (collection creation vs. operations on an existing collection)
    • doSingleStateUpdate

      public void doSingleStateUpdate(DistributedClusterStateUpdater.MutatingCommand command, org.apache.solr.common.cloud.ZkNodeProps message, org.apache.solr.client.solrj.cloud.SolrCloudManager scm, org.apache.solr.common.cloud.ZkStateReader zkStateReader) throws org.apache.zookeeper.KeeperException, InterruptedException
      Syntactic sugar to allow a single change to the cluster state to be made in a single call.
      Throws:
      org.apache.zookeeper.KeeperException
      InterruptedException
    • executeNodeDownStateUpdate

      public void executeNodeDownStateUpdate(String nodeName, org.apache.solr.common.cloud.ZkStateReader zkStateReader)
    • isDistributedStateUpdate

      public boolean isDistributedStateUpdate()
      When this method returns false the legacy behavior of enqueueing cluster state update messages to Overseer should be used and no other method of this class should be called.