Updates to ConsistentMap and LeaderElector state machines
Change-Id: I7734b253a56fef7300a8a094a3cfc8c1b45c2453
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionServer.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionServer.java
index 0dad15a..834d8e9 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionServer.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionServer.java
@@ -15,6 +15,7 @@
*/
package org.onosproject.store.primitives.impl;
+import static org.slf4j.LoggerFactory.getLogger;
import io.atomix.catalyst.serializer.Serializer;
import io.atomix.catalyst.transport.Address;
import io.atomix.catalyst.transport.Transport;
@@ -35,6 +36,7 @@
import org.onosproject.cluster.NodeId;
import org.onosproject.store.service.PartitionInfo;
+import org.slf4j.Logger;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
@@ -44,6 +46,8 @@
*/
public class StoragePartitionServer implements Managed<StoragePartitionServer> {
+ private final Logger log = getLogger(getClass());
+
private static final int MAX_ENTRIES_PER_LOG_SEGMENT = 32768;
private final StoragePartition partition;
private final Address localAddress;
@@ -81,7 +85,13 @@
} else {
serverOpenFuture = CompletableFuture.completedFuture(null);
}
- return serverOpenFuture.thenApply(v -> null);
+ return serverOpenFuture.whenComplete((r, e) -> {
+ if (e == null) {
+ log.info("Successfully started server for partition {}", partition.getId());
+ } else {
+ log.info("Failed to start server for partition {}", partition.getId(), e);
+ }
+ }).thenApply(v -> null);
}
@Override
@@ -105,7 +115,6 @@
.withStorage(Storage.builder()
// FIXME: StorageLevel should be DISK
.withStorageLevel(StorageLevel.MEMORY)
- .withSerializer(serializer.clone())
.withDirectory(dataFolder)
.withMaxEntriesPerSegment(MAX_ENTRIES_PER_LOG_SEGMENT)
.build())