Skip to content

Commit 2a42509

Browse files
author
nmittler
committed
Migrating to Netty 4.1
Fixes grpc#164
1 parent 54be11e commit 2a42509

6 files changed

Lines changed: 7 additions & 16 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ subprojects {
3939

4040
// TODO: Unreleased dependencies.
4141
// These must already be installed in the local maven repository.
42-
netty: 'io.netty:netty-codec-http2:5.0.0.Alpha3-SNAPSHOT',
42+
netty: 'io.netty:netty-codec-http2:4.1.0.Beta5-SNAPSHOT',
4343

4444
// Test dependencies.
4545
junit: 'junit:junit:4.11',

core/src/main/java/io/grpc/transport/AbstractClientStream.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ protected void inboundHeadersReceived(Metadata.Headers headers) {
125125
* Processes the contents of a received data frame from the server.
126126
*
127127
* @param frame the received data frame. Its ownership is transferred to this method.
128-
* @param
129128
*/
130129
protected void inboundDataReceived(Buffer frame) {
131130
Preconditions.checkNotNull(frame, "frame");

core/src/main/java/io/grpc/transport/HttpUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public static Http2Error forCode(long code) {
191191
/**
192192
* Looks up the {@link Status} from the given HTTP/2 error code.
193193
*
194-
* @param errorCode the HTTP/2 error code.
194+
* @param code the HTTP/2 error code.
195195
* @return a {@link Status} representing the given error.
196196
*/
197197
public static Status statusForCode(int code) {

lib/netty

Submodule netty updated 459 files

netty/src/main/java/io/grpc/transport/netty/Http2Negotiator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737

3838
import io.netty.channel.Channel;
3939
import io.netty.channel.ChannelHandler;
40-
import io.netty.channel.ChannelHandlerAdapter;
4140
import io.netty.channel.ChannelHandlerContext;
41+
import io.netty.channel.ChannelInboundHandlerAdapter;
4242
import io.netty.channel.ChannelInitializer;
4343
import io.netty.handler.codec.http.DefaultHttpRequest;
4444
import io.netty.handler.codec.http.HttpClientCodec;
@@ -229,7 +229,7 @@ public ListenableFuture<Void> completeFuture() {
229229
/**
230230
* Report protocol upgrade completion using a promise.
231231
*/
232-
private static class UpgradeCompletionHandler extends ChannelHandlerAdapter {
232+
private static class UpgradeCompletionHandler extends ChannelInboundHandlerAdapter {
233233
private final SettableFuture<Void> upgradeFuture = SettableFuture.create();
234234

235235
public ListenableFuture<Void> getUpgradeFuture() {

netty/src/main/java/io/grpc/transport/netty/Utils.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,9 @@
4545
import io.netty.handler.codec.AsciiString;
4646
import io.netty.handler.codec.http2.DefaultHttp2Headers;
4747
import io.netty.handler.codec.http2.Http2Headers;
48-
import io.netty.util.concurrent.ExecutorServiceFactory;
4948

5049
import java.nio.ByteBuffer;
5150
import java.util.Map;
52-
import java.util.concurrent.ExecutorService;
53-
import java.util.concurrent.Executors;
5451

5552
/**
5653
* Common utility methods.
@@ -177,13 +174,8 @@ private static class DefaultEventLoopGroupResource implements Resource<EventLoop
177174

178175
@Override
179176
public EventLoopGroup create() {
180-
return new NioEventLoopGroup(0, new ExecutorServiceFactory() {
181-
@Override
182-
public ExecutorService newExecutorService(int parallelism) {
183-
return Executors.newFixedThreadPool(parallelism, new ThreadFactoryBuilder()
184-
.setNameFormat(name + "-%d").build());
185-
}
186-
});
177+
return new NioEventLoopGroup(0, new ThreadFactoryBuilder().setNameFormat(name + "-%d")
178+
.build());
187179
}
188180

189181
@Override

0 commit comments

Comments
 (0)