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%2FTransmitQueue.java;h=705bb0d9cd6e7a32da5f45884bc3d07b6f2592ed;hb=90c86de54d7bf10bfb9ffb0a8ad6a818aeecc895;hp=24264eeedff77bca598e58d4d3f4f4a6ac996c34;hpb=dafc95d149bc62f101de37e94b9b5e3526d4e87b;p=controller.git diff --git a/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/TransmitQueue.java b/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/TransmitQueue.java index 24264eeedf..705bb0d9cd 100644 --- a/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/TransmitQueue.java +++ b/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/TransmitQueue.java @@ -212,18 +212,31 @@ abstract class TransmitQueue { inflight.addLast(transmit(entry, now)); } - /** - * Enqueue an entry, possibly also transmitting it. - * - * @return Delay to be forced on the calling thread, in nanoseconds. - */ - final long enqueue(final ConnectionEntry entry, final long now) { + final long enqueueOrForward(final ConnectionEntry entry, final long now) { if (successor != null) { // This call will pay the enqueuing price, hence the caller does not have to successor.forwardEntry(entry, now); return 0; } + return enqueue(entry, now); + } + + final void enqueueOrReplay(final ConnectionEntry entry, final long now) { + if (successor != null) { + successor.replayEntry(entry, now); + } else { + enqueue(entry, now); + } + } + + /** + * Enqueue an entry, possibly also transmitting it. + * + * @return Delay to be forced on the calling thread, in nanoseconds. + */ + private long enqueue(final ConnectionEntry entry, final long now) { + // XXX: we should place a guard against incorrect entry sequences: // entry.getEnqueueTicks() should have non-negative difference from the last entry present in the queues