Interface PlacementRequest
-
- All Superinterfaces:
ModificationRequest
- All Known Implementing Classes:
PlacementRequestImpl
public interface PlacementRequest extends ModificationRequest
A cluster related placement request that Solr asks aPlacementPlugin
plugin to resolve and compute aPlacementPlan
placing one or moreReplica
's of one or moreShard
's of an existingSolrCollection
. The shard might or might not already exist, plugin code can easily find out by callingSolrCollection.getShard(String)
with the shard name(s) returned bygetShardNames()
.The set of
Node
s on which the replicas should be placed is specified (defaults to being equal to the set returned byCluster.getLiveNodes()
).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.-
Methods inherited from interface org.apache.solr.cluster.placement.ModificationRequest
getCollection
-
-
-
-
Method Detail
-
getShardNames
Set<String> 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 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.
-
getTargetNodes
Set<Node> 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
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
int getCountReplicasToCreate(Replica.ReplicaType replicaType)
Returns the number of replica to create for the given replica type.
-
-