Deprecate CreateTransaction protobuff message
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardTransactionFactory.java
index 3a92062e7f86972d55fe7f230c655898d0f0acfb..887f656205182564f5e28a7027ce8a4b337c23e5 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;
 
@@ -37,16 +37,21 @@ class ShardTransactionActorFactory {
         this.shardActor = shardActor;
     }
 
-    ActorRef newShardTransaction(TransactionProxy.TransactionType type, ShardTransactionIdentifier transactionID,
+    ActorRef newShardTransaction(TransactionType type, ShardTransactionIdentifier transactionID,
             String transactionChainID, short clientVersion) {
         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);