Package org.apache.solr.cloud.rule
Class ReplicaAssigner
- java.lang.Object
-
- org.apache.solr.cloud.rule.ReplicaAssigner
-
public class ReplicaAssigner extends Object
-
-
Field Summary
Fields Modifier and Type Field Description Map<String,SnitchContext>
failedNodes
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<ReplicaPosition,String>
getNodeMappings()
For each shard return a new set of nodes where the replicas need to be created satisfying the specified ruleMap<String,Map<String,Object>>
getNodeVsTags()
protected SnitchContext
getSnitchCtx(String node, org.apache.solr.cloud.rule.ReplicaAssigner.SnitchInfoImpl info, SolrCloudManager cloudManager)
static Iterator<int[]>
permutations(int level)
get all permutations for the int[] whose items are 0..levelstatic void
verifySnitchConf(SolrCloudManager cloudManager, List snitchConf)
-
-
-
Field Detail
-
failedNodes
public Map<String,SnitchContext> failedNodes
-
-
Constructor Detail
-
ReplicaAssigner
public ReplicaAssigner(List<Rule> rules, Map<String,Integer> shardVsReplicaCount, List snitches, Map<String,Map<String,Integer>> shardVsNodes, List<String> participatingLiveNodes, SolrCloudManager cloudManager, ClusterState clusterState)
- Parameters:
shardVsReplicaCount
- shard names vs no:of replicas required for each of those shardssnitches
- snitches detailsshardVsNodes
- The current state of the system. can be an empty map if no nodes are created in this collection till now
-
-
Method Detail
-
getNodeMappings
public Map<ReplicaPosition,String> getNodeMappings()
For each shard return a new set of nodes where the replicas need to be created satisfying the specified rule
-
permutations
public static Iterator<int[]> permutations(int level)
get all permutations for the int[] whose items are 0..level
-
getSnitchCtx
protected SnitchContext getSnitchCtx(String node, org.apache.solr.cloud.rule.ReplicaAssigner.SnitchInfoImpl info, SolrCloudManager cloudManager)
-
verifySnitchConf
public static void verifySnitchConf(SolrCloudManager cloudManager, List snitchConf)
-
-