Package org.apache.solr.cloud
Class DistributedClusterStateUpdater
java.lang.Object
org.apache.solr.cloud.DistributedClusterStateUpdater
Gives access to distributed cluster state update methods and allows code to inquire whether
distributed state update is enabled.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumNaming of enum instances are the mutator object name (e.g.static classClass handling the distributed updates of collection's Zookeeper filesstate.jsonbased on multiple updates applied to a single collection (as is sometimes done by *Cmd classes implementing the Collection API commands). -
Constructor Summary
ConstructorsConstructorDescriptionDistributedClusterStateUpdater(boolean useDistributedStateUpdate) Builds an instance with the specified behavior regarding distribution of state updates, allowing to know distributed updates are not enabled (parameteruseDistributedStateUpdateisfalse), or when they are (parameter istrue), gives access to methods and classes allowing the execution of the updates. -
Method Summary
Modifier and TypeMethodDescriptioncreateStateChangeRecorder(String collectionName, boolean isCollectionCreation) Create a new instance ofDistributedClusterStateUpdater.StateChangeRecorderfor a given collection and a given intention (collection creation vs.voiddoSingleStateUpdate(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) Syntactic sugar to allow a single change to the cluster state to be made in a single call.voidexecuteNodeDownStateUpdate(String nodeName, org.apache.solr.common.cloud.ZkStateReader zkStateReader) booleanWhen this method returnsfalsethe legacy behavior of enqueueing cluster state update messages to Overseer should be used and no other method of this class should be called.
-
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 (parameteruseDistributedStateUpdateisfalse), or when they are (parameter istrue), gives access to methods and classes allowing the execution of the updates.- Parameters:
useDistributedStateUpdate- when this parameter isfalse, only method expected to ever be called on this instance isisDistributedStateUpdate(), and it will returnfalse.
-
-
Method Details
-
createStateChangeRecorder
public DistributedClusterStateUpdater.StateChangeRecorder createStateChangeRecorder(String collectionName, boolean isCollectionCreation) Create a new instance ofDistributedClusterStateUpdater.StateChangeRecorderfor 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.KeeperExceptionInterruptedException
-
executeNodeDownStateUpdate
public void executeNodeDownStateUpdate(String nodeName, org.apache.solr.common.cloud.ZkStateReader zkStateReader) -
isDistributedStateUpdate
public boolean isDistributedStateUpdate()When this method returnsfalsethe legacy behavior of enqueueing cluster state update messages to Overseer should be used and no other method of this class should be called.
-