Package org.apache.solr.cloud
Enum DistributedClusterStateUpdater.MutatingCommand
- java.lang.Object
-
- java.lang.Enum<DistributedClusterStateUpdater.MutatingCommand>
-
- org.apache.solr.cloud.DistributedClusterStateUpdater.MutatingCommand
-
- All Implemented Interfaces:
Serializable
,Comparable<DistributedClusterStateUpdater.MutatingCommand>
- Enclosing class:
- DistributedClusterStateUpdater
public static enum DistributedClusterStateUpdater.MutatingCommand extends Enum<DistributedClusterStateUpdater.MutatingCommand>
Naming of enum instances are the mutator object name (e.g.Cluster
forClusterStateMutator
orCollection
forCollectionMutator
) followed by the method name of the mutator. For exampleSliceAddReplica
representsSliceMutator.addReplica(org.apache.solr.common.cloud.ClusterState, org.apache.solr.common.cloud.ZkNodeProps)
.Even though the various mutator classes do not implement any common interface, luckily their constructors and methods take the same set of parameters so all can be called from the enum method
buildWriteCommand(SolrCloudManager, ClusterState, ZkNodeProps)
.Given that
OverseerAction.DOWNNODE
is different (it returns a list of write commands and impacts more than one collection), it is handled specifically inDistributedClusterStateUpdater.CollectionNodeDownChangeCalculator.executeNodeDownStateUpdate(java.lang.String, org.apache.solr.common.cloud.ZkStateReader)
.
-
-
Enum Constant Summary
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ZkWriteCommand
buildWriteCommand(org.apache.solr.client.solrj.cloud.SolrCloudManager scm, org.apache.solr.common.cloud.ClusterState cs, org.apache.solr.common.cloud.ZkNodeProps message)
mutating commands that return a single ZkWriteCommand override this methodString
getCollectionName(org.apache.solr.common.cloud.ZkNodeProps message)
static DistributedClusterStateUpdater.MutatingCommand
getCommandFor(org.apache.solr.common.params.CollectionParams.CollectionAction collectionAction)
boolean
isCollectionCreation()
Given only one command creates a collectionClusterCreateCollection
, the default implementation is provided here.static DistributedClusterStateUpdater.MutatingCommand
valueOf(String name)
Returns the enum constant of this type with the specified name.static DistributedClusterStateUpdater.MutatingCommand[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BalanceShardsUnique
public static final DistributedClusterStateUpdater.MutatingCommand BalanceShardsUnique
-
ClusterCreateCollection
public static final DistributedClusterStateUpdater.MutatingCommand ClusterCreateCollection
-
ClusterDeleteCollection
public static final DistributedClusterStateUpdater.MutatingCommand ClusterDeleteCollection
-
CollectionDeleteShard
public static final DistributedClusterStateUpdater.MutatingCommand CollectionDeleteShard
-
CollectionModifyCollection
public static final DistributedClusterStateUpdater.MutatingCommand CollectionModifyCollection
-
CollectionCreateShard
public static final DistributedClusterStateUpdater.MutatingCommand CollectionCreateShard
-
ReplicaAddReplicaProperty
public static final DistributedClusterStateUpdater.MutatingCommand ReplicaAddReplicaProperty
-
ReplicaDeleteReplicaProperty
public static final DistributedClusterStateUpdater.MutatingCommand ReplicaDeleteReplicaProperty
-
ReplicaSetState
public static final DistributedClusterStateUpdater.MutatingCommand ReplicaSetState
-
SliceAddReplica
public static final DistributedClusterStateUpdater.MutatingCommand SliceAddReplica
-
SliceAddRoutingRule
public static final DistributedClusterStateUpdater.MutatingCommand SliceAddRoutingRule
-
SliceRemoveReplica
public static final DistributedClusterStateUpdater.MutatingCommand SliceRemoveReplica
-
SliceRemoveRoutingRule
public static final DistributedClusterStateUpdater.MutatingCommand SliceRemoveRoutingRule
-
SliceSetShardLeader
public static final DistributedClusterStateUpdater.MutatingCommand SliceSetShardLeader
-
SliceUpdateShardState
public static final DistributedClusterStateUpdater.MutatingCommand SliceUpdateShardState
-
-
Method Detail
-
values
public static DistributedClusterStateUpdater.MutatingCommand[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DistributedClusterStateUpdater.MutatingCommand c : DistributedClusterStateUpdater.MutatingCommand.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DistributedClusterStateUpdater.MutatingCommand valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
buildWriteCommand
public abstract ZkWriteCommand buildWriteCommand(org.apache.solr.client.solrj.cloud.SolrCloudManager scm, org.apache.solr.common.cloud.ClusterState cs, org.apache.solr.common.cloud.ZkNodeProps message)
mutating commands that return a single ZkWriteCommand override this method
-
getCollectionName
public String getCollectionName(org.apache.solr.common.cloud.ZkNodeProps message)
-
getCommandFor
public static DistributedClusterStateUpdater.MutatingCommand getCommandFor(org.apache.solr.common.params.CollectionParams.CollectionAction collectionAction)
- Returns:
- the
DistributedClusterStateUpdater.MutatingCommand
corresponding to the passedCollectionParams.CollectionAction
ornull
if no cluster state update command is defined for that action (given thatCollectionParams.CollectionAction
are used for the Collection API and only some are used for the cluster state updates, this is expected).
-
isCollectionCreation
public boolean isCollectionCreation()
Given only one command creates a collectionClusterCreateCollection
, the default implementation is provided here.
-
-