DistributedMastershipStore: remove dead code + cosmetics
Change-Id: I368f9d95b6aebe6854cb7f2abf3ac540f03d3ed1
Showing
1 changed file
with
2 additions
and
7 deletions
| ... | @@ -47,7 +47,6 @@ import org.onlab.util.KryoNamespace; | ... | @@ -47,7 +47,6 @@ import org.onlab.util.KryoNamespace; |
| 47 | import com.google.common.base.Objects; | 47 | import com.google.common.base.Objects; |
| 48 | import com.hazelcast.core.EntryEvent; | 48 | import com.hazelcast.core.EntryEvent; |
| 49 | import com.hazelcast.core.EntryListener; | 49 | import com.hazelcast.core.EntryListener; |
| 50 | -import com.hazelcast.core.IAtomicLong; | ||
| 51 | import com.hazelcast.core.MapEvent; | 50 | import com.hazelcast.core.MapEvent; |
| 52 | 51 | ||
| 53 | import static org.onlab.onos.net.MastershipRole.*; | 52 | import static org.onlab.onos.net.MastershipRole.*; |
| ... | @@ -59,8 +58,8 @@ import static org.onlab.onos.net.MastershipRole.*; | ... | @@ -59,8 +58,8 @@ import static org.onlab.onos.net.MastershipRole.*; |
| 59 | @Component(immediate = true) | 58 | @Component(immediate = true) |
| 60 | @Service | 59 | @Service |
| 61 | public class DistributedMastershipStore | 60 | public class DistributedMastershipStore |
| 62 | -extends AbstractHazelcastStore<MastershipEvent, MastershipStoreDelegate> | 61 | + extends AbstractHazelcastStore<MastershipEvent, MastershipStoreDelegate> |
| 63 | -implements MastershipStore { | 62 | + implements MastershipStore { |
| 64 | 63 | ||
| 65 | //term number representing that master has never been chosen yet | 64 | //term number representing that master has never been chosen yet |
| 66 | private static final Integer NOTHING = 0; | 65 | private static final Integer NOTHING = 0; |
| ... | @@ -71,9 +70,6 @@ implements MastershipStore { | ... | @@ -71,9 +70,6 @@ implements MastershipStore { |
| 71 | protected SMap<DeviceId, RoleValue> roleMap; | 70 | protected SMap<DeviceId, RoleValue> roleMap; |
| 72 | //devices to terms | 71 | //devices to terms |
| 73 | protected SMap<DeviceId, Integer> terms; | 72 | protected SMap<DeviceId, Integer> terms; |
| 74 | - //last-known cluster size, used for tie-breaking when partitioning occurs | ||
| 75 | - protected IAtomicLong clusterSize; | ||
| 76 | - | ||
| 77 | 73 | ||
| 78 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 74 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 79 | protected ClusterService clusterService; | 75 | protected ClusterService clusterService; |
| ... | @@ -98,7 +94,6 @@ implements MastershipStore { | ... | @@ -98,7 +94,6 @@ implements MastershipStore { |
| 98 | roleMap = new SMap<>(theInstance.<byte[], byte[]>getMap("nodeRoles"), this.serializer); | 94 | roleMap = new SMap<>(theInstance.<byte[], byte[]>getMap("nodeRoles"), this.serializer); |
| 99 | roleMap.addEntryListener((new RemoteMasterShipEventHandler()), true); | 95 | roleMap.addEntryListener((new RemoteMasterShipEventHandler()), true); |
| 100 | terms = new SMap<>(theInstance.<byte[], byte[]>getMap("terms"), this.serializer); | 96 | terms = new SMap<>(theInstance.<byte[], byte[]>getMap("terms"), this.serializer); |
| 101 | - clusterSize = theInstance.getAtomicLong("clustersize"); | ||
| 102 | 97 | ||
| 103 | log.info("Started"); | 98 | log.info("Started"); |
| 104 | } | 99 | } | ... | ... |
-
Please register or login to post a comment