Remove clientTxVersion from ShardTransaction
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardTransactionFactory.java
index f8b8b9c95252834b2f0661a2658005124c53ef0f..76838dd2f83dc4bec45730e741dc5b8b47ad1686 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.controller.cluster.datastore;
 
-import com.google.common.base.Preconditions;
 import akka.actor.ActorRef;
 import akka.actor.UntypedActorContext;
+import com.google.common.base.Preconditions;
 import org.opendaylight.controller.cluster.datastore.identifiers.ShardTransactionIdentifier;
 import org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard.ShardStats;
 
@@ -38,22 +38,27 @@ class ShardTransactionActorFactory {
     }
 
     ActorRef newShardTransaction(TransactionType type, ShardTransactionIdentifier transactionID,
-            String transactionChainID, short clientVersion) {
+            String transactionChainID) {
         final AbstractShardDataTreeTransaction<?> transaction;
         switch (type) {
         case READ_ONLY:
             transaction = dataTree.newReadOnlyTransaction(transactionID.toString(), transactionChainID);
+            shardMBean.incrementReadOnlyTransactionCount();
             break;
         case READ_WRITE:
+            transaction = dataTree.newReadWriteTransaction(transactionID.toString(), transactionChainID);
+            shardMBean.incrementReadWriteTransactionCount();
+            break;
         case WRITE_ONLY:
             transaction = dataTree.newReadWriteTransaction(transactionID.toString(), transactionChainID);
+            shardMBean.incrementWriteOnlyTransactionCount();
             break;
         default:
             throw new IllegalArgumentException("Unsupported transaction type " + type);
         }
 
         return actorContext.actorOf(ShardTransaction.props(type, transaction, shardActor, datastoreContext, shardMBean,
-                transactionID.getRemoteTransactionId(), clientVersion).withDispatcher(txnDispatcherPath),
+                transactionID.getRemoteTransactionId()).withDispatcher(txnDispatcherPath),
                 transactionID.toString());
     }
 }