Class Assign
- java.lang.Object
-
- org.apache.solr.cloud.api.collections.Assign
-
public class Assign extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAssign.AssignmentExceptionThrown if there is an exception while assigning nodes for replicasstatic classAssign.AssignRequeststatic classAssign.AssignRequestBuilderstatic interfaceAssign.AssignStrategystatic classAssign.AssignStrategyFactorystatic classAssign.LegacyAssignStrategystatic classAssign.PolicyBasedAssignStrategystatic classAssign.RulesBasedAssignStrategy
-
Constructor Summary
Constructors Constructor Description Assign()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringassignCoreNodeName(DistribStateManager stateManager, DocCollection collection)static StringassignShard(DocCollection collection, Integer numShards)Assign a new unique id up to slices count - then add replicas evenly.static StringbuildSolrCoreName(String collectionName, String shard, Replica.Type type, int replicaNum)static StringbuildSolrCoreName(DistribStateManager stateManager, DocCollection collection, String shard, Replica.Type type)static StringbuildSolrCoreName(DistribStateManager stateManager, DocCollection collection, String shard, Replica.Type type, boolean newCollection)static StringgetCounterNodePath(String collection)static List<String>getLiveOrLiveAndCreateNodeSetList(Set<String> liveNodes, ZkNodeProps message, Random random)static List<ReplicaPosition>getNodesForNewReplicas(ClusterState clusterState, String collectionName, String shard, int nrtReplicas, int tlogReplicas, int pullReplicas, Object createNodeSet, SolrCloudManager cloudManager)static List<ReplicaPosition>getPositionsUsingPolicy(String collName, List<String> shardNames, int nrtReplicas, int tlogReplicas, int pullReplicas, String policyName, SolrCloudManager cloudManager, List<String> nodesList)static intincAndGetId(DistribStateManager stateManager, String collection, int defaultValue)static booleanusePolicyFramework(SolrCloudManager cloudManager)Note: where possible, theusePolicyFramework(DocCollection, SolrCloudManager)method should be used instead of this methodstatic booleanusePolicyFramework(DocCollection collection, SolrCloudManager cloudManager)
-
-
-
Method Detail
-
incAndGetId
public static int incAndGetId(DistribStateManager stateManager, String collection, int defaultValue)
-
assignCoreNodeName
public static String assignCoreNodeName(DistribStateManager stateManager, DocCollection collection)
-
assignShard
public static String assignShard(DocCollection collection, Integer numShards)
Assign a new unique id up to slices count - then add replicas evenly.- Returns:
- the assigned shard id
-
buildSolrCoreName
public static String buildSolrCoreName(String collectionName, String shard, Replica.Type type, int replicaNum)
-
buildSolrCoreName
public static String buildSolrCoreName(DistribStateManager stateManager, DocCollection collection, String shard, Replica.Type type, boolean newCollection)
-
buildSolrCoreName
public static String buildSolrCoreName(DistribStateManager stateManager, DocCollection collection, String shard, Replica.Type type)
-
getLiveOrLiveAndCreateNodeSetList
public static List<String> getLiveOrLiveAndCreateNodeSetList(Set<String> liveNodes, ZkNodeProps message, Random random)
-
usePolicyFramework
public static boolean usePolicyFramework(SolrCloudManager cloudManager) throws IOException, InterruptedException
Note: where possible, theusePolicyFramework(DocCollection, SolrCloudManager)method should be used instead of this method- Returns:
- true if autoscaling policy framework should be used for replica placement
- Throws:
IOExceptionInterruptedException
-
usePolicyFramework
public static boolean usePolicyFramework(DocCollection collection, SolrCloudManager cloudManager) throws IOException, InterruptedException
- Returns:
- true if auto scaling policy framework should be used for replica placement for this collection, otherwise false
- Throws:
IOExceptionInterruptedException
-
getNodesForNewReplicas
public static List<ReplicaPosition> getNodesForNewReplicas(ClusterState clusterState, String collectionName, String shard, int nrtReplicas, int tlogReplicas, int pullReplicas, Object createNodeSet, SolrCloudManager cloudManager) throws IOException, InterruptedException, Assign.AssignmentException
-
getPositionsUsingPolicy
public static List<ReplicaPosition> getPositionsUsingPolicy(String collName, List<String> shardNames, int nrtReplicas, int tlogReplicas, int pullReplicas, String policyName, SolrCloudManager cloudManager, List<String> nodesList) throws IOException, InterruptedException, Assign.AssignmentException
-
-