Class OrderedNodePlacementPlugin
java.lang.Object
org.apache.solr.cluster.placement.plugins.OrderedNodePlacementPlugin
- All Implemented Interfaces:
PlacementPlugin
- Direct Known Subclasses:
AffinityPlacementFactory.AffinityPlacementPlugin,RandomPlacementFactory.RandomPlacementPlugin,SimplePlacementFactory.SimplePlacementPlugin
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA class that determines the weight of a given node and the replicas that reside on it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomputeBalancing(BalanceRequest balanceRequest, PlacementContext placementContext) Request from plugin code to compute a balancing of replicas.computePlacements(Collection<PlacementRequest> requests, PlacementContext placementContext) Request from plugin code to compute multiple placements.protected abstract Map<Node, OrderedNodePlacementPlugin.WeightedNode> getBaseWeightedNodes(PlacementContext placementContext, Set<Node> nodes, Iterable<SolrCollection> relevantCollections, boolean skipNodesWithErrors) protected Map<Node, OrderedNodePlacementPlugin.WeightedNode> getWeightedNodes(PlacementContext placementContext, Set<Node> nodes, Iterable<SolrCollection> relevantCollections, boolean skipNodesWithErrors) voidverifyAllowedModification(ModificationRequest modificationRequest, PlacementContext placementContext) Verify that a collection layout modification doesn't violate constraints on replica placements required by this plugin.protected voidverifyDeleteCollection(DeleteCollectionRequest deleteCollectionRequest, PlacementContext placementContext) protected voidverifyDeleteReplicas(DeleteReplicasRequest deleteReplicasRequest, PlacementContext placementContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.cluster.placement.PlacementPlugin
computePlacement
-
Constructor Details
-
OrderedNodePlacementPlugin
public OrderedNodePlacementPlugin()
-
-
Method Details
-
computePlacements
public List<PlacementPlan> computePlacements(Collection<PlacementRequest> requests, PlacementContext placementContext) throws PlacementException Description copied from interface:PlacementPluginRequest from plugin code to compute multiple placements. If multiple placements are requested, then thePlacementPlancomputed for eachPlacementRequestwill be used to affect the starting state for each subsequentPlacementRequestin the list. This means that eachPlacementRequestis computed in the context of the previousPlacementRequest's already having been implemented. Note this method must be reentrant as a plugin instance may (read will) get multiple such calls in parallel.Configuration is passed upon creation of a new instance of this class by
PlacementPluginFactory.createPluginInstance().- Specified by:
computePlacementsin interfacePlacementPlugin- Parameters:
requests- requests for placing new replicas or moving existing replicas on the cluster.- Returns:
- plan satisfying all placement requests.
- Throws:
PlacementException
-
computeBalancing
public BalancePlan computeBalancing(BalanceRequest balanceRequest, PlacementContext placementContext) throws PlacementException Description copied from interface:PlacementPluginRequest from plugin code to compute a balancing of replicas. Note this method must be reentrant as a plugin instance may (read will) get multiple such calls in parallel.Configuration is passed upon creation of a new instance of this class by
PlacementPluginFactory.createPluginInstance().- Specified by:
computeBalancingin interfacePlacementPlugin- Parameters:
balanceRequest- request for selecting replicas that should be moved to aid in balancing the replicas across the desired nodes.- Returns:
- plan satisfying all extraction requests.
- Throws:
PlacementException
-
getWeightedNodes
protected Map<Node,OrderedNodePlacementPlugin.WeightedNode> getWeightedNodes(PlacementContext placementContext, Set<Node> nodes, Iterable<SolrCollection> relevantCollections, boolean skipNodesWithErrors) throws PlacementException - Throws:
PlacementException
-
getBaseWeightedNodes
protected abstract Map<Node,OrderedNodePlacementPlugin.WeightedNode> getBaseWeightedNodes(PlacementContext placementContext, Set<Node> nodes, Iterable<SolrCollection> relevantCollections, boolean skipNodesWithErrors) throws PlacementException - Throws:
PlacementException
-
verifyAllowedModification
public void verifyAllowedModification(ModificationRequest modificationRequest, PlacementContext placementContext) throws PlacementException Description copied from interface:PlacementPluginVerify that a collection layout modification doesn't violate constraints on replica placements required by this plugin. Default implementation is a no-op (any modifications are allowed).- Specified by:
verifyAllowedModificationin interfacePlacementPlugin- Parameters:
modificationRequest- modification request.placementContext- placement context.- Throws:
PlacementException
-
verifyDeleteCollection
protected void verifyDeleteCollection(DeleteCollectionRequest deleteCollectionRequest, PlacementContext placementContext) throws PlacementException - Throws:
PlacementException
-
verifyDeleteReplicas
protected void verifyDeleteReplicas(DeleteReplicasRequest deleteReplicasRequest, PlacementContext placementContext) throws PlacementException - Throws:
PlacementException
-