Introduce ChannelOutboundQueue 36/7136/10
authorRobert Varga <rovarga@cisco.com>
Sat, 17 May 2014 07:59:58 +0000 (09:59 +0200)
committerMichal Polkorab <michal.polkorab@pantheon.sk>
Fri, 30 May 2014 13:16:30 +0000 (13:16 +0000)
commit762983a4d610fe0745e0b0621a03a3079ed64b38
tree9ba78d824932e73ceb34c9ebe233f44f6fc61964
parentd7cd7e34a3ba053277962aa6ebaa1f3a52cf0d63
Introduce ChannelOutboundQueue

This patch introduces a tunable queue for outstanding requests. The core
idea is to maintain a limited queue between the message produces and the
IO threads. The producers place their pre-made messages to the queue,
where the IO thread picks them up and pushes them down the pipeline.
Should the queue be empty, the caller is informed of this fact and can
choose a recovery strategy -- current implementation reports
RejectedExecutionException.

The flush task is placed in the IO pool only when the channel is
writable and the queue is non-empty. A single run of the flush task is
time-limited, so a single channel which is being churned by producer
does not end up monopolizing a particular thread for extended periods of
time -- after a tunable time the flush task will re-insert itself on the
task queue and exit.

Change-Id: If6f09c60cf2cf5a69e9f051e2dfe2bae3bb90b5d
Signed-off-by: Robert Varga <rovarga@cisco.com>
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/AbstractRpcListener.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/ChannelOutboundQueue.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/ConnectionAdapterImpl.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/ResponseExpectedRpcListener.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/SimpleRpcListener.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java