Get rid of Netty's DelimiterBasedFrameDecoder 92/101892/1
authorJakub Morvay <jmorvay@frinx.io>
Thu, 16 Aug 2018 12:02:02 +0000 (14:02 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 29 Jul 2022 09:54:22 +0000 (11:54 +0200)
commit714ad398eaccdb318d48780f3311467f96a74e1a
tree6c4aff6fa0d4eacbf540ff5d29a790f0b9a0bc2a
parentf9de5461e9bd98b3df266006d6547fc23e45a149
Get rid of Netty's DelimiterBasedFrameDecoder

Netty's DelimiterBasedFrameDecoder is not really effective when dealing
with huge NETCONF messages and reading them in just really small parts
at a time.

DelimiterBasedFrameDecoder always searches whole input ByteBuf for
delimiter when new input bytes are available. It performs the search
also on bytes already checked in previous tries. Obviously, this can be
really ineffective when reading large messages by very small parts at
a time.

Replace Netty's DelimiterBasedFrameDecoder by our own frame detection
implementation. The implementation remembers already checked part of
the input ByteBuf and searches the delimiter just in a new bytes
available.

JIRA: NETCONF-889
Change-Id: If5e78f4373d767f4cf465024313eeac873c1621d
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
Signed-off-by: Maros Marsalek <mmarsalek@frinx.io>
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5c92f1730eafb59a22c6ba160eb8e87b9aee4d4a)
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfEOMAggregator.java
netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/handler/NetconfEOMAggregatorTest.java [new file with mode: 0644]