Class LeastLoadedCandidateSelectionStrategy
- java.lang.Object
-
- org.opendaylight.controller.cluster.entityownership.selectionstrategy.AbstractEntityOwnerSelectionStrategy
-
- org.opendaylight.controller.cluster.entityownership.selectionstrategy.LeastLoadedCandidateSelectionStrategy
-
- All Implemented Interfaces:
EntityOwnerSelectionStrategy
public class LeastLoadedCandidateSelectionStrategy extends AbstractEntityOwnerSelectionStrategy
The LeastLoadedCandidateSelectionStrategy assigns ownership for an entity to the candidate which owns the least number of entities.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedLeastLoadedCandidateSelectionStrategy(long selectionDelayInMillis, Map<String,Long> initialStatistics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringnewOwner(String currentOwner, Collection<String> viableCandidates)Selects a new owner from the list of viable candidates.-
Methods inherited from class org.opendaylight.controller.cluster.entityownership.selectionstrategy.AbstractEntityOwnerSelectionStrategy
getInitialStatistics, getSelectionDelayInMillis
-
-
-
-
Method Detail
-
newOwner
public String newOwner(String currentOwner, Collection<String> viableCandidates)
Description copied from interface:EntityOwnerSelectionStrategySelects a new owner from the list of viable candidates.- Parameters:
currentOwner- the current owner of the entity if any, null otherwiseviableCandidates- the available candidates from which to choose the new owner- Returns:
- the new owner
-
-