X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcds-access-client%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fclient%2FConnectingClientConnection.java;h=aa986873d57e03f841e27986d24f57fa5e9cf402;hb=refs%2Fchanges%2F53%2F49053%2F18;hp=e28f9b35ed3e11f24e7a283157bd84cc48bbb04d;hpb=b604e392408dfbf46ee0a7e1ac4cd27170a83bff;p=controller.git diff --git a/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/ConnectingClientConnection.java b/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/ConnectingClientConnection.java index e28f9b35ed..aa986873d5 100644 --- a/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/ConnectingClientConnection.java +++ b/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/ConnectingClientConnection.java @@ -7,18 +7,21 @@ */ package org.opendaylight.controller.cluster.access.client; -import akka.actor.ActorRef; import com.google.common.annotations.Beta; -import java.util.Map.Entry; import java.util.Optional; -import org.opendaylight.controller.cluster.access.concepts.Request; -import org.opendaylight.controller.cluster.access.concepts.RequestEnvelope; @Beta public final class ConnectingClientConnection extends AbstractClientConnection { + /** + * A wild estimate on how deep a queue should be. Without having knowledge of the remote actor we can only + * guess its processing capabilities while we are doing initial buffering. With {@link AveragingProgressTracker} + * this boils down to a burst of up to 2000 messages before we start throttling. + */ + private static final int TARGET_QUEUE_DEPTH = 4000; + // Initial state, never instantiated externally ConnectingClientConnection(final ClientActorContext context, final Long cookie) { - super(context, cookie); + super(context, cookie, new TransmitQueue.Halted(TARGET_QUEUE_DEPTH)); } @Override @@ -30,15 +33,4 @@ public final class ConnectingClientConnection extends Abs ClientActorBehavior reconnectConnection(final ClientActorBehavior current) { throw new UnsupportedOperationException("Attempted to reconnect a connecting connection"); } - - @Override - Entry prepareForTransmit(final Request req) { - // This is guarded by remoteMaxMessages() == 0 - throw new UnsupportedOperationException("Attempted to transmit on a connecting connection"); - } - - @Override - int remoteMaxMessages() { - return 0; - } }