Revert "Fix nasty race condition in the MeterStore"
This reverts commit 6ef84ceb0e167e4bff0fb3fdf9ca29abba56a465.
Reason for revert: let me update the commit message
Change-Id: Ia1ee1cb33544eb2249e225e574c7f27a04095e56
diff --git a/core/store/dist/src/main/java/org/onosproject/store/meter/impl/DistributedMeterStore.java b/core/store/dist/src/main/java/org/onosproject/store/meter/impl/DistributedMeterStore.java
index 30da74d..b94375c 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/meter/impl/DistributedMeterStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/meter/impl/DistributedMeterStore.java
@@ -114,8 +114,7 @@
// Meters id related objects
private static final String AVAILABLEMETERIDSTORE = "onos-meters-available-store";
- protected final ConcurrentMap<MeterTableKey, DistributedSet<MeterKey>> availableMeterIds =
- new ConcurrentHashMap<>();
+ protected ConcurrentMap<MeterTableKey, DistributedSet<MeterKey>> availableMeterIds;
private static final String METERIDSTORE = "onos-meters-id-store";
private AtomicCounterMap<MeterTableKey> meterIdGenerators;
@@ -178,6 +177,8 @@
.withSerializer(APP_KRYO_BUILDER).build();
metersFeatures.addListener(featuresMapListener);
+ availableMeterIds = new ConcurrentHashMap<>();
+
meterIdGenerators = storageService.<MeterTableKey>atomicCounterMapBuilder()
.withName(METERIDSTORE)
.withSerializer(Serializer.using(KryoNamespaces.API,