Remove retry logic from NewDistributedLeadershipStore
Change-Id: I1eac3bda717ca227874ebac46fd5840247bfbe11
diff --git a/core/store/dist/src/main/java/org/onosproject/store/cluster/impl/NewDistributedLeadershipStore.java b/core/store/dist/src/main/java/org/onosproject/store/cluster/impl/NewDistributedLeadershipStore.java
index 914da94..01f61c7 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/cluster/impl/NewDistributedLeadershipStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/cluster/impl/NewDistributedLeadershipStore.java
@@ -27,7 +27,6 @@
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.Service;
-import org.onlab.util.Tools;
import org.onosproject.cluster.ClusterService;
import org.onosproject.cluster.Leadership;
import org.onosproject.cluster.LeadershipEvent;
@@ -37,7 +36,6 @@
import org.onosproject.event.Change;
import org.onosproject.store.AbstractStore;
import org.onosproject.store.service.LeaderElector;
-import org.onosproject.store.service.StorageException;
import org.onosproject.store.service.StorageService;
import org.slf4j.Logger;
@@ -66,9 +64,6 @@
private LeaderElector leaderElector;
private final Map<String, Leadership> leaderBoard = Maps.newConcurrentMap();
- private static final int MAX_RETRIES = 10;
- private static final int MAX_DELAY_MILLIS_BETWEEN_RETRIES = 100;
-
private final Consumer<Change<Leadership>> leadershipChangeListener =
change -> {
Leadership oldValue = change.oldValue();
@@ -109,21 +104,12 @@
@Override
public Leadership addRegistration(String topic) {
- return Tools.retryable(() -> leaderElector.run(topic, localNodeId),
- StorageException.class,
- MAX_RETRIES,
- MAX_DELAY_MILLIS_BETWEEN_RETRIES).get();
+ return leaderElector.run(topic, localNodeId);
}
@Override
public void removeRegistration(String topic) {
- Tools.retryable(() -> {
- leaderElector.withdraw(topic);
- return null;
- },
- StorageException.class,
- MAX_RETRIES,
- MAX_DELAY_MILLIS_BETWEEN_RETRIES).get();
+ leaderElector.withdraw(topic);
}
@Override