Interface PlacementRequest
- All Superinterfaces:
ModificationRequest
- All Known Implementing Classes:
PlacementRequestImpl
A cluster related placement request that Solr asks a
PlacementPlugin plugin to resolve
and compute a PlacementPlan placing one or more Replica's of one or more Shard's of an existing SolrCollection. The shard might or might not already exist,
plugin code can easily find out by calling SolrCollection.getShard(String) with the shard
name(s) returned by getShardNames().
The set of Nodes on which the replicas should be placed is specified (defaults to
being equal to the set returned by Cluster.getLiveNodes()).
-
Method Summary
Modifier and TypeMethodDescriptionintgetCountReplicasToCreate(Replica.ReplicaType replicaType) Returns the number of replica to create for the given replica type.Shard name(s) for which new replicas placement should be computed.Replicas should only be placed on nodes in the set returned by this method.Methods inherited from interface org.apache.solr.cluster.placement.ModificationRequest
getCollection
-
Method Details
-
getShardNames
Shard 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. -
getTargetNodes
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.
- 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
Returns the number of replica to create for the given replica type.
-