X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fentityownership%2Fselectionstrategy%2FFirstCandidateSelectionStrategy.java;h=c4c93b7842357bc6166c0f5cb5c8c0601b6f003a;hb=8f30cbc0ba2676e883faadba10f757881983b2d0;hp=a619035f35f9fc6963ab89e65579391bb7fc94c5;hpb=4b2622df4d579e9b1be0b25603e002ce58db4463;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/FirstCandidateSelectionStrategy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/FirstCandidateSelectionStrategy.java index a619035f35..c4c93b7842 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/FirstCandidateSelectionStrategy.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/FirstCandidateSelectionStrategy.java @@ -10,21 +10,23 @@ package org.opendaylight.controller.cluster.datastore.entityownership.selections import com.google.common.base.Preconditions; import java.util.Collection; +import java.util.Collections; +import java.util.Map; /** - * The FirstCandidateSelectionStrategy always selects the first viable candidate from the list of candidates + * The FirstCandidateSelectionStrategy always selects the first viable candidate from the list of candidates. */ -public class FirstCandidateSelectionStrategy implements EntityOwnerSelectionStrategy { +public class FirstCandidateSelectionStrategy extends AbstractEntityOwnerSelectionStrategy { - public static final FirstCandidateSelectionStrategy INSTANCE = new FirstCandidateSelectionStrategy(); + public static final FirstCandidateSelectionStrategy INSTANCE = + new FirstCandidateSelectionStrategy(0L, Collections.emptyMap()); - @Override - public long selectionDelayInMillis() { - return 0; + public FirstCandidateSelectionStrategy(long selectionDelayInMillis, Map initialStatistics) { + super(selectionDelayInMillis, initialStatistics); } @Override - public String newOwner(Collection viableCandidates) { + public String newOwner(String currentOwner, Collection viableCandidates) { Preconditions.checkArgument(viableCandidates.size() > 0, "No viable candidates provided"); return viableCandidates.iterator().next(); }