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%2FShardReadTransaction.java;h=0e9fd113c53108537c4613569e25cce1805c8877;hp=1328d466f34b6fff82a91b98379cd815b488155c;hb=9f61e98b036119694dfef0759a7cafc56aae6e86;hpb=a3ff4b68093e6d675a92159e0efa2525af32d644 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardReadTransaction.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardReadTransaction.java index 1328d466f3..0e9fd113c5 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardReadTransaction.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardReadTransaction.java @@ -11,15 +11,12 @@ package org.opendaylight.controller.cluster.datastore; import akka.actor.ActorRef; -import akka.actor.PoisonPill; -import akka.event.Logging; -import akka.event.LoggingAdapter; -import org.opendaylight.controller.cluster.datastore.messages.CloseTransaction; -import org.opendaylight.controller.cluster.datastore.messages.CloseTransactionReply; + +import org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard.ShardStats; import org.opendaylight.controller.cluster.datastore.messages.DataExists; import org.opendaylight.controller.cluster.datastore.messages.ReadData; import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction; -import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain; +import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransaction; import org.opendaylight.yangtools.yang.model.api.SchemaContext; /** @@ -27,40 +24,27 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext; * Date: 8/6/14 */ public class ShardReadTransaction extends ShardTransaction { - private final DOMStoreReadTransaction transaction; - private final LoggingAdapter log = - Logging.getLogger(getContext().system(), this); - - public ShardReadTransaction(DOMStoreReadTransaction transaction, ActorRef shardActor, SchemaContext schemaContext) { - super(shardActor, schemaContext); - this.transaction = transaction; - - } + private final DOMStoreReadTransaction transaction; - public ShardReadTransaction(DOMStoreTransactionChain transactionChain, DOMStoreReadTransaction transaction, ActorRef shardActor, SchemaContext schemaContext) { - super(transactionChain, shardActor, schemaContext); - this.transaction = transaction; - } - - @Override - public void handleReceive(Object message) throws Exception { - if (ReadData.SERIALIZABLE_CLASS.equals(message.getClass())) { - readData(transaction, ReadData.fromSerializable(message)); - } else if(DataExists.SERIALIZABLE_CLASS.equals(message.getClass())) { - dataExists(transaction, DataExists.fromSerializable(message)); - } else { - super.handleReceive(message); + public ShardReadTransaction(DOMStoreReadTransaction transaction, ActorRef shardActor, + SchemaContext schemaContext, ShardStats shardStats) { + super(shardActor, schemaContext, shardStats); + this.transaction = transaction; } - } - protected void closeTransaction(CloseTransaction message) { - transaction.close(); - getSender().tell(new CloseTransactionReply().toSerializable(), getSelf()); - getSelf().tell(PoisonPill.getInstance(), getSelf()); - } - //default scope test method to check if we get correct exception - void forUnitTestOnlyExplicitTransactionClose(){ - transaction.close(); - } + @Override + public void handleReceive(Object message) throws Exception { + if(ReadData.SERIALIZABLE_CLASS.equals(message.getClass())) { + readData(transaction, ReadData.fromSerializable(message)); + } else if(DataExists.SERIALIZABLE_CLASS.equals(message.getClass())) { + dataExists(transaction, DataExists.fromSerializable(message)); + } else { + super.handleReceive(message); + } + } + @Override + protected DOMStoreTransaction getDOMStoreTransaction() { + return transaction; + } }