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%2FBouncingReconnectForwarder.java;h=3fe6a09bf6d2a9f65864d2ca5b12823f69593c6c;hb=d6ed0a044d591d65847714451d97d80345154089;hp=c6564b66fbf507a9f8d9c0d778284e18853c1527;hpb=320a4e5cd2d9d80468a3f82798744f2035488218;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/BouncingReconnectForwarder.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/BouncingReconnectForwarder.java index c6564b66fb..3fe6a09bf6 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/BouncingReconnectForwarder.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/BouncingReconnectForwarder.java @@ -26,16 +26,20 @@ import org.slf4j.LoggerFactory; // Cohort aware forwarder, which forwards the request to the cohort, giving it a reference to the successor // connection final class BouncingReconnectForwarder extends ReconnectForwarder { - private static final Logger LOG = LoggerFactory.getLogger(BouncingReconnectForwarder.class); - - private static final RequestException FAILED_TO_REPLAY_EXCEPTION = new RequestException("Cohort not found") { + private static final class CohortNotFoundException extends RequestException { private static final long serialVersionUID = 1L; + CohortNotFoundException(final LocalHistoryIdentifier historyId) { + super("Cohort for " + historyId + " not found"); + } + @Override public boolean isRetriable() { return false; } - }; + } + + private static final Logger LOG = LoggerFactory.getLogger(BouncingReconnectForwarder.class); private final Map cohorts; @@ -53,7 +57,7 @@ final class BouncingReconnectForwarder extends ReconnectForwarder { @Override - protected void forwardEntry(final ConnectionEntry entry) { + protected void forwardEntry(final ConnectionEntry entry, final long now) { final Request request = entry.getRequest(); final LocalHistoryIdentifier historyId; @@ -69,7 +73,7 @@ final class BouncingReconnectForwarder extends ReconnectForwarder { final ProxyReconnectCohort cohort = cohorts.get(historyId); if (cohort == null) { LOG.warn("Cohort for request {} not found, aborting it", request); - throw FAILED_TO_REPLAY_EXCEPTION; + throw new CohortNotFoundException(historyId); } // FIXME: do not use sendRequest() once we have throttling in place, as we have already waited the