Added destroy() method to DistributedPrimitive interface
Implement replace method in ConsistentMap
Using Versioned#valueOrNull in place of Versioned#valueOrElse where appropriate
Change-Id: Ief3f3547d589d35f5c821a1c47035f91078e8316
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/EventuallyConsistentMapImpl.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/EventuallyConsistentMapImpl.java
index bee4dc2..fc7c0eb 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/EventuallyConsistentMapImpl.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/EventuallyConsistentMapImpl.java
@@ -31,6 +31,7 @@
import java.util.Optional;
import java.util.Set;
import java.util.Timer;
+import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
@@ -502,7 +503,7 @@
}
@Override
- public void destroy() {
+ public CompletableFuture<Void> destroy() {
destroyed = true;
executor.shutdown();
@@ -513,6 +514,7 @@
clusterCommunicator.removeSubscriber(updateMessageSubject);
clusterCommunicator.removeSubscriber(antiEntropyAdvertisementSubject);
+ return CompletableFuture.completedFuture(null);
}
private void notifyListeners(EventuallyConsistentMapEvent<K, V> event) {