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%2Fdatabroker%2Factors%2Fdds%2FDistributedDataStoreClientBehavior.java;fp=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatabroker%2Factors%2Fdds%2FDistributedDataStoreClientBehavior.java;h=9940ae57f32858f042084440341d56a660dcb89b;hb=cc1ec4a8e2ec99ad7711d0e5e649b34d37d87da0;hp=eb1dd17bfd9438fc6adff5351db71527d90b3453;hpb=78efa22e4e7b70a468fcbaf120f8613598c36b5b;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClientBehavior.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClientBehavior.java index eb1dd17bfd..9940ae57f3 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClientBehavior.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/DistributedDataStoreClientBehavior.java @@ -20,7 +20,6 @@ import org.opendaylight.controller.cluster.access.client.ClientActorContext; import org.opendaylight.controller.cluster.access.commands.TransactionRequest; import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier; import org.opendaylight.controller.cluster.access.concepts.Response; -import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; import org.opendaylight.controller.cluster.datastore.utils.ActorContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -59,10 +58,8 @@ import org.slf4j.LoggerFactory; final class DistributedDataStoreClientBehavior extends ClientActorBehavior implements DistributedDataStoreClient { private static final Logger LOG = LoggerFactory.getLogger(DistributedDataStoreClientBehavior.class); - private final Map transactions = new ConcurrentHashMap<>(); private final Map histories = new ConcurrentHashMap<>(); private final AtomicLong nextHistoryId = new AtomicLong(1); - private final AtomicLong nextTransactionId = new AtomicLong(); private final ModuleShardBackendResolver resolver; private final SingleClientHistory singleHistory; @@ -99,11 +96,6 @@ final class DistributedDataStoreClientBehavior extends ClientActorBehavior imple h.localAbort(cause); } histories.clear(); - - for (ClientTransaction t : transactions.values()) { - t.localAbort(cause); - } - transactions.clear(); } private DistributedDataStoreClientBehavior shutdown(final ClientActorBehavior currentBehavior) { @@ -158,12 +150,7 @@ final class DistributedDataStoreClientBehavior extends ClientActorBehavior imple @Override public ClientTransaction createTransaction() { - final TransactionIdentifier txId = new TransactionIdentifier(singleHistory.getIdentifier(), - nextTransactionId.getAndIncrement()); - final ClientTransaction tx = new ClientTransaction(singleHistory, txId); - LOG.debug("{}: creating a new transaction {}", persistenceId(), tx); - - return returnIfOperational(transactions, txId, tx, aborted); + return singleHistory.createTransaction(); } @Override @@ -176,10 +163,6 @@ final class DistributedDataStoreClientBehavior extends ClientActorBehavior imple return resolver; } - void transactionComplete(final ClientTransaction transaction) { - transactions.remove(transaction.getIdentifier()); - } - void sendRequest(final TransactionRequest request, final Consumer> completer) { sendRequest(request, response -> { completer.accept(response);