Interface Assign.AssignStrategy
-
- All Known Implementing Classes:
PlacementPluginAssignStrategy
- Enclosing class:
- Assign
public static interface Assign.AssignStrategy
Strategy for assigning replicas to nodes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<org.apache.solr.common.cloud.ReplicaPosition>
assign(org.apache.solr.client.solrj.cloud.SolrCloudManager solrCloudManager, List<Assign.AssignRequest> assignRequests)
Assign new replicas to nodes.default List<org.apache.solr.common.cloud.ReplicaPosition>
assign(org.apache.solr.client.solrj.cloud.SolrCloudManager solrCloudManager, Assign.AssignRequest... assignRequests)
Assign new replicas to nodes.default Map<org.apache.solr.common.cloud.Replica,String>
computeReplicaBalancing(org.apache.solr.client.solrj.cloud.SolrCloudManager solrCloudManager, Set<String> nodes, int maxBalanceSkew)
Balance replicas across nodes.default void
verifyDeleteCollection(org.apache.solr.client.solrj.cloud.SolrCloudManager solrCloudManager, org.apache.solr.common.cloud.DocCollection collection)
Verify that deleting a collection doesn't violate the replica assignment constraints.default void
verifyDeleteReplicas(org.apache.solr.client.solrj.cloud.SolrCloudManager solrCloudManager, org.apache.solr.common.cloud.DocCollection collection, String shardName, Set<org.apache.solr.common.cloud.Replica> replicas)
Verify that deleting these replicas doesn't violate the replica assignment constraints.
-
-
-
Method Detail
-
assign
default List<org.apache.solr.common.cloud.ReplicaPosition> assign(org.apache.solr.client.solrj.cloud.SolrCloudManager solrCloudManager, Assign.AssignRequest... assignRequests) throws Assign.AssignmentException, IOException, InterruptedException
Assign new replicas to nodes. If multipleAssign.AssignRequest
s are provided, then everyReplicaPosition
made for anAssign.AssignRequest
will be applied to theSolrCloudManager
's state when processing subsequentAssign.AssignRequest
s. Therefore, the order in whichAssign.AssignRequest
s are provided can and will affect theReplicaPosition
s returned.- Parameters:
solrCloudManager
- current instance ofSolrCloudManager
.assignRequests
- assign request.- Returns:
- list of
ReplicaPosition
-s for new replicas. - Throws:
Assign.AssignmentException
- when assignment request cannot produce any valid assignments.IOException
InterruptedException
-
assign
List<org.apache.solr.common.cloud.ReplicaPosition> assign(org.apache.solr.client.solrj.cloud.SolrCloudManager solrCloudManager, List<Assign.AssignRequest> assignRequests) throws Assign.AssignmentException, IOException, InterruptedException
Assign new replicas to nodes. If multipleAssign.AssignRequest
s are provided, then everyReplicaPosition
made for anAssign.AssignRequest
will be applied to theSolrCloudManager
's state when processing subsequentAssign.AssignRequest
s. Therefore, the order in whichAssign.AssignRequest
s are provided can and will affect theReplicaPosition
s returned.- Parameters:
solrCloudManager
- current instance ofSolrCloudManager
.assignRequests
- list of assign requests to process together ().- Returns:
- list of
ReplicaPosition
-s for new replicas. - Throws:
Assign.AssignmentException
- when assignment request cannot produce any valid assignments.IOException
InterruptedException
-
computeReplicaBalancing
default Map<org.apache.solr.common.cloud.Replica,String> computeReplicaBalancing(org.apache.solr.client.solrj.cloud.SolrCloudManager solrCloudManager, Set<String> nodes, int maxBalanceSkew) throws Assign.AssignmentException, IOException, InterruptedException
Balance replicas across nodes.- Parameters:
solrCloudManager
- current instance ofSolrCloudManager
.nodes
- to compute replica balancing across.maxBalanceSkew
- to ensure strictness of replica balancing.- Returns:
- Map from Replica to the Node where that Replica should be moved.
- Throws:
Assign.AssignmentException
- when balance request cannot produce any valid assignments.IOException
InterruptedException
-
verifyDeleteCollection
default void verifyDeleteCollection(org.apache.solr.client.solrj.cloud.SolrCloudManager solrCloudManager, org.apache.solr.common.cloud.DocCollection collection) throws Assign.AssignmentException, IOException, InterruptedException
Verify that deleting a collection doesn't violate the replica assignment constraints.- Parameters:
solrCloudManager
- current instance ofSolrCloudManager
.collection
- collection to delete.- Throws:
Assign.AssignmentException
- when deleting the collection would violate replica assignment constraints.IOException
- on general errors.InterruptedException
-
verifyDeleteReplicas
default void verifyDeleteReplicas(org.apache.solr.client.solrj.cloud.SolrCloudManager solrCloudManager, org.apache.solr.common.cloud.DocCollection collection, String shardName, Set<org.apache.solr.common.cloud.Replica> replicas) throws Assign.AssignmentException, IOException, InterruptedException
Verify that deleting these replicas doesn't violate the replica assignment constraints.- Parameters:
solrCloudManager
- current instance ofSolrCloudManager
.collection
- collection to delete replicas from.shardName
- shard name.replicas
- replicas to delete.- Throws:
Assign.AssignmentException
- when deleting the replicas would violate replica assignment constraints.IOException
- on general errors.InterruptedException
-
-