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
Strategy for assigning replicas to nodes.
-
Field Summary
Fields Modifier and Type Field Description static String
PLACEMENTPLUGIN_DEFAULT_SYSPROP
static String
SYSTEM_COLL_PREFIX
-
Constructor Summary
Constructors Constructor Description Assign()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
assignCoreNodeName(org.apache.solr.client.solrj.cloud.DistribStateManager stateManager, org.apache.solr.common.cloud.DocCollection collection)
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.static String
buildSolrCoreName(String collectionName, String shard, org.apache.solr.common.cloud.Replica.Type type, int replicaNum)
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)
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)
static Assign.AssignStrategy
createAssignStrategy(CoreContainer coreContainer)
Creates the appropriate instance ofAssign.AssignStrategy
based on how the cluster and/or individual collections are configured.static Collection<String>
filterNonDataNodes(org.apache.solr.client.solrj.cloud.DistribStateManager zk, Collection<String> liveNodes)
static String
getCounterNodePath(String collection)
static List<String>
getLiveOrLiveAndCreateNodeSetList(Set<String> liveNodes, org.apache.solr.common.cloud.ZkNodeProps message, Random random, org.apache.solr.client.solrj.cloud.DistribStateManager zk)
static List<org.apache.solr.common.cloud.ReplicaPosition>
getNodesForNewReplicas(org.apache.solr.common.cloud.ClusterState clusterState, String collectionName, String shard, int nrtReplicas, int tlogReplicas, int pullReplicas, Object createNodeSet, org.apache.solr.client.solrj.cloud.SolrCloudManager cloudManager, CoreContainer coreContainer)
static int
incAndGetId(org.apache.solr.client.solrj.cloud.DistribStateManager stateManager, String collection, int defaultValue)
-
-
-
Field Detail
-
SYSTEM_COLL_PREFIX
public static final String SYSTEM_COLL_PREFIX
- See Also:
- Constant Field Values
-
PLACEMENTPLUGIN_DEFAULT_SYSPROP
public static final String PLACEMENTPLUGIN_DEFAULT_SYSPROP
- See Also:
- Constant Field Values
-
-
Method Detail
-
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)
-
getNodesForNewReplicas
public static List<org.apache.solr.common.cloud.ReplicaPosition> getNodesForNewReplicas(org.apache.solr.common.cloud.ClusterState clusterState, String collectionName, String shard, int nrtReplicas, int tlogReplicas, int pullReplicas, Object createNodeSet, org.apache.solr.client.solrj.cloud.SolrCloudManager cloudManager, CoreContainer coreContainer) throws IOException, InterruptedException, Assign.AssignmentException
-
createAssignStrategy
public static Assign.AssignStrategy createAssignStrategy(CoreContainer coreContainer)
Creates the appropriate instance ofAssign.AssignStrategy
based on how the cluster and/or individual collections are configured.If
PlacementPlugin
instance is null this call will return a strategy fromSimplePlacementFactory
, otherwisePlacementPluginAssignStrategy
will be used.
-
-