Get rid of Netty's DelimiterBasedFrameDecoder 90/75490/15
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:03:21 +0000 (11:03 +0200)
commit5c92f1730eafb59a22c6ba160eb8e87b9aee4d4a
treee06d47a88d42f4f9be321b69274fb1d51cc83a26
parent38e1f73f062455df1c833d75128919a4473a71d2
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>
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]