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 SolrCollection
getCollection()
TheSolrCollection
to modify.int
getCountReplicasToCreate(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:ModificationRequest
TheSolrCollection
to modify.- Specified by:
getCollection
in interfaceModificationRequest
-
getShardNames
public Set<String> getShardNames()
Description copied from interface:PlacementRequest
Shard name(s) for which new replicas placement should be computed. The shard(s) might exist or not (that's why this method returns aSet
ofString
's and not directly a set ofShard
instances).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:
getShardNames
in interfacePlacementRequest
-
getTargetNodes
public Set<Node> getTargetNodes()
Description copied from interface:PlacementRequest
Replicas 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:
getTargetNodes
in interfacePlacementRequest
- Returns:
- never
null
and 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:PlacementRequest
Returns the number of replica to create for the given replica type.- Specified by:
getCountReplicasToCreate
in interfacePlacementRequest
-
-