BUG-3219: implement a shared stash for queue reuse 99/20999/1
authorRobert Varga <rovarga@cisco.com>
Tue, 19 May 2015 15:14:06 +0000 (17:14 +0200)
committerMichal Polkorab <michal.polkorab@pantheon.sk>
Fri, 22 May 2015 15:40:36 +0000 (15:40 +0000)
commita302a0cc64ab45e0dd3d504a6b0248c3f1f9e3df
tree5e78e26119008d5d06597ce5fd0b1e07ac9d0c51
parent354c77b535184f0743baa30304d53bf2eea9c936
BUG-3219: implement a shared stash for queue reuse

This introduces a global per-size stash for reuse of OutbountQueueImpl
objects. This allows for efficient reuse across multiple sessions, which
means we minimize stale memory use when some channels are idle.

The stash is implemented in terms of a ConcurrentLinkedDeque, which is
flushed from the tail and has soft references. We rely on
FinalizableReference to notify us when a particular queue is finished.

Change-Id: I78e654a0c3470bbd1c9274237b2be04f50459809
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit b95f82e5129f22e7b22352d028b0d32d744e924d)
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImpl.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueCache.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueCacheSlice.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueImpl.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueManager.java