org.apache.solr.cloud.rule

## Class ReplicaAssigner

- java.lang.Object
- - org.apache.solr.cloud.rule.ReplicaAssigner

-     public class ReplicaAssigner
      extends Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ReplicaAssigner.Position`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `Map<String,SnitchContext>` | `failedNodes`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReplicaAssigner(List<Rule> rules, Map<String,Integer> shardVsReplicaCount, List snitches, Map<String,Map<String,Integer>> shardVsNodes, List<String> participatingLiveNodes, CoreContainer cc, ClusterState clusterState)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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()`
    `protected SnitchContext` | `getSnitchCtx(String node, org.apache.solr.cloud.rule.ReplicaAssigner.SnitchInfoImpl info, CoreContainer cc)`
    `static Iterator<int[]>` | `permutations(int level)` get all permutations for the int[] whose items are 0..level
    `static void` | `verifySnitchConf(CoreContainer cc, List snitchConf)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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,
                                 CoreContainer cc,
                                 ClusterState clusterState)

      Parameters:
        `shardVsReplicaCount` - shard names vs no:of replicas required for each of those shards
        `snitches` - snitches details
        `shardVsNodes` - The current state of the system. can be an empty map if no nodes are created in this collection till now

  - ### Method Detail

    - #### getNodeVsTags

          public Map<String,Map<String,Object>> getNodeVsTags()

    - #### getNodeMappings

          public 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

    - #### 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,
                                               CoreContainer cc)

    - #### verifySnitchConf

          public static void verifySnitchConf(CoreContainer cc,
                                              List snitchConf)

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.