Copycat transport enhancements
Change-Id: I50e9eb0f419b2aa10deff6d54f58649688788faa
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionClient.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionClient.java
index 293deef..854aa3c 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionClient.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionClient.java
@@ -15,6 +15,7 @@
*/
package org.onosproject.store.primitives.impl;
+import static org.slf4j.LoggerFactory.getLogger;
import io.atomix.Atomix;
import io.atomix.AtomixClient;
import io.atomix.catalyst.transport.Transport;
@@ -38,6 +39,7 @@
import org.onosproject.store.service.AsyncLeaderElector;
import org.onosproject.store.service.DistributedQueue;
import org.onosproject.store.service.Serializer;
+import org.slf4j.Logger;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
@@ -48,6 +50,8 @@
*/
public class StoragePartitionClient implements DistributedPrimitiveCreator, Managed<StoragePartitionClient> {
+ private final Logger log = getLogger(getClass());
+
private final StoragePartition partition;
private final Transport transport;
private final io.atomix.catalyst.serializer.Serializer serializer;
@@ -82,7 +86,13 @@
.withTransport(transport)
.build();
}
- return client.open().thenApply(v -> null);
+ return client.open().whenComplete((r, e) -> {
+ if (e == null) {
+ log.info("Successfully started client for partition {}", partition.getId());
+ } else {
+ log.info("Failed to start client for partition {}", partition.getId(), e);
+ }
+ }).thenApply(v -> null);
}
@Override
@@ -156,4 +166,4 @@
public boolean isClosed() {
return client.isClosed();
}
-}
\ No newline at end of file
+}