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%2FAbstractProxyTransaction.java;h=14ad54699161a60719ea846d353c46e73fb4adea;hb=HEAD;hp=11027e4ce8d6fa9d60c65c81b794bbda198f9110;hpb=7ca786c387d769ee9b4db41446052646ed85bf32;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyTransaction.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyTransaction.java index 11027e4ce8..14ad546991 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyTransaction.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyTransaction.java @@ -65,10 +65,9 @@ import org.slf4j.LoggerFactory; *

* This class interacts with the queueing mechanism in ClientActorBehavior, hence once we arrive at a decision * to use either a local or remote implementation, we are stuck with it. We can re-evaluate on the next transaction. - * - * @author Robert Varga */ -abstract class AbstractProxyTransaction implements Identifiable { +abstract sealed class AbstractProxyTransaction implements Identifiable + permits LocalProxyTransaction, RemoteProxyTransaction { /** * Marker object used instead of read-type of requests, which are satisfied only once. This has a lower footprint * and allows compressing multiple requests into a single entry. This class is not thread-safe. @@ -140,7 +139,7 @@ abstract class AbstractProxyTransaction implements Identifiable optState = flushState(); if (optState.isPresent()) { - forwardToSuccessor(successor, optState.get(), null); + forwardToSuccessor(successor, optState.orElseThrow(), null); } successor.predecessorSealed(); } @@ -734,7 +733,7 @@ abstract class AbstractProxyTransaction implements Identifiable optState = flushState(); if (optState.isPresent()) { - successor.handleReplayedRemoteRequest(optState.get(), null, enqueuedTicks); + successor.handleReplayedRemoteRequest(optState.orElseThrow(), null, enqueuedTicks); } if (successor.markSealed()) { successor.sealAndSend(OptionalLong.of(enqueuedTicks));