Get rid of Netty's DelimiterBasedFrameDecoder 93/101893/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:32 +0000 (11:54 +0200)
commit31485245cfd7fd304880fe2d28d883c5ab6507c0
treefff6e4bbe838edb456c36566957a55b8e858c2e7
parent425befe0d2297bb3675d0a018c831fd31d48fc9c
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]