Class PlacementRequestImpl
- java.lang.Object
-
- org.apache.solr.cluster.placement.impl.PlacementRequestImpl
-
- All Implemented Interfaces:
ModificationRequest,PlacementRequest
public class PlacementRequestImpl extends Object implements PlacementRequest
-
-
Constructor Summary
Constructors Constructor Description PlacementRequestImpl(SolrCollection solrCollection, Set<String> shardNames, Set<Node> targetNodes, int countNrtReplicas, int countTlogReplicas, int countPullReplicas)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SolrCollectiongetCollection()TheSolrCollectionto modify.intgetCountReplicasToCreate(Replica.ReplicaType replicaType)Returns the number of replica to create for the given replica type.Set<String>getShardNames()Shard name(s) for which new replicas placement should be computed.Set<Node>getTargetNodes()Replicas should only be placed on nodes in the set returned by this method.
-
-
-
Constructor Detail
-
PlacementRequestImpl
public PlacementRequestImpl(SolrCollection solrCollection, Set<String> shardNames, Set<Node> targetNodes, int countNrtReplicas, int countTlogReplicas, int countPullReplicas)
-
-
Method Detail
-
getCollection
public SolrCollection getCollection()
Description copied from interface:ModificationRequestTheSolrCollectionto modify.- Specified by:
getCollectionin interfaceModificationRequest
-
getShardNames
public Set<String> getShardNames()
Description copied from interface:PlacementRequestShard name(s) for which new replicas placement should be computed. The shard(s) might exist or not (that's why this method returns aSetofString's and not directly a set ofShardinstances).Note the Collection API allows specifying the shard name or a
_route_parameter. The Solr implementation will convert either specification into the relevant shard name so the plugin code doesn't have to worry about this.- Specified by:
getShardNamesin interfacePlacementRequest
-
getTargetNodes
public Set<Node> getTargetNodes()
Description copied from interface:PlacementRequestReplicas should only be placed on nodes in the set returned by this method.When Collection API calls do not specify a specific set of target nodes, replicas can be placed on any live node of the cluster. In such cases, this set will be equal to the set of all live nodes. The plugin placement code does not need to worry (or care) if a set of nodes was explicitly specified or not.
- Specified by:
getTargetNodesin interfacePlacementRequest- Returns:
- never
nulland never empty set (if that set was to be empty for any reason, no placement would be possible and the Solr infrastructure driving the plugin code would detect the error itself rather than calling the plugin).
-
getCountReplicasToCreate
public int getCountReplicasToCreate(Replica.ReplicaType replicaType)
Description copied from interface:PlacementRequestReturns the number of replica to create for the given replica type.- Specified by:
getCountReplicasToCreatein interfacePlacementRequest
-
-