Use partitionId instead of clusterName in CopycatTransport
Change-Id: I8e7ab3863a36944ac9e48e187037fb43695ebde3
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/CopycatTransportClient.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/CopycatTransportClient.java
index 390cde3..96729c7 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/CopycatTransportClient.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/CopycatTransportClient.java
@@ -19,7 +19,9 @@
import java.util.Set;
import java.util.concurrent.CompletableFuture;
+
import org.apache.commons.lang.math.RandomUtils;
+import org.onosproject.cluster.PartitionId;
import org.onosproject.store.cluster.messaging.MessagingService;
import com.google.common.collect.Sets;
@@ -34,13 +36,13 @@
*/
public class CopycatTransportClient implements Client {
- private final String clusterName;
+ private final PartitionId partitionId;
private final MessagingService messagingService;
private final CopycatTransport.Mode mode;
private final Set<CopycatTransportConnection> connections = Sets.newConcurrentHashSet();
- CopycatTransportClient(String clusterName, MessagingService messagingService, CopycatTransport.Mode mode) {
- this.clusterName = checkNotNull(clusterName);
+ CopycatTransportClient(PartitionId partitionId, MessagingService messagingService, CopycatTransport.Mode mode) {
+ this.partitionId = checkNotNull(partitionId);
this.messagingService = checkNotNull(messagingService);
this.mode = checkNotNull(mode);
}
@@ -51,7 +53,7 @@
CopycatTransportConnection connection = new CopycatTransportConnection(
nextConnectionId(),
CopycatTransport.Mode.CLIENT,
- clusterName,
+ partitionId,
remoteAddress,
messagingService,
context);