X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FShardTransactionActorFactory.java;h=8e9c762bf188e60c02485a74b694ebc0fd3880cc;hp=0ba36640a8f6368451478d0f28451a2c7a437db4;hb=43fb391bf873b252383a8d736b2651b04da8d40d;hpb=925cb4a228d0fda99c7bfeb432eb25285a223887 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionActorFactory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionActorFactory.java index 0ba36640a8..8e9c762bf1 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionActorFactory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionActorFactory.java @@ -29,26 +29,30 @@ class ShardTransactionActorFactory { private final ShardStats shardMBean; private final UntypedActorContext actorContext; private final ActorRef shardActor; + private final String shardName; ShardTransactionActorFactory(ShardDataTree dataTree, DatastoreContext datastoreContext, - String txnDispatcherPath, ActorRef shardActor, UntypedActorContext actorContext, ShardStats shardMBean) { + String txnDispatcherPath, ActorRef shardActor, UntypedActorContext actorContext, ShardStats shardMBean, + String shardName) { this.dataTree = Preconditions.checkNotNull(dataTree); - this.datastoreContext = datastoreContext; - this.txnDispatcherPath = txnDispatcherPath; - this.shardMBean = shardMBean; - this.actorContext = actorContext; - this.shardActor = shardActor; + this.datastoreContext = Preconditions.checkNotNull(datastoreContext); + this.txnDispatcherPath = Preconditions.checkNotNull(txnDispatcherPath); + this.shardMBean = Preconditions.checkNotNull(shardMBean); + this.actorContext = Preconditions.checkNotNull(actorContext); + this.shardActor = Preconditions.checkNotNull(shardActor); + this.shardName = Preconditions.checkNotNull(shardName); } - private static String actorNameFor(final TransactionIdentifier txId) { + private String actorNameFor(final TransactionIdentifier txId) { final LocalHistoryIdentifier historyId = txId.getHistoryId(); final ClientIdentifier clientId = historyId.getClientId(); final FrontendIdentifier frontendId = clientId.getFrontendId(); final StringBuilder sb = new StringBuilder("shard-"); - sb.append(frontendId.getMemberName().getName()).append(':'); - sb.append(frontendId.getClientType().getName()).append('@'); - sb.append(clientId.getGeneration()).append(':'); + sb.append(shardName).append('-') + .append(frontendId.getMemberName().getName()).append(':') + .append(frontendId.getClientType().getName()).append('@') + .append(clientId.getGeneration()).append(':'); if (historyId.getHistoryId() != 0) { sb.append(historyId.getHistoryId()).append('-'); }