X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FShardTransactionFactory.java;fp=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FShardTransactionFactory.java;h=d21878f95d613e724deafd6ae9af9452ccd68f57;hb=faf24d4688f47ebeacd3d8e32be4979d416d1ad4;hp=ecfd2aa50d8375ac3cc184eaf1e55a383bc85df5;hpb=cbdd5d2a5c233a00fe057bd0359cdeefdb7de4da;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionFactory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionFactory.java index ecfd2aa50d..d21878f95d 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionFactory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionFactory.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('-'); }