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 class
Assign.AssignmentException
Thrown if there is an exception while assigning nodes for replicasstatic class
Assign.AssignRequest
static class
Assign.AssignRequestBuilder
static interface
Assign.AssignStrategy
static class
Assign.AssignStrategyFactory
static class
Assign.LegacyAssignStrategy
static class
Assign.PolicyBasedAssignStrategy
static class
Assign.RulesBasedAssignStrategy
-
Constructor Summary
Constructors Constructor Description Assign()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
assignCoreNodeName(DistribStateManager stateManager, DocCollection collection)
static String
assignShard(DocCollection collection, Integer numShards)
Assign a new unique id up to slices count - then add replicas evenly.static String
buildSolrCoreName(String collectionName, String shard, Replica.Type type, int replicaNum)
static String
buildSolrCoreName(DistribStateManager stateManager, DocCollection collection, String shard, Replica.Type type)
static String
buildSolrCoreName(DistribStateManager stateManager, DocCollection collection, String shard, Replica.Type type, boolean newCollection)
static String
getCounterNodePath(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 int
incAndGetId(DistribStateManager stateManager, String collection, int defaultValue)
static boolean
usePolicyFramework(SolrCloudManager cloudManager)
Note: where possible, theusePolicyFramework(DocCollection, SolrCloudManager)
method should be used instead of this methodstatic boolean
usePolicyFramework(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:
IOException
InterruptedException
-
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:
IOException
InterruptedException
-
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
-
-