Class Assign


  • public class Assign
    extends Object
    • Constructor Detail

      • Assign

        public Assign()
    • Method Detail

      • getCounterNodePath

        public static String getCounterNodePath​(String collection)
      • incAndGetId

        public static int incAndGetId​(org.apache.solr.client.solrj.cloud.DistribStateManager stateManager,
                                      String collection,
                                      int defaultValue)
      • assignCoreNodeName

        public static String assignCoreNodeName​(org.apache.solr.client.solrj.cloud.DistribStateManager stateManager,
                                                org.apache.solr.common.cloud.DocCollection collection)
      • assignShard

        public static String assignShard​(org.apache.solr.common.cloud.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,
                                               org.apache.solr.common.cloud.Replica.Type type,
                                               int replicaNum)
      • buildSolrCoreName

        public static String buildSolrCoreName​(org.apache.solr.client.solrj.cloud.DistribStateManager stateManager,
                                               String collectionName,
                                               org.apache.solr.common.cloud.DocCollection collection,
                                               String shard,
                                               org.apache.solr.common.cloud.Replica.Type type,
                                               boolean newCollection)
      • buildSolrCoreName

        public static String buildSolrCoreName​(org.apache.solr.client.solrj.cloud.DistribStateManager stateManager,
                                               org.apache.solr.common.cloud.DocCollection collection,
                                               String shard,
                                               org.apache.solr.common.cloud.Replica.Type type)
      • getLiveOrLiveAndCreateNodeSetList

        public static List<String> getLiveOrLiveAndCreateNodeSetList​(Set<String> liveNodes,
                                                                     org.apache.solr.common.cloud.ZkNodeProps message,
                                                                     Random random,
                                                                     org.apache.solr.client.solrj.cloud.DistribStateManager zk)
      • filterNonDataNodes

        public static Collection<String> filterNonDataNodes​(org.apache.solr.client.solrj.cloud.DistribStateManager zk,
                                                            Collection<String> liveNodes)