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%2Fdatabroker%2Factors%2Fdds%2FAbstractClientHandle.java;h=003c073de8ea12a101e9542cd4dab9259a8ae946;hp=aa4779c898b5847e3dca9551173d3aa16a2a28fa;hb=refs%2Fchanges%2F49%2F85749%2F63;hpb=e131c3498d286ff14890120ff5e9020ba89f10f9 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHandle.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHandle.java index aa4779c898..003c073de8 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHandle.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHandle.java @@ -12,7 +12,7 @@ import static java.util.Objects.requireNonNull; import com.google.common.annotations.Beta; import com.google.common.base.MoreObjects; -import java.util.Collection; +import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import org.eclipse.jdt.annotation.NonNull; @@ -76,12 +76,13 @@ public abstract class AbstractClientHandle e } private boolean commonAbort() { - final Collection toClose = ensureClosed(); + final Map toClose = ensureClosed(); if (toClose == null) { return false; } - toClose.forEach(AbstractProxyTransaction::abort); + toClose.values().forEach(AbstractProxyTransaction::abort); + parent.onTransactionShardsBound(transactionId, toClose.keySet()); return true; } @@ -95,14 +96,14 @@ public abstract class AbstractClientHandle e * Make sure this snapshot is closed. If it became closed as the effect of this call, return a collection of * {@link AbstractProxyTransaction} handles which need to be closed, too. * - * @return null if this snapshot has already been closed, otherwise a collection of proxies, which need to be + * @return null if this snapshot has already been closed, otherwise a State with of proxies, which need to be * closed, too. */ - final @Nullable Collection ensureClosed() { + final @Nullable Map ensureClosed() { // volatile read and a conditional CAS. This ends up being better in the typical case when we are invoked more // than once (see ClientBackedTransaction) than performing a STATE_UPDATER.getAndSet(). final State local = state; - return local != null && STATE_UPDATER.compareAndSet(this, local, null) ? local.values() : null; + return local != null && STATE_UPDATER.compareAndSet(this, local, null) ? local : null; } final T ensureProxy(final YangInstanceIdentifier path) {