public class ReplicaAssigner extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ReplicaAssigner.Position |
Modifier and Type | Field and Description |
---|---|
Map<String,SnitchContext> |
failedNodes |
Constructor and Description |
---|
ReplicaAssigner(List<Rule> rules,
Map<String,Integer> shardVsReplicaCount,
List snitches,
Map<String,Map<String,Integer>> shardVsNodes,
List<String> liveNodes,
CoreContainer cc,
ClusterState clusterState) |
Modifier and Type | Method and Description |
---|---|
Map<ReplicaAssigner.Position,String> |
getNodeMappings()
For each shard return a new set of nodes where the replicas need to be created satisfying
the specified rule
|
Map<String,Map<String,Object>> |
getNodeVsTags() |
static Iterator<int[]> |
permutations(int level)
get all permutations for the int[] whose items are 0..level
|
static void |
verifySnitchConf(CoreContainer cc,
List snitchConf) |
public Map<String,SnitchContext> failedNodes
public ReplicaAssigner(List<Rule> rules, Map<String,Integer> shardVsReplicaCount, List snitches, Map<String,Map<String,Integer>> shardVsNodes, List<String> liveNodes, CoreContainer cc, ClusterState clusterState)
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 nowpublic Map<ReplicaAssigner.Position,String> getNodeMappings()
public static Iterator<int[]> permutations(int level)
public static void verifySnitchConf(CoreContainer cc, List snitchConf)
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.