Skip to content

Commit

Permalink
[FLINK-11154][network] Bump Netty to 4.1.32
Browse files Browse the repository at this point in the history
Notable changes since 4.1.24:
- big improvements (performance, feature set) for using openSSL based
  SSL engine (useful for FLINK-9816)
- allow multiple shaded versions of the same netty artifact (as long
  as the shaded prefix is different)
- Ensure ByteToMessageDecoder.Cumulator implementations always release
- Don't re-arm timerfd each epoll_wait
- Use a non-volatile read for ensureAccessible() whenever possible to
  reduce overhead and allow better inlining.
- Do not fail on runtime when an older version of Log4J2 is on the
  classpath
- Fix leak and corruption bugs in CompositeByteBuf
- Add support for TLSv1.3
- Harden ref-counting concurrency semantics
- bug fixes
- Java 9-12 related fixes

- no license changes
- no changes in Netty's NOTICE file
  • Loading branch information
Nico Kruber authored and zentol committed Feb 16, 2019
1 parent a9eb6d7 commit 876f991
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2012 The Netty Project
* Copy from netty 4.1.24.Final
* Copy from netty 4.1.32.Final
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
Expand Down Expand Up @@ -36,6 +36,7 @@
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.CharBuffer;
import java.nio.ReadOnlyBufferException;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
Expand Down Expand Up @@ -77,7 +78,7 @@
/**
* An abstract test class for channel buffers.
*
* Copy from netty 4.1.24.Final.
* Copy from netty 4.1.32.Final.
*/
public abstract class AbstractByteBufTest extends TestLogger {

Expand Down Expand Up @@ -3656,11 +3657,23 @@ public void testSetUtf16CharSequence() {
testSetGetCharSequence(CharsetUtil.UTF_16);
}

private static final CharBuffer EXTENDED_ASCII_CHARS, ASCII_CHARS;

static {
char[] chars = new char[256];
for (char c = 0; c < chars.length; c++) {
chars[c] = c;
}
EXTENDED_ASCII_CHARS = CharBuffer.wrap(chars);
ASCII_CHARS = CharBuffer.wrap(chars, 0, 128);
}

private void testSetGetCharSequence(Charset charset) {
ByteBuf buf = newBuffer(16);
String sequence = "AB";
ByteBuf buf = newBuffer(1024);
CharBuffer sequence = CharsetUtil.US_ASCII.equals(charset)
? ASCII_CHARS : EXTENDED_ASCII_CHARS;
int bytes = buf.setCharSequence(1, sequence, charset);
assertEquals(sequence, buf.getCharSequence(1, bytes, charset));
assertEquals(sequence, CharBuffer.wrap(buf.getCharSequence(1, bytes, charset)));
buf.release();
}

Expand All @@ -3685,12 +3698,13 @@ public void testWriteReadUtf16CharSequence() {
}

private void testWriteReadCharSequence(Charset charset) {
ByteBuf buf = newBuffer(16);
String sequence = "AB";
ByteBuf buf = newBuffer(1024);
CharBuffer sequence = CharsetUtil.US_ASCII.equals(charset)
? ASCII_CHARS : EXTENDED_ASCII_CHARS;
buf.writerIndex(1);
int bytes = buf.writeCharSequence(sequence, charset);
buf.readerIndex(1);
assertEquals(sequence, buf.readCharSequence(bytes, charset));
assertEquals(sequence, CharBuffer.wrap(buf.readCharSequence(bytes, charset)));
buf.release();
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ under the License.
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-shaded-netty</artifactId>
<version>4.1.24.Final-5.0</version>
<version>4.1.32.Final-${flink.shaded.version}</version>
</dependency>

<!-- This manages the 'javax.annotation' annotations (JSR305) -->
Expand Down

0 comments on commit 876f991

Please sign in to comment.