ECMap: Moving message serialization to the background
Change-Id: I0de398c6ce77bfb0729db03ab2ec4ea7f55a8284
diff --git a/core/store/dist/src/main/java/org/onosproject/store/ecmap/EventuallyConsistentMapImpl.java b/core/store/dist/src/main/java/org/onosproject/store/ecmap/EventuallyConsistentMapImpl.java
index fd05d7f..20849ed 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/ecmap/EventuallyConsistentMapImpl.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/ecmap/EventuallyConsistentMapImpl.java
@@ -429,6 +429,7 @@
executor.shutdown();
backgroundExecutor.shutdown();
+ broadcastMessageExecutor.shutdown();
listeners.clear();
@@ -444,11 +445,11 @@
}
private void notifyPeers(InternalPutEvent event) {
- broadcastMessage(updateMessageSubject, event);
+ broadcastMessageExecutor.execute(() -> broadcastMessage(updateMessageSubject, event));
}
private void notifyPeers(InternalRemoveEvent event) {
- broadcastMessage(removeMessageSubject, event);
+ broadcastMessageExecutor.execute(() -> broadcastMessage(removeMessageSubject, event));
}
private void broadcastMessage(MessageSubject subject, Object event) {
@@ -456,7 +457,7 @@
clusterService.getLocalNode().id(),
subject,
serializer.encode(event));
- broadcastMessageExecutor.execute(() -> clusterCommunicator.broadcast(message));
+ clusterCommunicator.broadcast(message);
}
private void unicastMessage(NodeId peer,