Madan Jampani
Committed by Gerrit Code Review

Remove retry logic from NewDistributedLeadershipStore

Change-Id: I1eac3bda717ca227874ebac46fd5840247bfbe11
...@@ -27,7 +27,6 @@ import org.apache.felix.scr.annotations.Deactivate; ...@@ -27,7 +27,6 @@ import org.apache.felix.scr.annotations.Deactivate;
27 import org.apache.felix.scr.annotations.Reference; 27 import org.apache.felix.scr.annotations.Reference;
28 import org.apache.felix.scr.annotations.ReferenceCardinality; 28 import org.apache.felix.scr.annotations.ReferenceCardinality;
29 import org.apache.felix.scr.annotations.Service; 29 import org.apache.felix.scr.annotations.Service;
30 -import org.onlab.util.Tools;
31 import org.onosproject.cluster.ClusterService; 30 import org.onosproject.cluster.ClusterService;
32 import org.onosproject.cluster.Leadership; 31 import org.onosproject.cluster.Leadership;
33 import org.onosproject.cluster.LeadershipEvent; 32 import org.onosproject.cluster.LeadershipEvent;
...@@ -37,7 +36,6 @@ import org.onosproject.cluster.NodeId; ...@@ -37,7 +36,6 @@ import org.onosproject.cluster.NodeId;
37 import org.onosproject.event.Change; 36 import org.onosproject.event.Change;
38 import org.onosproject.store.AbstractStore; 37 import org.onosproject.store.AbstractStore;
39 import org.onosproject.store.service.LeaderElector; 38 import org.onosproject.store.service.LeaderElector;
40 -import org.onosproject.store.service.StorageException;
41 import org.onosproject.store.service.StorageService; 39 import org.onosproject.store.service.StorageService;
42 import org.slf4j.Logger; 40 import org.slf4j.Logger;
43 41
...@@ -66,9 +64,6 @@ public class NewDistributedLeadershipStore ...@@ -66,9 +64,6 @@ public class NewDistributedLeadershipStore
66 private LeaderElector leaderElector; 64 private LeaderElector leaderElector;
67 private final Map<String, Leadership> leaderBoard = Maps.newConcurrentMap(); 65 private final Map<String, Leadership> leaderBoard = Maps.newConcurrentMap();
68 66
69 - private static final int MAX_RETRIES = 10;
70 - private static final int MAX_DELAY_MILLIS_BETWEEN_RETRIES = 100;
71 -
72 private final Consumer<Change<Leadership>> leadershipChangeListener = 67 private final Consumer<Change<Leadership>> leadershipChangeListener =
73 change -> { 68 change -> {
74 Leadership oldValue = change.oldValue(); 69 Leadership oldValue = change.oldValue();
...@@ -109,21 +104,12 @@ public class NewDistributedLeadershipStore ...@@ -109,21 +104,12 @@ public class NewDistributedLeadershipStore
109 104
110 @Override 105 @Override
111 public Leadership addRegistration(String topic) { 106 public Leadership addRegistration(String topic) {
112 - return Tools.retryable(() -> leaderElector.run(topic, localNodeId), 107 + return leaderElector.run(topic, localNodeId);
113 - StorageException.class,
114 - MAX_RETRIES,
115 - MAX_DELAY_MILLIS_BETWEEN_RETRIES).get();
116 } 108 }
117 109
118 @Override 110 @Override
119 public void removeRegistration(String topic) { 111 public void removeRegistration(String topic) {
120 - Tools.retryable(() -> {
121 leaderElector.withdraw(topic); 112 leaderElector.withdraw(topic);
122 - return null;
123 - },
124 - StorageException.class,
125 - MAX_RETRIES,
126 - MAX_DELAY_MILLIS_BETWEEN_RETRIES).get();
127 } 113 }
128 114
129 @Override 115 @Override
......