gaoyunhaii commented on a change in pull request #7368: [FLINK-10742][network] Let Netty use Flink's buffers directly in credit-based mode URL: https://github.com/apache/flink/pull/7368#discussion_r390471013
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyTestUtil.java ########## @@ -162,6 +168,37 @@ static NettyConfig createConfig(int segmentSize, Configuration config) throws Ex config); } + // --------------------------------------------------------------------------------------------- + // Encoding & Decoding + // --------------------------------------------------------------------------------------------- + + @SuppressWarnings("unchecked") + static <T extends NettyMessage> T encodeAndDecode(T msg, EmbeddedChannel channel) { + channel.writeOutbound(msg); + ByteBuf encoded = channel.readOutbound(); + + assertTrue(channel.writeInbound(encoded)); + + return (T) channel.readInbound(); Review comment: Remove the parameter ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services