diff --git a/CHANGELOG.md b/CHANGELOG.md index 45952baaa3..45bb5edf81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ and what APIs have changed, if applicable. ## [Unreleased] +## [30.0.0] - 2022-03-24 +- Introduce restli-netty, a shaded Netty dependency for use with r2. + ## [29.33.0] - 2022-03-28 - Add Support for ByteString[] Query Parameters @@ -5212,7 +5215,8 @@ patch operations can re-use these classes for generating patch messages. ## [0.14.1] -[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.33.0...master +[Unreleased]: https://github.com/linkedin/rest.li/compare/v30.0.0...master +[30.0.0]: https://github.com/linkedin/rest.li/compare/v29.33.0...v30.0.0 [29.33.0]: https://github.com/linkedin/rest.li/compare/v29.32.5...v29.33.0 [29.32.5]: https://github.com/linkedin/rest.li/compare/v29.32.4...v29.32.5 [29.32.4]: https://github.com/linkedin/rest.li/compare/v29.32.3...v29.32.4 diff --git a/build.gradle b/build.gradle index c0471b4c10..53ebe71841 100644 --- a/build.gradle +++ b/build.gradle @@ -16,9 +16,11 @@ buildscript { repositories { + gradlePluginPortal() jcenter() } dependencies { + classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0' classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.21.0' classpath 'org.jacoco:org.jacoco.core:0.8.7' } diff --git a/build_script/publications.gradle b/build_script/publications.gradle index 8f13c05d25..a86e26ab1b 100644 --- a/build_script/publications.gradle +++ b/build_script/publications.gradle @@ -61,13 +61,19 @@ def manipulatePomXml = { publishing { publications { // Define the "release" publication - release(MavenPublication) { - from components.java + release(MavenPublication) { publication -> + if (project.name == 'restli-netty') { + apply plugin: 'com.github.johnrengelman.shadow' + project.shadow.component(publication) + } else { + from components.java + } afterEvaluate { // Add all extra archives (sources, javadoc, any custom archives e.g. all) project.configurations.archives.allArtifacts.forEach { - if (it.classifier) { + // Skip 'slim' identifier, otherwise this logic attemps to publish the disabled slim jar for restli-netty. + if (it.classifier && it.classifier != 'slim') { artifact it } } diff --git a/d2-int-test/build.gradle b/d2-int-test/build.gradle index 6303ab1e40..75ff3b1fbc 100644 --- a/d2-int-test/build.gradle +++ b/d2-int-test/build.gradle @@ -12,7 +12,6 @@ dependencies { compile externalDependency.commonsHttpClient compile externalDependency.zookeeper compile externalDependency.jdkTools - compile externalDependency.netty testCompile externalDependency.testng testCompile externalDependency.commonsIo testCompile project(path: ':d2', configuration: 'testArtifacts') diff --git a/gradle.properties b/gradle.properties index 6e7e6b75d5..914f80ac85 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=29.33.0 +version=30.0.0 group=com.linkedin.pegasus org.gradle.configureondemand=true org.gradle.parallel=true diff --git a/multipart-mime/build.gradle b/multipart-mime/build.gradle index de3dd0bd4a..529324111c 100644 --- a/multipart-mime/build.gradle +++ b/multipart-mime/build.gradle @@ -4,6 +4,9 @@ dependencies { compile externalDependency.javaxActivation compile externalDependency.commonsLang testCompile project(':r2-int-test') + testCompile project(':r2-netty') + testCompile project(':r2-sample') + testCompile project(':test-util') testCompile externalDependency.testng testCompile externalDependency.mail testCompile externalDependency.easymock diff --git a/r2-int-test/build.gradle b/r2-int-test/build.gradle index 08ae3d7ba1..84d53ae9f2 100644 --- a/r2-int-test/build.gradle +++ b/r2-int-test/build.gradle @@ -6,6 +6,7 @@ dependencies { testCompile externalDependency.testng testCompile externalDependency.junit compile externalDependency.commonsLang + implementation project(path: ':restli-netty', configuration: 'shadow') } tasks.withType(Test) { diff --git a/r2-int-test/src/test/java/test/r2/integ/clientserver/TestHttpsEarlyHandshake.java b/r2-int-test/src/test/java/test/r2/integ/clientserver/TestHttpsEarlyHandshake.java index 6017d9a1e2..582e32e486 100644 --- a/r2-int-test/src/test/java/test/r2/integ/clientserver/TestHttpsEarlyHandshake.java +++ b/r2-int-test/src/test/java/test/r2/integ/clientserver/TestHttpsEarlyHandshake.java @@ -25,11 +25,11 @@ import com.linkedin.r2.transport.http.client.common.ChannelPoolManagerFactoryImpl; import com.linkedin.r2.transport.http.client.common.ChannelPoolManagerKey; import com.linkedin.r2.transport.http.client.common.ChannelPoolManagerKeyBuilder; -import io.netty.channel.Channel; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.handler.ssl.SslHandler; -import io.netty.util.concurrent.Future; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.nio.NioEventLoopGroup; +import com.linkedin.pegasus.io.netty.handler.ssl.SslHandler; +import com.linkedin.pegasus.io.netty.util.concurrent.Future; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketAddress; diff --git a/r2-int-test/src/test/java/test/r2/integ/clientserver/providers/client/AbstractClientProvider.java b/r2-int-test/src/test/java/test/r2/integ/clientserver/providers/client/AbstractClientProvider.java index 9d0ebcf71f..69ac6f2d30 100644 --- a/r2-int-test/src/test/java/test/r2/integ/clientserver/providers/client/AbstractClientProvider.java +++ b/r2-int-test/src/test/java/test/r2/integ/clientserver/providers/client/AbstractClientProvider.java @@ -24,7 +24,7 @@ import com.linkedin.r2.transport.common.Client; import com.linkedin.r2.transport.http.client.HttpClientFactory; import com.linkedin.r2.util.NamedThreadFactory; -import io.netty.channel.nio.NioEventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.nio.NioEventLoopGroup; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/r2-netty/build.gradle b/r2-netty/build.gradle index f3d998a67d..c919428989 100644 --- a/r2-netty/build.gradle +++ b/r2-netty/build.gradle @@ -4,9 +4,9 @@ dependencies { compile project(':r2-core') compile project(':r2-disruptor') compile project(':r2-filter-compression') + implementation project(path: ':restli-netty', configuration: 'shadow') compile externalDependency.commonsLang - compile externalDependency.netty testCompile project(path: ':r2-core', configuration: 'testArtifacts') testCompile externalDependency.mockito diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/client/HttpNettyClient.java b/r2-netty/src/main/java/com/linkedin/r2/netty/client/HttpNettyClient.java index e9d0ac9fac..ee40881c89 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/client/HttpNettyClient.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/client/HttpNettyClient.java @@ -55,12 +55,12 @@ import com.linkedin.r2.util.Timeout; import com.linkedin.util.ArgumentUtil; import com.linkedin.util.clock.Clock; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFutureListener; -import io.netty.channel.ChannelPipeline; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.pool.ChannelPool; -import io.netty.handler.codec.http.HttpScheme; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelFutureListener; +import com.linkedin.pegasus.io.netty.channel.ChannelPipeline; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.pool.ChannelPool; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpScheme; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketAddress; diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/client/http/HttpChannelInitializer.java b/r2-netty/src/main/java/com/linkedin/r2/netty/client/http/HttpChannelInitializer.java index 3692a78e0a..cff648e9ed 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/client/http/HttpChannelInitializer.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/client/http/HttpChannelInitializer.java @@ -25,10 +25,10 @@ import com.linkedin.r2.netty.handler.common.SslHandshakeTimingHandler; import com.linkedin.r2.netty.handler.http.HttpMessageDecoders; import com.linkedin.r2.netty.handler.http.HttpMessageEncoders; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.codec.http.HttpClientCodec; -import io.netty.handler.codec.http.HttpScheme; +import com.linkedin.pegasus.io.netty.channel.ChannelInitializer; +import com.linkedin.pegasus.io.netty.channel.socket.nio.NioSocketChannel; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpClientCodec; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpScheme; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLParameters; @@ -37,7 +37,7 @@ * the channel pipeline is setup with the following additional handlers. * * DefaultChannelPipeline { - * (sslHandler = {@link io.netty.handler.ssl.SslHandler}), + * (sslHandler = {@link com.linkedin.pegasus.io.netty.handler.ssl.SslHandler}), * (CertificateHandler = {@link CertificateHandler}), * (sslHandshakeTimingHandler = {@link SslHandshakeTimingHandler}) * } @@ -45,7 +45,7 @@ * The rest of the handlers are common between SSL and non-SSL. * * DefaultChannelPipeline { - * (codec = {@link io.netty.handler.codec.http.HttpClientCodec}), + * (codec = {@link com.linkedin.pegasus.io.netty.handler.codec.http.HttpClientCodec}), * (outboundRestRequestEncoder = {@link HttpMessageEncoders.RestRequestEncoder}), * (outboundStreamDataEncoder = {@link HttpMessageEncoders.DataEncoder}), * (outboundStreamRequestEncoder = {@link HttpMessageEncoders.StreamRequestEncoder}), diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/client/http/HttpChannelPoolFactory.java b/r2-netty/src/main/java/com/linkedin/r2/netty/client/http/HttpChannelPoolFactory.java index 4467aefd8f..d5e421e276 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/client/http/HttpChannelPoolFactory.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/client/http/HttpChannelPoolFactory.java @@ -23,13 +23,13 @@ import com.linkedin.r2.transport.http.client.common.ChannelPoolFactory; import com.linkedin.r2.transport.http.client.common.ChannelPoolLifecycle; import com.linkedin.util.clock.SystemClock; -import io.netty.bootstrap.Bootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelOption; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.group.ChannelGroup; -import io.netty.channel.socket.nio.NioSocketChannel; +import com.linkedin.pegasus.io.netty.bootstrap.Bootstrap; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelInitializer; +import com.linkedin.pegasus.io.netty.channel.ChannelOption; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.group.ChannelGroup; +import com.linkedin.pegasus.io.netty.channel.socket.nio.NioSocketChannel; import java.net.SocketAddress; import java.util.concurrent.ScheduledExecutorService; import javax.net.ssl.SSLContext; diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2ChannelInitializer.java b/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2ChannelInitializer.java index 17ff615789..d912e0a940 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2ChannelInitializer.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2ChannelInitializer.java @@ -29,23 +29,23 @@ import com.linkedin.r2.netty.handler.http2.Http2MessageEncoders; import com.linkedin.r2.netty.handler.http2.Http2ProtocolUpgradeHandler; import com.linkedin.r2.netty.handler.http2.UnsupportedHandler; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelPromise; -import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.codec.http.HttpClientCodec; -import io.netty.handler.codec.http.HttpClientUpgradeHandler; -import io.netty.handler.codec.http2.Http2ClientUpgradeCodec; -import io.netty.handler.codec.http2.Http2ConnectionHandler; -import io.netty.handler.codec.http2.Http2FrameCodec; -import io.netty.handler.codec.http2.Http2FrameCodecBuilder; -import io.netty.handler.codec.http2.Http2MultiplexHandler; -import io.netty.handler.codec.http2.Http2Settings; -import io.netty.handler.ssl.ApplicationProtocolConfig; -import io.netty.handler.ssl.ApplicationProtocolNames; -import io.netty.handler.ssl.ClientAuth; -import io.netty.handler.ssl.IdentityCipherSuiteFilter; -import io.netty.handler.ssl.JdkSslContext; -import io.netty.handler.ssl.SslContext; +import com.linkedin.pegasus.io.netty.channel.ChannelInitializer; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.channel.socket.nio.NioSocketChannel; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpClientCodec; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpClientUpgradeHandler; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2ClientUpgradeCodec; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2ConnectionHandler; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2FrameCodec; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2FrameCodecBuilder; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2MultiplexHandler; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Settings; +import com.linkedin.pegasus.io.netty.handler.ssl.ApplicationProtocolConfig; +import com.linkedin.pegasus.io.netty.handler.ssl.ApplicationProtocolNames; +import com.linkedin.pegasus.io.netty.handler.ssl.ClientAuth; +import com.linkedin.pegasus.io.netty.handler.ssl.IdentityCipherSuiteFilter; +import com.linkedin.pegasus.io.netty.handler.ssl.JdkSslContext; +import com.linkedin.pegasus.io.netty.handler.ssl.SslContext; import java.util.Arrays; import javax.net.ssl.SSLContext; @@ -65,7 +65,7 @@ * are added and the pipeline should be setup with the following handlers. * * DefaultChannelPipeline { - * (sslHandler = {@link io.netty.handler.ssl.SslHandler}), + * (sslHandler = {@link com.linkedin.pegasus.io.netty.handler.ssl.SslHandler}), * (CertificateHandler = {@link CertificateHandler}), * (sslHandshakeTimingHandler = {@link SslHandshakeTimingHandler}), * (Http2FrameCodec = {@link Http2FrameCodec}) diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2ChannelLifecycle.java b/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2ChannelLifecycle.java index cdd7d1896f..59641c8acf 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2ChannelLifecycle.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2ChannelLifecycle.java @@ -23,10 +23,10 @@ import com.linkedin.r2.transport.http.client.PoolStats; import com.linkedin.r2.transport.http.client.TimeoutCallback; import com.linkedin.util.clock.Clock; -import io.netty.channel.Channel; -import io.netty.channel.group.ChannelGroup; -import io.netty.handler.codec.http2.Http2StreamChannel; -import io.netty.handler.codec.http2.Http2StreamChannelBootstrap; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.group.ChannelGroup; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2StreamChannel; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2StreamChannelBootstrap; import java.net.SocketAddress; import java.util.ArrayDeque; import java.util.ArrayList; diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2ChannelPoolFactory.java b/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2ChannelPoolFactory.java index 7f348b4625..809a5d0858 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2ChannelPoolFactory.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2ChannelPoolFactory.java @@ -23,13 +23,13 @@ import com.linkedin.r2.transport.http.client.common.ChannelPoolFactory; import com.linkedin.r2.transport.http.client.common.ChannelPoolLifecycle; import com.linkedin.util.clock.SystemClock; -import io.netty.bootstrap.Bootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelOption; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.group.ChannelGroup; -import io.netty.channel.socket.nio.NioSocketChannel; +import com.linkedin.pegasus.io.netty.bootstrap.Bootstrap; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelInitializer; +import com.linkedin.pegasus.io.netty.channel.ChannelOption; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.group.ChannelGroup; +import com.linkedin.pegasus.io.netty.channel.socket.nio.NioSocketChannel; import java.net.SocketAddress; import java.util.concurrent.ScheduledExecutorService; import javax.net.ssl.SSLContext; diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2StreamChannelInitializer.java b/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2StreamChannelInitializer.java index 4ced5de245..06d53f0dda 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2StreamChannelInitializer.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/client/http2/Http2StreamChannelInitializer.java @@ -22,9 +22,9 @@ import com.linkedin.r2.netty.handler.common.SchemeHandler; import com.linkedin.r2.netty.handler.http2.Http2MessageDecoders; import com.linkedin.r2.netty.handler.http2.Http2MessageEncoders; -import io.netty.channel.Channel; -import io.netty.channel.ChannelInitializer; -import io.netty.handler.codec.http.HttpScheme; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelInitializer; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpScheme; /** * Netty handler to setup the Http2 Stream Channel pipeline diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/common/ChannelPipelineEvent.java b/r2-netty/src/main/java/com/linkedin/r2/netty/common/ChannelPipelineEvent.java index 21c1ddbbad..c57b0cf031 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/common/ChannelPipelineEvent.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/common/ChannelPipelineEvent.java @@ -16,8 +16,8 @@ package com.linkedin.r2.netty.common; -import io.netty.channel.Channel; -import io.netty.channel.ChannelPipeline; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelPipeline; /** * Enumerates the user events potentially raised in the {@link ChannelPipeline}. diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/common/NettyChannelAttributes.java b/r2-netty/src/main/java/com/linkedin/r2/netty/common/NettyChannelAttributes.java index 831c4e71d1..f2daa2f1e8 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/common/NettyChannelAttributes.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/common/NettyChannelAttributes.java @@ -23,11 +23,11 @@ import com.linkedin.r2.transport.http.client.AsyncPool; import com.linkedin.r2.transport.http.client.common.ssl.SslSessionValidator; import com.linkedin.r2.util.Timeout; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelPipeline; -import io.netty.util.AttributeKey; -import io.netty.util.concurrent.Promise; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelFuture; +import com.linkedin.pegasus.io.netty.channel.ChannelPipeline; +import com.linkedin.pegasus.io.netty.util.AttributeKey; +import com.linkedin.pegasus.io.netty.util.concurrent.Promise; import java.util.concurrent.ScheduledFuture; /** diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/common/NettyRequestAdapter.java b/r2-netty/src/main/java/com/linkedin/r2/netty/common/NettyRequestAdapter.java index e3cb23b1df..262543ee8d 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/common/NettyRequestAdapter.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/common/NettyRequestAdapter.java @@ -21,19 +21,19 @@ import com.linkedin.r2.message.stream.StreamRequest; import com.linkedin.r2.transport.http.common.HttpConstants; import com.linkedin.r2.transport.http.util.CookieUtil; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.handler.codec.http.DefaultFullHttpRequest; -import io.netty.handler.codec.http.DefaultHttpRequest; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpHeaderValues; -import io.netty.handler.codec.http.HttpMethod; -import io.netty.handler.codec.http.HttpRequest; -import io.netty.handler.codec.http.HttpVersion; -import io.netty.handler.codec.http2.DefaultHttp2Headers; -import io.netty.handler.codec.http2.Http2Headers; -import io.netty.handler.codec.http2.HttpConversionUtil; -import io.netty.util.AsciiString; +import com.linkedin.pegasus.io.netty.buffer.ByteBuf; +import com.linkedin.pegasus.io.netty.buffer.Unpooled; +import com.linkedin.pegasus.io.netty.handler.codec.http.DefaultFullHttpRequest; +import com.linkedin.pegasus.io.netty.handler.codec.http.DefaultHttpRequest; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpHeaderNames; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpHeaderValues; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpMethod; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpRequest; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpVersion; +import com.linkedin.pegasus.io.netty.handler.codec.http2.DefaultHttp2Headers; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Headers; +import com.linkedin.pegasus.io.netty.handler.codec.http2.HttpConversionUtil; +import com.linkedin.pegasus.io.netty.util.AsciiString; import java.net.URI; import java.net.URL; import java.util.HashSet; diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/common/SslHandlerUtil.java b/r2-netty/src/main/java/com/linkedin/r2/netty/common/SslHandlerUtil.java index 29bb687c85..074264e06a 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/common/SslHandlerUtil.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/common/SslHandlerUtil.java @@ -16,7 +16,7 @@ package com.linkedin.r2.netty.common; -import io.netty.handler.ssl.SslHandler; +import com.linkedin.pegasus.io.netty.handler.ssl.SslHandler; import java.util.Arrays; import java.util.HashSet; import java.util.Set; diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/common/StreamingTimeout.java b/r2-netty/src/main/java/com/linkedin/r2/netty/common/StreamingTimeout.java index 501a506be1..b9d14ce337 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/common/StreamingTimeout.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/common/StreamingTimeout.java @@ -18,8 +18,8 @@ import com.linkedin.util.clock.Clock; import com.linkedin.util.clock.SystemClock; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/entitystream/StreamReader.java b/r2-netty/src/main/java/com/linkedin/r2/netty/entitystream/StreamReader.java index 0a70246674..938610499d 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/entitystream/StreamReader.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/entitystream/StreamReader.java @@ -23,7 +23,7 @@ import com.linkedin.r2.netty.common.NettyChannelAttributes; import com.linkedin.r2.netty.common.StreamingTimeout; import com.linkedin.util.clock.SystemClock; -import io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; /** * Entity stream {@link Reader} implementation that reads from the entity stream diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/entitystream/StreamWriter.java b/r2-netty/src/main/java/com/linkedin/r2/netty/entitystream/StreamWriter.java index b8d8799b0f..89f1dc87ae 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/entitystream/StreamWriter.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/entitystream/StreamWriter.java @@ -24,12 +24,12 @@ import com.linkedin.r2.netty.common.ChannelPipelineEvent; import com.linkedin.r2.netty.common.NettyChannelAttributes; import com.linkedin.r2.netty.common.StreamingTimeout; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.channel.ChannelPipeline; -import io.netty.handler.codec.TooLongFrameException; -import io.netty.handler.codec.http2.Http2StreamChannel; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelInboundHandlerAdapter; +import com.linkedin.pegasus.io.netty.channel.ChannelPipeline; +import com.linkedin.pegasus.io.netty.handler.codec.TooLongFrameException; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2StreamChannel; import java.util.LinkedList; import java.util.List; import org.slf4j.Logger; diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/CancelTimeoutHandler.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/CancelTimeoutHandler.java index bef8f01749..494dadedb1 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/CancelTimeoutHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/CancelTimeoutHandler.java @@ -19,10 +19,10 @@ import com.linkedin.r2.netty.common.ChannelPipelineEvent; import com.linkedin.r2.netty.common.StreamingTimeout; import com.linkedin.r2.netty.common.NettyChannelAttributes; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.channel.ChannelPipeline; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelInboundHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelInboundHandlerAdapter; +import com.linkedin.pegasus.io.netty.channel.ChannelPipeline; import java.util.concurrent.ScheduledFuture; /** diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/CertificateHandler.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/CertificateHandler.java index d4908a644e..a7595d0fca 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/CertificateHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/CertificateHandler.java @@ -19,10 +19,10 @@ import com.linkedin.r2.netty.common.NettyChannelAttributes; import com.linkedin.r2.transport.http.client.common.ssl.SslSessionNotTrustedException; import com.linkedin.r2.transport.http.client.common.ssl.SslSessionValidator; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelOutboundHandlerAdapter; -import io.netty.channel.ChannelPromise; -import io.netty.handler.ssl.SslHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelOutboundHandlerAdapter; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.handler.ssl.SslHandler; /** * In the case the user requires the Server verification, we extract the diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/ChannelLifecycleHandler.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/ChannelLifecycleHandler.java index d75da143cc..a66226d702 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/ChannelLifecycleHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/ChannelLifecycleHandler.java @@ -20,11 +20,11 @@ import com.linkedin.r2.netty.common.NettyChannelAttributes; import com.linkedin.r2.netty.common.ShutdownTimeoutException; import com.linkedin.r2.transport.http.client.AsyncPool; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.channel.pool.ChannelPool; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelInboundHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelInboundHandlerAdapter; +import com.linkedin.pegasus.io.netty.channel.pool.ChannelPool; /** * An implementation of {@link ChannelInboundHandler} that returns or disposes the diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/ClientEntityStreamHandler.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/ClientEntityStreamHandler.java index c8612f02d1..baa7b21752 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/ClientEntityStreamHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/ClientEntityStreamHandler.java @@ -30,10 +30,10 @@ import com.linkedin.r2.transport.common.bridge.common.TransportCallback; import com.linkedin.r2.transport.common.bridge.common.TransportResponseImpl; import com.linkedin.r2.transport.http.client.stream.OrderedEntityStreamReader; -import io.netty.channel.ChannelDuplexHandler; -import io.netty.channel.ChannelHandler.Sharable; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.channel.ChannelDuplexHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandler.Sharable; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; import java.nio.channels.ClosedChannelException; import java.util.Map; import java.util.TreeMap; diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/SchemeHandler.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/SchemeHandler.java index 2a2ce4903e..f1703fa458 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/SchemeHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/SchemeHandler.java @@ -19,9 +19,9 @@ import com.linkedin.r2.message.Request; import com.linkedin.r2.message.rest.RestRequest; import com.linkedin.r2.message.stream.StreamRequest; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelOutboundHandlerAdapter; -import io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelOutboundHandlerAdapter; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; import java.net.URI; /** diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/SessionResumptionSslHandler.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/SessionResumptionSslHandler.java index 95f4bcffa9..26d45b9fd6 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/SessionResumptionSslHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/SessionResumptionSslHandler.java @@ -17,14 +17,14 @@ package com.linkedin.r2.netty.handler.common; import com.linkedin.r2.netty.common.SslHandlerUtil; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelOutboundHandlerAdapter; -import io.netty.channel.ChannelPromise; -import io.netty.handler.ssl.SslContext; -import io.netty.handler.ssl.SslHandler; -import io.netty.util.AttributeKey; -import io.netty.util.concurrent.Future; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelOutboundHandlerAdapter; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.handler.ssl.SslContext; +import com.linkedin.pegasus.io.netty.handler.ssl.SslHandler; +import com.linkedin.pegasus.io.netty.util.AttributeKey; +import com.linkedin.pegasus.io.netty.util.concurrent.Future; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.util.concurrent.TimeUnit; diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/SslHandshakeTimingHandler.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/SslHandshakeTimingHandler.java index bc480b252e..33badbb731 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/SslHandshakeTimingHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/common/SslHandshakeTimingHandler.java @@ -22,19 +22,19 @@ import com.linkedin.r2.message.timing.TimingKey; import com.linkedin.r2.message.timing.TimingNameConstants; import com.linkedin.r2.transport.common.bridge.common.TransportCallback; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelOutboundHandlerAdapter; -import io.netty.handler.ssl.SslHandler; -import io.netty.util.AttributeKey; -import io.netty.util.concurrent.Future; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelOutboundHandlerAdapter; +import com.linkedin.pegasus.io.netty.handler.ssl.SslHandler; +import com.linkedin.pegasus.io.netty.util.AttributeKey; +import com.linkedin.pegasus.io.netty.util.concurrent.Future; /** * An SSL handler that records time in establishing a handshake. * - * SSL hand shake starts when {@link SslHandler} is added to {@link io.netty.channel.ChannelPipeline}. - * This handler is added after {@link SslHandler}, so technically this timer is started after hand shake begins, - * but the difference should be negligible. + * SSL hand shake starts when {@link SslHandler} is added to + * {@link com.linkedin.pegasus.io.netty.channel.ChannelPipeline}. This handler is added after {@link SslHandler}, so + * technically this timer is started after hand shake begins, but the difference should be negligible. * * @author Xialin Zhu */ diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http/HttpMessageDecoders.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http/HttpMessageDecoders.java index 40cbec4695..49affb62d9 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http/HttpMessageDecoders.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http/HttpMessageDecoders.java @@ -20,15 +20,15 @@ import com.linkedin.r2.message.stream.StreamResponseBuilder; import com.linkedin.r2.netty.entitystream.StreamWriter; import com.linkedin.r2.transport.http.common.HttpConstants; -import io.netty.buffer.ByteBufInputStream; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandler.Sharable; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageDecoder; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.HttpResponse; -import io.netty.handler.codec.http.HttpUtil; -import io.netty.handler.codec.http.LastHttpContent; +import com.linkedin.pegasus.io.netty.buffer.ByteBufInputStream; +import com.linkedin.pegasus.io.netty.channel.ChannelHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandler.Sharable; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.handler.codec.MessageToMessageDecoder; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpContent; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpResponse; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpUtil; +import com.linkedin.pegasus.io.netty.handler.codec.http.LastHttpContent; import java.util.List; import java.util.Map; diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http/HttpMessageEncoders.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http/HttpMessageEncoders.java index 03ed61600a..8358bace7b 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http/HttpMessageEncoders.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http/HttpMessageEncoders.java @@ -21,14 +21,14 @@ import com.linkedin.r2.message.stream.StreamRequest; import com.linkedin.r2.netty.common.NettyRequestAdapter; import com.linkedin.r2.netty.entitystream.StreamReader; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageEncoder; -import io.netty.handler.codec.http.DefaultHttpContent; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.HttpRequest; -import io.netty.handler.codec.http.LastHttpContent; +import com.linkedin.pegasus.io.netty.buffer.Unpooled; +import com.linkedin.pegasus.io.netty.channel.ChannelHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.handler.codec.MessageToMessageEncoder; +import com.linkedin.pegasus.io.netty.handler.codec.http.DefaultHttpContent; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpContent; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpRequest; +import com.linkedin.pegasus.io.netty.handler.codec.http.LastHttpContent; import java.util.List; /** diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2AlpnHandler.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2AlpnHandler.java index ebd157a12a..f6783c5547 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2AlpnHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2AlpnHandler.java @@ -16,20 +16,20 @@ package com.linkedin.r2.netty.handler.http2; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPromise; -import io.netty.handler.codec.http2.Http2FrameCodecBuilder; -import io.netty.handler.codec.http2.Http2MultiplexHandler; -import io.netty.handler.codec.http2.Http2Settings; -import io.netty.handler.ssl.ApplicationProtocolNames; -import io.netty.handler.ssl.ApplicationProtocolNegotiationHandler; -import io.netty.handler.ssl.SslHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2FrameCodecBuilder; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2MultiplexHandler; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Settings; +import com.linkedin.pegasus.io.netty.handler.ssl.ApplicationProtocolNames; +import com.linkedin.pegasus.io.netty.handler.ssl.ApplicationProtocolNegotiationHandler; +import com.linkedin.pegasus.io.netty.handler.ssl.SslHandler; import java.nio.channels.ClosedChannelException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Netty handler to configure a {@link io.netty.channel.ChannelPipeline} upon successful ALPN + * Netty handler to configure a {@link com.linkedin.pegasus.io.netty.channel.ChannelPipeline} upon successful ALPN * to H2 by {@link SslHandler}. If the ALPN is not resulted in H2 - the ALPN promise is marked is failed and * that will notify the ALPN promise listener present in channel lifecycle. * diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2MessageDecoders.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2MessageDecoders.java index a10c56dcac..1fa6db0298 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2MessageDecoders.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2MessageDecoders.java @@ -20,15 +20,15 @@ import com.linkedin.r2.message.stream.StreamResponseBuilder; import com.linkedin.r2.netty.entitystream.StreamWriter; import com.linkedin.r2.transport.http.common.HttpConstants; -import io.netty.buffer.ByteBufInputStream; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandler.Sharable; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageDecoder; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http2.Http2DataFrame; -import io.netty.handler.codec.http2.Http2Headers; -import io.netty.handler.codec.http2.Http2HeadersFrame; +import com.linkedin.pegasus.io.netty.buffer.ByteBufInputStream; +import com.linkedin.pegasus.io.netty.channel.ChannelHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandler.Sharable; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.handler.codec.MessageToMessageDecoder; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpHeaderNames; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2DataFrame; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Headers; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2HeadersFrame; import java.util.List; import java.util.Map; diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2MessageEncoders.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2MessageEncoders.java index 977b292f1c..6f6fb1a03a 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2MessageEncoders.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2MessageEncoders.java @@ -22,15 +22,15 @@ import com.linkedin.r2.netty.common.NettyRequestAdapter; import com.linkedin.r2.netty.entitystream.StreamReader; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageEncoder; -import io.netty.handler.codec.http2.DefaultHttp2DataFrame; -import io.netty.handler.codec.http2.DefaultHttp2HeadersFrame; -import io.netty.handler.codec.http2.Http2DataFrame; -import io.netty.handler.codec.http2.Http2HeadersFrame; +import com.linkedin.pegasus.io.netty.buffer.ByteBuf; +import com.linkedin.pegasus.io.netty.buffer.Unpooled; +import com.linkedin.pegasus.io.netty.channel.ChannelHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.handler.codec.MessageToMessageEncoder; +import com.linkedin.pegasus.io.netty.handler.codec.http2.DefaultHttp2DataFrame; +import com.linkedin.pegasus.io.netty.handler.codec.http2.DefaultHttp2HeadersFrame; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2DataFrame; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2HeadersFrame; import java.util.List; /** diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2ProtocolUpgradeHandler.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2ProtocolUpgradeHandler.java index 2d78497590..f91fd4b146 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2ProtocolUpgradeHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/Http2ProtocolUpgradeHandler.java @@ -16,15 +16,15 @@ package com.linkedin.r2.netty.handler.http2; -import io.netty.channel.ChannelDuplexHandler; -import io.netty.channel.ChannelException; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPromise; -import io.netty.handler.codec.http.DefaultFullHttpRequest; -import io.netty.handler.codec.http.HttpClientUpgradeHandler; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpMethod; -import io.netty.handler.codec.http.HttpVersion; +import com.linkedin.pegasus.io.netty.channel.ChannelDuplexHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelException; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.handler.codec.http.DefaultFullHttpRequest; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpClientUpgradeHandler; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpHeaderNames; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpMethod; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpVersion; import java.net.InetSocketAddress; import java.nio.channels.ClosedChannelException; import org.slf4j.Logger; diff --git a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/UnsupportedHandler.java b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/UnsupportedHandler.java index b64e3e192c..48d5c9b854 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/UnsupportedHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/netty/handler/http2/UnsupportedHandler.java @@ -16,9 +16,9 @@ package com.linkedin.r2.netty.handler.http2; -import io.netty.channel.ChannelHandler.Sharable; -import io.netty.channel.ChannelHandlerAdapter; -import io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelHandler.Sharable; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerAdapter; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/HttpClientFactory.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/HttpClientFactory.java index 649cf2546f..de9ca43686 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/HttpClientFactory.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/HttpClientFactory.java @@ -57,8 +57,8 @@ import com.linkedin.r2.util.ConfigValueExtractor; import com.linkedin.r2.util.NamedThreadFactory; import com.linkedin.util.clock.SystemClock; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.nio.NioEventLoopGroup; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -80,7 +80,7 @@ * A factory for HttpNettyClient instances. * * All clients created by the factory will share the same resources, in particular the - * {@link io.netty.channel.EventLoopGroup} and {@link ScheduledExecutorService}. + * {@link com.linkedin.pegasus.io.netty.channel.EventLoopGroup} and {@link ScheduledExecutorService}. * * In order to shutdown cleanly, all clients issued by the factory should be shutdown via * {@link TransportClient#shutdown(com.linkedin.common.callback.Callback)} and the factory diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/AbstractNettyClient.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/AbstractNettyClient.java index 4db1b81ee9..a16e1ba8c0 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/AbstractNettyClient.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/AbstractNettyClient.java @@ -43,8 +43,8 @@ import com.linkedin.r2.transport.http.client.PoolStats; import com.linkedin.r2.transport.http.client.TimeoutTransportCallback; import com.linkedin.r2.transport.http.common.HttpBridge; -import io.netty.channel.group.DefaultChannelGroup; -import io.netty.util.concurrent.GlobalEventExecutor; +import com.linkedin.pegasus.io.netty.channel.group.DefaultChannelGroup; +import com.linkedin.pegasus.io.netty.util.concurrent.GlobalEventExecutor; import java.net.SocketAddress; import java.net.UnknownHostException; import java.util.Map; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolFactory.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolFactory.java index 64c85b9623..fae60d29a7 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolFactory.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolFactory.java @@ -22,7 +22,7 @@ import com.linkedin.r2.transport.http.client.AsyncPool; -import io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.Channel; import java.net.SocketAddress; /** diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolLifecycle.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolLifecycle.java index 36ea312a4f..4b9eecbc87 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolLifecycle.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolLifecycle.java @@ -29,16 +29,16 @@ import com.linkedin.r2.transport.http.client.stream.http.HttpNettyStreamClient; import com.linkedin.util.clock.Clock; import com.linkedin.util.clock.SystemClock; -import io.netty.bootstrap.Bootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelDuplexHandler; -import io.netty.channel.ChannelFutureListener; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelOption; -import io.netty.channel.group.ChannelGroup; -import io.netty.handler.ssl.SslHandshakeCompletionEvent; -import io.netty.util.AttributeKey; -import io.netty.util.concurrent.Future; +import com.linkedin.pegasus.io.netty.bootstrap.Bootstrap; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelDuplexHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelFutureListener; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelOption; +import com.linkedin.pegasus.io.netty.channel.group.ChannelGroup; +import com.linkedin.pegasus.io.netty.handler.ssl.SslHandshakeCompletionEvent; +import com.linkedin.pegasus.io.netty.util.AttributeKey; +import com.linkedin.pegasus.io.netty.util.concurrent.Future; import java.net.ConnectException; import java.net.SocketAddress; import org.slf4j.Logger; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManager.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManager.java index 84d6e9ea55..bfb5b64e3a 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManager.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManager.java @@ -22,8 +22,8 @@ import com.linkedin.r2.transport.http.client.AsyncPoolStats; import com.linkedin.r2.transport.http.client.PoolStats; import com.linkedin.r2.transport.http.client.PoolStatsProvider; -import io.netty.channel.Channel; -import io.netty.channel.group.ChannelGroup; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.group.ChannelGroup; import java.net.SocketAddress; import java.util.Collection; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManagerFactoryImpl.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManagerFactoryImpl.java index 5d14dbd3d6..601ec107d2 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManagerFactoryImpl.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManagerFactoryImpl.java @@ -23,8 +23,8 @@ import com.linkedin.r2.transport.http.client.rest.HttpNettyChannelPoolFactory; import com.linkedin.r2.transport.http.client.stream.http.HttpNettyStreamChannelPoolFactory; import com.linkedin.r2.transport.http.client.stream.http2.Http2NettyStreamChannelPoolFactory; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.group.DefaultChannelGroup; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.group.DefaultChannelGroup; import java.util.concurrent.ScheduledExecutorService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManagerImpl.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManagerImpl.java index f018055605..109ac53e8a 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManagerImpl.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManagerImpl.java @@ -24,9 +24,9 @@ import com.linkedin.r2.transport.http.client.PoolStats; import com.linkedin.r2.transport.http.client.TimeoutCallback; import com.linkedin.r2.util.TimeoutRunnable; -import io.netty.channel.Channel; -import io.netty.channel.group.ChannelGroup; -import io.netty.channel.group.ChannelGroupFutureListener; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.group.ChannelGroup; +import com.linkedin.pegasus.io.netty.channel.group.ChannelGroupFutureListener; import java.net.SocketAddress; import java.util.ArrayList; import java.util.Collection; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManagerKeyBuilder.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManagerKeyBuilder.java index 62167d435f..f8a546a76c 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManagerKeyBuilder.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ChannelPoolManagerKeyBuilder.java @@ -18,7 +18,7 @@ import com.linkedin.r2.transport.http.client.AsyncPoolImpl; import com.linkedin.r2.transport.http.client.HttpClientFactory; -import io.netty.util.internal.ObjectUtil; +import com.linkedin.pegasus.io.netty.util.internal.ObjectUtil; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLParameters; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ConnectionSharingChannelPoolManagerFactory.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ConnectionSharingChannelPoolManagerFactory.java index b298f04ef8..77767f0315 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ConnectionSharingChannelPoolManagerFactory.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ConnectionSharingChannelPoolManagerFactory.java @@ -28,8 +28,8 @@ import com.linkedin.r2.transport.http.client.AsyncPool; import com.linkedin.r2.transport.http.client.PoolStats; -import io.netty.channel.Channel; -import io.netty.channel.group.ChannelGroup; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.group.ChannelGroup; /** * {@link ChannelPoolManagerFactory} class that re-uses already created {@link ChannelPoolManager} instances diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ErrorChannelFutureListener.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ErrorChannelFutureListener.java index 9b9404d9eb..ad03f71946 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ErrorChannelFutureListener.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/ErrorChannelFutureListener.java @@ -1,10 +1,10 @@ package com.linkedin.r2.transport.http.client.common; -import io.netty.channel.Channel; -import io.netty.channel.ChannelException; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelFutureListener; -import io.netty.channel.ChannelPipeline; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelException; +import com.linkedin.pegasus.io.netty.channel.ChannelFuture; +import com.linkedin.pegasus.io.netty.channel.ChannelFutureListener; +import com.linkedin.pegasus.io.netty.channel.ChannelPipeline; /** diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/EventAwareChannelPoolManagerFactory.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/EventAwareChannelPoolManagerFactory.java index febf3892dc..e319dec92d 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/EventAwareChannelPoolManagerFactory.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/common/EventAwareChannelPoolManagerFactory.java @@ -7,8 +7,8 @@ import com.linkedin.r2.transport.http.client.AsyncPool; import com.linkedin.r2.transport.http.client.PoolStats; import com.linkedin.r2.transport.http.common.HttpProtocolVersion; -import io.netty.channel.Channel; -import io.netty.channel.group.ChannelGroup; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.group.ChannelGroup; import java.net.SocketAddress; import java.util.Collection; import java.util.Map; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/ChannelPoolHandler.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/ChannelPoolHandler.java index f729467a0c..9d9c4fff68 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/ChannelPoolHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/ChannelPoolHandler.java @@ -23,11 +23,11 @@ import com.linkedin.r2.message.rest.RestResponse; import com.linkedin.r2.transport.http.client.AsyncPool; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.util.AttributeKey; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelInboundHandlerAdapter; +import com.linkedin.pegasus.io.netty.util.AttributeKey; import java.util.List; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/HttpNettyChannelPoolFactory.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/HttpNettyChannelPoolFactory.java index f48ded3193..f8b5e14462 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/HttpNettyChannelPoolFactory.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/HttpNettyChannelPoolFactory.java @@ -25,15 +25,15 @@ import com.linkedin.r2.transport.http.client.common.ChannelPoolFactory; import com.linkedin.r2.transport.http.client.common.ChannelPoolLifecycle; import com.linkedin.util.clock.SystemClock; -import io.netty.bootstrap.Bootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelOption; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.group.ChannelGroup; -import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.codec.http.HttpClientCodec; -import io.netty.handler.codec.http.HttpObjectAggregator; +import com.linkedin.pegasus.io.netty.bootstrap.Bootstrap; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelInitializer; +import com.linkedin.pegasus.io.netty.channel.ChannelOption; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.group.ChannelGroup; +import com.linkedin.pegasus.io.netty.channel.socket.nio.NioSocketChannel; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpClientCodec; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpObjectAggregator; import java.net.SocketAddress; import java.util.concurrent.ScheduledExecutorService; import javax.net.ssl.SSLContext; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/HttpNettyClient.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/HttpNettyClient.java index 7edb0b2277..25b0c65235 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/HttpNettyClient.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/HttpNettyClient.java @@ -39,9 +39,9 @@ import com.linkedin.r2.transport.http.client.common.ssl.SslSessionValidator; import com.linkedin.r2.transport.http.common.HttpProtocolVersion; import com.linkedin.r2.util.Cancellable; -import io.netty.channel.Channel; -import io.netty.channel.EventLoopGroup; -import io.netty.util.concurrent.DefaultEventExecutorGroup; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.util.concurrent.DefaultEventExecutorGroup; import java.net.SocketAddress; import java.util.Map; import java.util.concurrent.ExecutorService; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/RAPClientCodec.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/RAPClientCodec.java index 4c9e44b849..c5ec0f7507 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/RAPClientCodec.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/RAPClientCodec.java @@ -25,20 +25,20 @@ import com.linkedin.r2.message.rest.RestResponseBuilder; import com.linkedin.r2.netty.common.NettyRequestAdapter; import com.linkedin.r2.transport.http.common.HttpConstants; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelDuplexHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPromise; -import io.netty.handler.codec.MessageToMessageDecoder; -import io.netty.handler.codec.MessageToMessageEncoder; -import io.netty.handler.codec.http.DefaultFullHttpRequest; -import io.netty.handler.codec.http.FullHttpRequest; -import io.netty.handler.codec.http.FullHttpResponse; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpMethod; -import io.netty.handler.codec.http.HttpVersion; +import com.linkedin.pegasus.io.netty.buffer.ByteBuf; +import com.linkedin.pegasus.io.netty.buffer.ByteBufInputStream; +import com.linkedin.pegasus.io.netty.buffer.Unpooled; +import com.linkedin.pegasus.io.netty.channel.ChannelDuplexHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.handler.codec.MessageToMessageDecoder; +import com.linkedin.pegasus.io.netty.handler.codec.MessageToMessageEncoder; +import com.linkedin.pegasus.io.netty.handler.codec.http.DefaultFullHttpRequest; +import com.linkedin.pegasus.io.netty.handler.codec.http.FullHttpRequest; +import com.linkedin.pegasus.io.netty.handler.codec.http.FullHttpResponse; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpHeaderNames; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpMethod; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpVersion; import java.net.URL; import java.util.List; import java.util.Map; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/RAPResponseHandler.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/RAPResponseHandler.java index c466b18d64..3a04eeaef6 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/RAPResponseHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/rest/RAPResponseHandler.java @@ -25,11 +25,11 @@ import com.linkedin.r2.transport.common.WireAttributeHelper; import com.linkedin.r2.transport.common.bridge.common.TransportCallback; import com.linkedin.r2.transport.common.bridge.common.TransportResponseImpl; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.SimpleChannelInboundHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.SimpleChannelInboundHandler; -import io.netty.util.AttributeKey; +import com.linkedin.pegasus.io.netty.util.AttributeKey; import java.nio.channels.ClosedChannelException; import java.util.Collections; import java.util.Map; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/AbstractNettyStreamClient.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/AbstractNettyStreamClient.java index d44b7dd369..36b53abc82 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/AbstractNettyStreamClient.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/AbstractNettyStreamClient.java @@ -35,8 +35,8 @@ import com.linkedin.r2.transport.http.client.common.ChannelPoolFactory; import com.linkedin.r2.transport.http.client.common.ChannelPoolManager; -import io.netty.channel.EventLoopGroup; -import io.netty.util.concurrent.DefaultEventExecutorGroup; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.util.concurrent.DefaultEventExecutorGroup; import java.net.SocketAddress; import java.util.Map; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/OrderedEntityStreamReader.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/OrderedEntityStreamReader.java index 0c3a5c53f0..d93e9a9fa0 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/OrderedEntityStreamReader.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/OrderedEntityStreamReader.java @@ -19,12 +19,13 @@ import com.linkedin.data.ByteString; import com.linkedin.r2.message.stream.entitystream.ReadHandle; import com.linkedin.r2.message.stream.entitystream.Reader; -import io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; /** * A Reader wrapper which ensures the reader callbacks are executed in the order they called by the writer - * wrapped reader callbacks are queued to be invoked by the dedicated single threaded {@link io.netty.channel.EventLoop} + * wrapped reader callbacks are queued to be invoked by the dedicated single threaded + * {@link com.linkedin.pegasus.io.netty.channel.EventLoop} * * @author Nizar Mankulangara */ @@ -37,7 +38,8 @@ public class OrderedEntityStreamReader implements Reader /** * Construct a new instance. * - * @param ctx the {@link ChannelHandlerContext} to retrieve the right {@link io.netty.channel.EventLoop} Executor + * @param ctx the {@link ChannelHandlerContext} to retrieve the right + * {@link com.linkedin.pegasus.io.netty.channel.EventLoop} Executor * @param reader the underlying {@link Reader} whose callbacks execution needs to be ordered */ public OrderedEntityStreamReader(ChannelHandlerContext ctx, Reader reader) diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/ChannelPoolStreamHandler.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/ChannelPoolStreamHandler.java index 4c195c27bf..dd2e17e979 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/ChannelPoolStreamHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/ChannelPoolStreamHandler.java @@ -22,11 +22,11 @@ import com.linkedin.r2.transport.http.client.AsyncPool; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.util.AttributeKey; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelInboundHandlerAdapter; +import com.linkedin.pegasus.io.netty.util.AttributeKey; /** diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/HttpNettyStreamChannelPoolFactory.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/HttpNettyStreamChannelPoolFactory.java index f26b5d6386..ffc9027dfa 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/HttpNettyStreamChannelPoolFactory.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/HttpNettyStreamChannelPoolFactory.java @@ -24,13 +24,13 @@ import com.linkedin.r2.transport.http.client.ExponentialBackOffRateLimiter; import com.linkedin.r2.transport.http.client.stream.http2.Http2NettyStreamClient; import com.linkedin.util.clock.SystemClock; -import io.netty.bootstrap.Bootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelOption; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.group.ChannelGroup; -import io.netty.channel.socket.nio.NioSocketChannel; +import com.linkedin.pegasus.io.netty.bootstrap.Bootstrap; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelInitializer; +import com.linkedin.pegasus.io.netty.channel.ChannelOption; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.group.ChannelGroup; +import com.linkedin.pegasus.io.netty.channel.socket.nio.NioSocketChannel; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLParameters; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/HttpNettyStreamClient.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/HttpNettyStreamClient.java index 746fcff51b..e9b20b2b1a 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/HttpNettyStreamClient.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/HttpNettyStreamClient.java @@ -38,8 +38,8 @@ import com.linkedin.r2.transport.http.common.HttpProtocolVersion; import com.linkedin.r2.util.Cancellable; import com.linkedin.r2.util.Timeout; -import io.netty.channel.Channel; -import io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; import java.net.SocketAddress; import java.util.Map; import java.util.concurrent.ExecutorService; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamClientPipelineInitializer.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamClientPipelineInitializer.java index 687c33db37..9ed2e36c41 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamClientPipelineInitializer.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamClientPipelineInitializer.java @@ -17,9 +17,9 @@ package com.linkedin.r2.transport.http.client.stream.http; import com.linkedin.r2.netty.handler.common.SessionResumptionSslHandler; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.codec.http.HttpClientCodec; +import com.linkedin.pegasus.io.netty.channel.ChannelInitializer; +import com.linkedin.pegasus.io.netty.channel.socket.nio.NioSocketChannel; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpClientCodec; import java.util.Arrays; import java.util.HashSet; import java.util.Set; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamFullRequestEncoder.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamFullRequestEncoder.java index 94a041d5c4..b862b4f7a6 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamFullRequestEncoder.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamFullRequestEncoder.java @@ -18,9 +18,9 @@ import com.linkedin.r2.message.rest.RestRequest; import com.linkedin.r2.netty.common.NettyRequestAdapter; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageEncoder; -import io.netty.handler.codec.http.HttpRequest; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.handler.codec.MessageToMessageEncoder; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpRequest; import java.util.List; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamRequestEncoder.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamRequestEncoder.java index 88363abed5..2ce91a15ae 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamRequestEncoder.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamRequestEncoder.java @@ -23,16 +23,16 @@ import com.linkedin.r2.message.stream.entitystream.Reader; import com.linkedin.r2.netty.common.NettyRequestAdapter; import com.linkedin.r2.transport.http.client.stream.OrderedEntityStreamReader; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelDuplexHandler; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelFutureListener; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPromise; -import io.netty.handler.codec.http.DefaultHttpContent; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.HttpRequest; -import io.netty.handler.codec.http.LastHttpContent; +import com.linkedin.pegasus.io.netty.buffer.Unpooled; +import com.linkedin.pegasus.io.netty.channel.ChannelDuplexHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelFuture; +import com.linkedin.pegasus.io.netty.channel.ChannelFutureListener; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.handler.codec.http.DefaultHttpContent; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpContent; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpRequest; +import com.linkedin.pegasus.io.netty.handler.codec.http.LastHttpContent; /** * This encoder encodes StreamRequest to Netty's HttpRequest. diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamResponseDecoder.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamResponseDecoder.java index 846c5a3692..b58fad5418 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamResponseDecoder.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamResponseDecoder.java @@ -27,24 +27,24 @@ import com.linkedin.r2.message.stream.entitystream.Writer; import com.linkedin.r2.netty.handler.http.HttpMessageDecoders; import com.linkedin.r2.util.Timeout; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelFutureListener; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.SimpleChannelInboundHandler; -import io.netty.handler.codec.TooLongFrameException; -import io.netty.handler.codec.http.DefaultFullHttpResponse; -import io.netty.handler.codec.http.FullHttpResponse; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.HttpObject; -import io.netty.handler.codec.http.HttpResponse; -import io.netty.handler.codec.http.HttpResponseStatus; -import io.netty.handler.codec.http.HttpUtil; -import io.netty.handler.codec.http.HttpVersion; -import io.netty.handler.codec.http.LastHttpContent; -import io.netty.util.AttributeKey; +import com.linkedin.pegasus.io.netty.buffer.ByteBuf; +import com.linkedin.pegasus.io.netty.buffer.ByteBufInputStream; +import com.linkedin.pegasus.io.netty.buffer.Unpooled; +import com.linkedin.pegasus.io.netty.channel.ChannelFuture; +import com.linkedin.pegasus.io.netty.channel.ChannelFutureListener; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.SimpleChannelInboundHandler; +import com.linkedin.pegasus.io.netty.handler.codec.TooLongFrameException; +import com.linkedin.pegasus.io.netty.handler.codec.http.DefaultFullHttpResponse; +import com.linkedin.pegasus.io.netty.handler.codec.http.FullHttpResponse; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpContent; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpObject; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpResponse; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpResponseStatus; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpUtil; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpVersion; +import com.linkedin.pegasus.io.netty.handler.codec.http.LastHttpContent; +import com.linkedin.pegasus.io.netty.util.AttributeKey; import java.io.IOException; import java.io.InputStream; import java.nio.channels.ClosedChannelException; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamResponseHandler.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamResponseHandler.java index f8c6b69d7a..99b01396c1 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamResponseHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http/RAPStreamResponseHandler.java @@ -25,11 +25,11 @@ import com.linkedin.r2.transport.common.WireAttributeHelper; import com.linkedin.r2.transport.common.bridge.common.TransportCallback; import com.linkedin.r2.transport.common.bridge.common.TransportResponseImpl; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.SimpleChannelInboundHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.SimpleChannelInboundHandler; -import io.netty.util.AttributeKey; +import com.linkedin.pegasus.io.netty.util.AttributeKey; import java.nio.channels.ClosedChannelException; import java.util.Collections; import java.util.HashMap; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2AlpnHandler.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2AlpnHandler.java index f21f5dc534..76ddb10436 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2AlpnHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2AlpnHandler.java @@ -25,16 +25,16 @@ import com.linkedin.r2.transport.common.bridge.common.TransportResponseImpl; import com.linkedin.r2.transport.http.client.TimeoutAsyncPoolHandle; import com.linkedin.r2.netty.handler.common.SessionResumptionSslHandler; -import io.netty.channel.ChannelDuplexHandler; -import io.netty.channel.ChannelException; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPromise; -import io.netty.handler.ssl.ApplicationProtocolNames; -import io.netty.handler.ssl.SslContext; -import io.netty.handler.ssl.SslHandler; -import io.netty.handler.ssl.SslHandshakeCompletionEvent; -import io.netty.util.internal.ObjectUtil; +import com.linkedin.pegasus.io.netty.channel.ChannelDuplexHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelException; +import com.linkedin.pegasus.io.netty.channel.ChannelFuture; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.handler.ssl.ApplicationProtocolNames; +import com.linkedin.pegasus.io.netty.handler.ssl.SslContext; +import com.linkedin.pegasus.io.netty.handler.ssl.SslHandler; +import com.linkedin.pegasus.io.netty.handler.ssl.SslHandshakeCompletionEvent; +import com.linkedin.pegasus.io.netty.util.internal.ObjectUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2ClientPipelineInitializer.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2ClientPipelineInitializer.java index ebcc224008..fe13b555e5 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2ClientPipelineInitializer.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2ClientPipelineInitializer.java @@ -16,21 +16,21 @@ package com.linkedin.r2.transport.http.client.stream.http2; -import io.netty.channel.Channel; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.codec.http.HttpClientCodec; -import io.netty.handler.codec.http.HttpClientUpgradeHandler; -import io.netty.handler.codec.http.HttpScheme; -import io.netty.handler.codec.http2.DefaultHttp2Connection; -import io.netty.handler.codec.http2.Http2ClientUpgradeCodec; -import io.netty.handler.codec.http2.Http2Connection; -import io.netty.handler.ssl.ApplicationProtocolConfig; -import io.netty.handler.ssl.ApplicationProtocolNames; -import io.netty.handler.ssl.ClientAuth; -import io.netty.handler.ssl.IdentityCipherSuiteFilter; -import io.netty.handler.ssl.JdkSslContext; -import io.netty.util.AttributeKey; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelInitializer; +import com.linkedin.pegasus.io.netty.channel.socket.nio.NioSocketChannel; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpClientCodec; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpClientUpgradeHandler; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpScheme; +import com.linkedin.pegasus.io.netty.handler.codec.http2.DefaultHttp2Connection; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2ClientUpgradeCodec; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Connection; +import com.linkedin.pegasus.io.netty.handler.ssl.ApplicationProtocolConfig; +import com.linkedin.pegasus.io.netty.handler.ssl.ApplicationProtocolNames; +import com.linkedin.pegasus.io.netty.handler.ssl.ClientAuth; +import com.linkedin.pegasus.io.netty.handler.ssl.IdentityCipherSuiteFilter; +import com.linkedin.pegasus.io.netty.handler.ssl.JdkSslContext; +import com.linkedin.pegasus.io.netty.util.AttributeKey; import java.util.Arrays; import java.util.HashSet; import java.util.Set; @@ -41,7 +41,8 @@ /** - * Initializes Netty HTTP/2 streaming pipeline implementation of {@link io.netty.channel.ChannelInitializer} + * Initializes Netty HTTP/2 streaming pipeline implementation of + * {@link com.linkedin.pegasus.io.netty.channel.ChannelInitializer} */ class Http2ClientPipelineInitializer extends ChannelInitializer { diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2FrameListener.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2FrameListener.java index b5017cd82d..2d36b4347f 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2FrameListener.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2FrameListener.java @@ -29,19 +29,19 @@ import com.linkedin.r2.transport.common.bridge.common.ResponseWithCallback; import com.linkedin.r2.transport.common.bridge.common.TransportCallback; import com.linkedin.r2.transport.http.client.TimeoutAsyncPoolHandle; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.TooLongFrameException; -import io.netty.handler.codec.http2.Http2CodecUtil; -import io.netty.handler.codec.http2.Http2Connection; -import io.netty.handler.codec.http2.Http2Error; -import io.netty.handler.codec.http2.Http2EventAdapter; -import io.netty.handler.codec.http2.Http2Exception; -import io.netty.handler.codec.http2.Http2Headers; -import io.netty.handler.codec.http2.Http2LifecycleManager; -import io.netty.handler.codec.http2.Http2Settings; -import io.netty.handler.codec.http2.Http2Stream; +import com.linkedin.pegasus.io.netty.buffer.ByteBuf; +import com.linkedin.pegasus.io.netty.buffer.ByteBufInputStream; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.handler.codec.TooLongFrameException; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2CodecUtil; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Connection; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Error; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2EventAdapter; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Exception; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Headers; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2LifecycleManager; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Settings; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Stream; import java.io.IOException; import java.io.InputStream; import java.util.LinkedList; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2NettyStreamChannelPoolFactory.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2NettyStreamChannelPoolFactory.java index 8bb1f4f993..5227f5a1bf 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2NettyStreamChannelPoolFactory.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2NettyStreamChannelPoolFactory.java @@ -24,13 +24,13 @@ import com.linkedin.r2.transport.http.client.NoopRateLimiter; import com.linkedin.r2.transport.http.client.stream.http.HttpNettyStreamClient; import com.linkedin.util.clock.SystemClock; -import io.netty.bootstrap.Bootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelOption; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.group.ChannelGroup; -import io.netty.channel.socket.nio.NioSocketChannel; +import com.linkedin.pegasus.io.netty.bootstrap.Bootstrap; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelInitializer; +import com.linkedin.pegasus.io.netty.channel.ChannelOption; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.group.ChannelGroup; +import com.linkedin.pegasus.io.netty.channel.socket.nio.NioSocketChannel; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLParameters; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2NettyStreamClient.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2NettyStreamClient.java index 9dee53e2bf..631bd172da 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2NettyStreamClient.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2NettyStreamClient.java @@ -37,8 +37,8 @@ import com.linkedin.r2.transport.http.client.stream.AbstractNettyStreamClient; import com.linkedin.r2.transport.http.common.HttpProtocolVersion; import com.linkedin.r2.util.Cancellable; -import io.netty.channel.Channel; -import io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; import java.net.SocketAddress; import java.util.Map; import java.util.concurrent.ExecutorService; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2PipelinePropertyUtil.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2PipelinePropertyUtil.java index 16f6be8b34..11ecaec289 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2PipelinePropertyUtil.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2PipelinePropertyUtil.java @@ -18,12 +18,12 @@ import com.linkedin.r2.transport.http.client.AsyncPoolHandle; import com.linkedin.util.ArgumentUtil; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.http2.Http2Connection; -import io.netty.handler.codec.http2.Http2Exception; -import io.netty.handler.codec.http2.Http2Stream; -import io.netty.util.AttributeKey; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Connection; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Exception; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Stream; +import com.linkedin.pegasus.io.netty.util.AttributeKey; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2SchemeHandler.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2SchemeHandler.java index 4f1d3ce3e7..aa53e7167d 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2SchemeHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2SchemeHandler.java @@ -22,9 +22,9 @@ import com.linkedin.r2.message.Request; import com.linkedin.r2.transport.common.bridge.common.RequestWithCallback; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelOutboundHandlerAdapter; -import io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelOutboundHandlerAdapter; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; import java.net.URI; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2StreamCodec.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2StreamCodec.java index 705b1fb2e5..69da0d9260 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2StreamCodec.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2StreamCodec.java @@ -31,19 +31,19 @@ import com.linkedin.r2.transport.http.client.AsyncPoolHandle; import com.linkedin.r2.transport.http.client.TimeoutAsyncPoolHandle; import com.linkedin.r2.transport.http.client.stream.OrderedEntityStreamReader; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPromise; -import io.netty.handler.codec.http2.Http2ConnectionDecoder; -import io.netty.handler.codec.http2.Http2ConnectionEncoder; -import io.netty.handler.codec.http2.Http2ConnectionHandler; -import io.netty.handler.codec.http2.Http2Error; -import io.netty.handler.codec.http2.Http2Exception; -import io.netty.handler.codec.http2.Http2Headers; -import io.netty.handler.codec.http2.Http2Settings; +import com.linkedin.pegasus.io.netty.buffer.ByteBuf; +import com.linkedin.pegasus.io.netty.buffer.Unpooled; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelFuture; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2ConnectionDecoder; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2ConnectionEncoder; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2ConnectionHandler; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Error; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Exception; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Headers; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Settings; import java.util.Collections; import java.util.Optional; import org.slf4j.Logger; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2StreamCodecBuilder.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2StreamCodecBuilder.java index adb5a1fe4e..0eb245a5cb 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2StreamCodecBuilder.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2StreamCodecBuilder.java @@ -20,26 +20,26 @@ package com.linkedin.r2.transport.http.client.stream.http2; -import io.netty.handler.codec.http2.AbstractHttp2ConnectionHandlerBuilder; -import io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder; -import io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder; -import io.netty.handler.codec.http2.DefaultHttp2FrameReader; -import io.netty.handler.codec.http2.DefaultHttp2FrameWriter; -import io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder; -import io.netty.handler.codec.http2.DefaultHttp2LocalFlowController; -import io.netty.handler.codec.http2.Http2Connection; -import io.netty.handler.codec.http2.Http2ConnectionDecoder; -import io.netty.handler.codec.http2.Http2ConnectionEncoder; -import io.netty.handler.codec.http2.Http2FrameReader; -import io.netty.handler.codec.http2.Http2FrameWriter; -import io.netty.handler.codec.http2.Http2HeadersDecoder; -import io.netty.handler.codec.http2.Http2InboundFrameLogger; -import io.netty.handler.codec.http2.Http2OutboundFrameLogger; -import io.netty.handler.codec.http2.Http2Settings; -import io.netty.handler.codec.http2.StreamBufferingEncoder; -import io.netty.util.internal.ObjectUtil; - -import static io.netty.handler.codec.http2.DefaultHttp2LocalFlowController.DEFAULT_WINDOW_UPDATE_RATIO; +import com.linkedin.pegasus.io.netty.handler.codec.http2.AbstractHttp2ConnectionHandlerBuilder; +import com.linkedin.pegasus.io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder; +import com.linkedin.pegasus.io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder; +import com.linkedin.pegasus.io.netty.handler.codec.http2.DefaultHttp2FrameReader; +import com.linkedin.pegasus.io.netty.handler.codec.http2.DefaultHttp2FrameWriter; +import com.linkedin.pegasus.io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder; +import com.linkedin.pegasus.io.netty.handler.codec.http2.DefaultHttp2LocalFlowController; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Connection; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2ConnectionDecoder; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2ConnectionEncoder; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2FrameReader; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2FrameWriter; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2HeadersDecoder; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2InboundFrameLogger; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2OutboundFrameLogger; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Settings; +import com.linkedin.pegasus.io.netty.handler.codec.http2.StreamBufferingEncoder; +import com.linkedin.pegasus.io.netty.util.internal.ObjectUtil; + +import static com.linkedin.pegasus.io.netty.handler.codec.http2.DefaultHttp2LocalFlowController.DEFAULT_WINDOW_UPDATE_RATIO; class Http2StreamCodecBuilder extends AbstractHttp2ConnectionHandlerBuilder diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2StreamResponseHandler.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2StreamResponseHandler.java index 674b094f49..69720fb54b 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2StreamResponseHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2StreamResponseHandler.java @@ -26,9 +26,9 @@ import com.linkedin.r2.transport.common.bridge.common.ResponseWithCallback; import com.linkedin.r2.transport.common.bridge.common.TransportCallback; import com.linkedin.r2.transport.common.bridge.common.TransportResponseImpl; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; +import com.linkedin.pegasus.io.netty.channel.ChannelHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelInboundHandlerAdapter; import java.util.HashMap; import java.util.Map; import java.util.TreeMap; @@ -40,8 +40,8 @@ * Netty pipeline handler which takes a complete received message and invokes the user-specified callback. * * Note that an instance of this class needs to be stateless, since a single instance is used in multiple - * {@link io.netty.channel.ChannelPipeline}s simultaneously. The user specified callback is expected to be - * pass in through a {@link com.linkedin.r2.transport.common.bridge.common.ResponseWithCallback} as a + * {@link com.linkedin.pegasus.io.netty.channel.ChannelPipeline}s simultaneously. The user specified callback is + * expected to be pass in through a {@link com.linkedin.r2.transport.common.bridge.common.ResponseWithCallback} as a * {@link com.linkedin.r2.transport.http.client.TimeoutTransportCallback} * * @author Sean Sheng diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2UpgradeHandler.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2UpgradeHandler.java index 94f8ca0695..97d371094a 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2UpgradeHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/client/stream/http2/Http2UpgradeHandler.java @@ -25,11 +25,11 @@ import com.linkedin.r2.transport.common.bridge.common.TransportCallback; import com.linkedin.r2.transport.common.bridge.common.TransportResponseImpl; import com.linkedin.r2.transport.http.client.TimeoutAsyncPoolHandle; -import io.netty.channel.ChannelDuplexHandler; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPromise; -import io.netty.handler.codec.http.HttpClientUpgradeHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelDuplexHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelFuture; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpClientUpgradeHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/HttpNettyServer.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/HttpNettyServer.java index d0a1510df0..ed4bc976ac 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/HttpNettyServer.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/HttpNettyServer.java @@ -22,11 +22,11 @@ import com.linkedin.r2.filter.R2Constants; import com.linkedin.r2.util.NamedThreadFactory; -import io.netty.bootstrap.ServerBootstrap; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.channel.socket.nio.NioServerSocketChannel; -import io.netty.util.concurrent.DefaultEventExecutorGroup; -import io.netty.util.concurrent.EventExecutorGroup; +import com.linkedin.pegasus.io.netty.bootstrap.ServerBootstrap; +import com.linkedin.pegasus.io.netty.channel.nio.NioEventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.socket.nio.NioServerSocketChannel; +import com.linkedin.pegasus.io.netty.util.concurrent.DefaultEventExecutorGroup; +import com.linkedin.pegasus.io.netty.util.concurrent.EventExecutorGroup; import java.net.InetSocketAddress; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLParameters; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/HttpNettyServerPipelineInitializer.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/HttpNettyServerPipelineInitializer.java index 8bcfad886c..3befe07551 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/HttpNettyServerPipelineInitializer.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/HttpNettyServerPipelineInitializer.java @@ -18,14 +18,14 @@ import com.linkedin.r2.message.rest.RestRequest; import com.linkedin.r2.netty.common.SslHandlerUtil; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.SimpleChannelInboundHandler; -import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.codec.http.HttpObjectAggregator; -import io.netty.handler.codec.http.HttpRequestDecoder; -import io.netty.handler.codec.http.HttpResponseEncoder; -import io.netty.handler.ssl.SslHandler; -import io.netty.util.concurrent.EventExecutorGroup; +import com.linkedin.pegasus.io.netty.channel.ChannelInitializer; +import com.linkedin.pegasus.io.netty.channel.SimpleChannelInboundHandler; +import com.linkedin.pegasus.io.netty.channel.socket.nio.NioSocketChannel; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpObjectAggregator; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpRequestDecoder; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpResponseEncoder; +import com.linkedin.pegasus.io.netty.handler.ssl.SslHandler; +import com.linkedin.pegasus.io.netty.util.concurrent.EventExecutorGroup; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLParameters; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/PipelineRestHandler.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/PipelineRestHandler.java index e0fbea3930..ef4a973d1a 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/PipelineRestHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/PipelineRestHandler.java @@ -24,9 +24,9 @@ import com.linkedin.r2.transport.common.bridge.common.TransportCallback; import com.linkedin.r2.transport.common.bridge.common.TransportResponse; import com.linkedin.r2.transport.common.bridge.common.TransportResponseImpl; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.SimpleChannelInboundHandler; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.SimpleChannelInboundHandler; import java.util.Collections; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/PipelineStreamHandler.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/PipelineStreamHandler.java index 5160de0c35..1c6709399b 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/PipelineStreamHandler.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/PipelineStreamHandler.java @@ -27,9 +27,9 @@ import com.linkedin.r2.transport.common.bridge.common.TransportCallback; import com.linkedin.r2.transport.common.bridge.common.TransportResponse; import com.linkedin.r2.transport.common.bridge.common.TransportResponseImpl; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.SimpleChannelInboundHandler; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.SimpleChannelInboundHandler; import java.util.Collections; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/RAPServerCodec.java b/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/RAPServerCodec.java index aa03a38b73..ae840d39b6 100644 --- a/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/RAPServerCodec.java +++ b/r2-netty/src/main/java/com/linkedin/r2/transport/http/server/RAPServerCodec.java @@ -26,20 +26,20 @@ import com.linkedin.r2.message.rest.RestResponse; import com.linkedin.r2.transport.http.common.HttpConstants; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelDuplexHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPromise; -import io.netty.handler.codec.MessageToMessageDecoder; -import io.netty.handler.codec.MessageToMessageEncoder; -import io.netty.handler.codec.http.DefaultFullHttpResponse; -import io.netty.handler.codec.http.FullHttpRequest; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpResponse; -import io.netty.handler.codec.http.HttpResponseStatus; -import io.netty.handler.codec.http.HttpVersion; +import com.linkedin.pegasus.io.netty.buffer.ByteBuf; +import com.linkedin.pegasus.io.netty.buffer.ByteBufInputStream; +import com.linkedin.pegasus.io.netty.buffer.Unpooled; +import com.linkedin.pegasus.io.netty.channel.ChannelDuplexHandler; +import com.linkedin.pegasus.io.netty.channel.ChannelHandlerContext; +import com.linkedin.pegasus.io.netty.channel.ChannelPromise; +import com.linkedin.pegasus.io.netty.handler.codec.MessageToMessageDecoder; +import com.linkedin.pegasus.io.netty.handler.codec.MessageToMessageEncoder; +import com.linkedin.pegasus.io.netty.handler.codec.http.DefaultFullHttpResponse; +import com.linkedin.pegasus.io.netty.handler.codec.http.FullHttpRequest; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpHeaderNames; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpResponse; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpResponseStatus; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpVersion; import java.net.URI; import java.util.List; import java.util.Map; diff --git a/r2-netty/src/test/java/com/linkedin/r2/netty/common/TestNettyRequestAdapter.java b/r2-netty/src/test/java/com/linkedin/r2/netty/common/TestNettyRequestAdapter.java index cd67e5e289..51a2568db0 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/netty/common/TestNettyRequestAdapter.java +++ b/r2-netty/src/test/java/com/linkedin/r2/netty/common/TestNettyRequestAdapter.java @@ -25,14 +25,14 @@ import com.linkedin.r2.message.stream.entitystream.EntityStreams; import com.linkedin.r2.netty.common.NettyRequestAdapter; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpMethod; -import io.netty.handler.codec.http.HttpRequest; -import io.netty.handler.codec.http.HttpVersion; - -import io.netty.handler.codec.http2.Http2Headers; -import io.netty.handler.codec.http2.HttpConversionUtil; -import io.netty.util.AsciiString; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpHeaderNames; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpMethod; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpRequest; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpVersion; + +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Headers; +import com.linkedin.pegasus.io.netty.handler.codec.http2.HttpConversionUtil; +import com.linkedin.pegasus.io.netty.util.AsciiString; import java.net.URI; import java.nio.charset.Charset; import java.util.Collections; diff --git a/r2-netty/src/test/java/com/linkedin/r2/netty/common/TestSslHandlerUtil.java b/r2-netty/src/test/java/com/linkedin/r2/netty/common/TestSslHandlerUtil.java index 65ab6d59b1..7f965e67d6 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/netty/common/TestSslHandlerUtil.java +++ b/r2-netty/src/test/java/com/linkedin/r2/netty/common/TestSslHandlerUtil.java @@ -16,7 +16,7 @@ package com.linkedin.r2.netty.common; -import io.netty.handler.ssl.SslHandler; +import com.linkedin.pegasus.io.netty.handler.ssl.SslHandler; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLParameters; diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/HttpClientBuilder.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/HttpClientBuilder.java index 568835b27c..4e76c877e2 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/HttpClientBuilder.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/HttpClientBuilder.java @@ -23,7 +23,7 @@ import com.linkedin.r2.transport.http.client.rest.HttpNettyClient; import com.linkedin.r2.transport.http.client.stream.http.HttpNettyStreamClient; import com.linkedin.r2.transport.http.client.stream.http2.Http2NettyStreamClient; -import io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledExecutorService; import javax.net.ssl.SSLContext; diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestChannelPoolManager.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestChannelPoolManager.java index d5ddb5a4eb..80c61cdbe3 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestChannelPoolManager.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestChannelPoolManager.java @@ -26,7 +26,7 @@ import com.linkedin.r2.transport.http.client.common.ChannelPoolManager; import com.linkedin.r2.transport.http.client.common.ChannelPoolManagerImpl; import com.linkedin.r2.util.Cancellable; -import io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.Channel; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestChannelPoolManagerFactorySharingConnection.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestChannelPoolManagerFactorySharingConnection.java index 748b62137c..5a1b2b4a1c 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestChannelPoolManagerFactorySharingConnection.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestChannelPoolManagerFactorySharingConnection.java @@ -30,7 +30,7 @@ import com.linkedin.r2.transport.common.Client; import com.linkedin.r2.transport.common.bridge.client.TransportClientAdapter; -import io.netty.handler.codec.http.HttpMethod; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpMethod; import org.eclipse.jetty.server.Server; import org.testng.Assert; import org.testng.annotations.DataProvider; diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpClientFactory.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpClientFactory.java index 442cbf85a1..0cff4c472e 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpClientFactory.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpClientFactory.java @@ -33,8 +33,8 @@ import com.linkedin.r2.transport.common.bridge.client.TransportClient; import com.linkedin.r2.transport.common.bridge.client.TransportClientAdapter; import com.linkedin.r2.transport.http.common.HttpProtocolVersion; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.nio.NioEventLoopGroup; import org.eclipse.jetty.server.Server; import org.testng.Assert; import org.testng.annotations.DataProvider; diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpNettyClient.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpNettyClient.java index 675418859e..c04841a9c0 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpNettyClient.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpNettyClient.java @@ -37,11 +37,11 @@ import com.linkedin.r2.transport.http.common.HttpProtocolVersion; import com.linkedin.test.util.retry.SingleRetry; import com.linkedin.util.clock.SettableClock; -import io.netty.channel.Channel; -import io.netty.channel.ChannelException; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.handler.codec.EncoderException; -import io.netty.handler.codec.TooLongFrameException; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.ChannelException; +import com.linkedin.pegasus.io.netty.channel.nio.NioEventLoopGroup; +import com.linkedin.pegasus.io.netty.handler.codec.EncoderException; +import com.linkedin.pegasus.io.netty.handler.codec.TooLongFrameException; import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpNettyClientCommon.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpNettyClientCommon.java index d93dd20026..1714de26ac 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpNettyClientCommon.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpNettyClientCommon.java @@ -29,8 +29,8 @@ import com.linkedin.r2.transport.common.bridge.common.TransportCallback; import com.linkedin.r2.transport.http.client.common.AbstractNettyClient; import com.linkedin.test.util.DataGeneration; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.nio.NioEventLoopGroup; import java.io.IOException; import java.util.HashMap; import java.util.concurrent.ExecutionException; diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpNettyStreamClient.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpNettyStreamClient.java index 6d7b925e41..36e05d0a62 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpNettyStreamClient.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/TestHttpNettyStreamClient.java @@ -50,13 +50,13 @@ import com.linkedin.r2.transport.http.common.HttpProtocolVersion; import com.linkedin.test.util.retry.SingleRetry; import com.linkedin.test.util.retry.ThreeRetries; -import io.netty.channel.Channel; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.handler.codec.TooLongFrameException; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http2.Http2Exception; -import io.netty.util.AsciiString; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.nio.NioEventLoopGroup; +import com.linkedin.pegasus.io.netty.handler.codec.TooLongFrameException; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpHeaderNames; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Exception; +import com.linkedin.pegasus.io.netty.util.AsciiString; import org.eclipse.jetty.server.Server; import org.testng.Assert; import org.testng.annotations.AfterClass; @@ -1111,6 +1111,7 @@ public void onError(Throwable e) latch.countDown(); } })); + Thread.sleep(5); } if (!latch.await(30, TimeUnit.SECONDS)) diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/rest/TestChannelPoolHandler.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/rest/TestChannelPoolHandler.java index 184a171925..bd87bfa7c8 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/rest/TestChannelPoolHandler.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/rest/TestChannelPoolHandler.java @@ -7,8 +7,8 @@ import com.linkedin.r2.transport.http.client.AsyncPool; import com.linkedin.r2.transport.http.client.PoolStats; import com.linkedin.r2.util.Cancellable; -import io.netty.channel.Channel; -import io.netty.channel.embedded.EmbeddedChannel; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.embedded.EmbeddedChannel; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/rest/TestRAPClientCodec.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/rest/TestRAPClientCodec.java index 94bd426b35..cc27926fd1 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/rest/TestRAPClientCodec.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/rest/TestRAPClientCodec.java @@ -26,20 +26,20 @@ import com.linkedin.r2.message.rest.RestResponse; import com.linkedin.r2.transport.http.common.HttpConstants; import com.linkedin.r2.transport.http.util.CookieUtil; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.DefaultFullHttpResponse; -import io.netty.handler.codec.http.DefaultHttpHeaders; -import io.netty.handler.codec.http.FullHttpRequest; -import io.netty.handler.codec.http.FullHttpResponse; -import io.netty.handler.codec.http.HttpClientCodec; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpHeaders; -import io.netty.handler.codec.http.HttpMethod; -import io.netty.handler.codec.http.HttpObjectAggregator; -import io.netty.handler.codec.http.HttpResponseStatus; -import io.netty.handler.codec.http.HttpVersion; +import com.linkedin.pegasus.io.netty.buffer.ByteBuf; +import com.linkedin.pegasus.io.netty.buffer.Unpooled; +import com.linkedin.pegasus.io.netty.channel.embedded.EmbeddedChannel; +import com.linkedin.pegasus.io.netty.handler.codec.http.DefaultFullHttpResponse; +import com.linkedin.pegasus.io.netty.handler.codec.http.DefaultHttpHeaders; +import com.linkedin.pegasus.io.netty.handler.codec.http.FullHttpRequest; +import com.linkedin.pegasus.io.netty.handler.codec.http.FullHttpResponse; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpClientCodec; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpHeaderNames; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpHeaders; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpMethod; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpObjectAggregator; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpResponseStatus; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpVersion; import java.net.URI; import java.nio.charset.Charset; import java.util.List; diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http/TestChannelPoolStreamHandler.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http/TestChannelPoolStreamHandler.java index 64a1e33a54..8b1fa9c6fc 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http/TestChannelPoolStreamHandler.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http/TestChannelPoolStreamHandler.java @@ -8,14 +8,14 @@ import com.linkedin.r2.transport.http.client.PoolStats; import com.linkedin.r2.util.Cancellable; import com.linkedin.r2.util.Timeout; -import io.netty.channel.Channel; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.DefaultHttpResponse; -import io.netty.handler.codec.http.DefaultLastHttpContent; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.HttpResponse; -import io.netty.handler.codec.http.HttpResponseStatus; -import io.netty.handler.codec.http.HttpVersion; +import com.linkedin.pegasus.io.netty.channel.Channel; +import com.linkedin.pegasus.io.netty.channel.embedded.EmbeddedChannel; +import com.linkedin.pegasus.io.netty.handler.codec.http.DefaultHttpResponse; +import com.linkedin.pegasus.io.netty.handler.codec.http.DefaultLastHttpContent; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpContent; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpResponse; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpResponseStatus; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpVersion; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestEarlyUpgrade.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestEarlyUpgrade.java index 7219225b29..e8ee779316 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestEarlyUpgrade.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestEarlyUpgrade.java @@ -25,8 +25,8 @@ import com.linkedin.r2.transport.http.client.common.ChannelPoolManagerKey; import com.linkedin.r2.transport.http.client.common.ChannelPoolManagerKeyBuilder; import com.linkedin.test.util.AssertionMethods; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.nio.NioEventLoopGroup; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketAddress; diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestHttp2AlpnHandler.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestHttp2AlpnHandler.java index 20032da78c..1301f53ff8 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestHttp2AlpnHandler.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestHttp2AlpnHandler.java @@ -20,8 +20,8 @@ import com.linkedin.r2.transport.common.bridge.common.TransportResponse; import com.linkedin.r2.transport.http.client.TimeoutAsyncPoolHandle; import com.linkedin.r2.transport.http.client.TimeoutTransportCallback; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.ssl.SslContext; +import com.linkedin.pegasus.io.netty.channel.embedded.EmbeddedChannel; +import com.linkedin.pegasus.io.netty.handler.ssl.SslContext; import org.mockito.Mockito; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestHttp2NettyStreamClient.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestHttp2NettyStreamClient.java index 1a53dd1dfd..8c30aa0397 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestHttp2NettyStreamClient.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestHttp2NettyStreamClient.java @@ -35,11 +35,11 @@ import com.linkedin.r2.testutils.server.HttpServerBuilder; import com.linkedin.test.util.ExceptionTestUtil; import com.linkedin.test.util.retry.SingleRetry; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http2.Http2Exception; -import io.netty.util.AsciiString; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.nio.NioEventLoopGroup; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpHeaderNames; +import com.linkedin.pegasus.io.netty.handler.codec.http2.Http2Exception; +import com.linkedin.pegasus.io.netty.util.AsciiString; import java.io.IOException; import java.net.URI; import java.util.HashMap; diff --git a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestHttp2ProtocolUpgradeHandler.java b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestHttp2ProtocolUpgradeHandler.java index 9789c421db..139c65ca36 100644 --- a/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestHttp2ProtocolUpgradeHandler.java +++ b/r2-netty/src/test/java/com/linkedin/r2/transport/http/client/stream/http2/TestHttp2ProtocolUpgradeHandler.java @@ -20,10 +20,10 @@ import com.linkedin.r2.transport.common.bridge.common.TransportResponse; import com.linkedin.r2.transport.http.client.TimeoutAsyncPoolHandle; import com.linkedin.r2.transport.http.client.TimeoutTransportCallback; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.DefaultFullHttpRequest; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpMethod; +import com.linkedin.pegasus.io.netty.channel.embedded.EmbeddedChannel; +import com.linkedin.pegasus.io.netty.handler.codec.http.DefaultFullHttpRequest; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpHeaderNames; +import com.linkedin.pegasus.io.netty.handler.codec.http.HttpMethod; import org.mockito.Mockito; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/r2-perf-test/build.gradle b/r2-perf-test/build.gradle index ccad7de6bd..4e71298c76 100644 --- a/r2-perf-test/build.gradle +++ b/r2-perf-test/build.gradle @@ -6,6 +6,7 @@ dependencies { compile project (':r2-sample') compile project (':pegasus-common') compile project (':test-util') + implementation project(path: ':restli-netty', configuration: 'shadow') testRuntime externalDependency.disruptor } diff --git a/r2-perf-test/src/test/java/test/r2/perf/client/PerfClients.java b/r2-perf-test/src/test/java/test/r2/perf/client/PerfClients.java index d7b2c18cc1..1bec1a87b9 100644 --- a/r2-perf-test/src/test/java/test/r2/perf/client/PerfClients.java +++ b/r2-perf-test/src/test/java/test/r2/perf/client/PerfClients.java @@ -34,7 +34,7 @@ import java.util.concurrent.Executors; import com.linkedin.r2.util.NamedThreadFactory; -import io.netty.channel.nio.NioEventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.nio.NioEventLoopGroup; import test.r2.perf.Generator; import test.r2.perf.PerfConfig; diff --git a/r2-sample/build.gradle b/r2-sample/build.gradle index cbc9b9cdbb..2ecbbb9488 100644 --- a/r2-sample/build.gradle +++ b/r2-sample/build.gradle @@ -4,6 +4,6 @@ dependencies { compile project(':pegasus-common') compile project(':data') compile project(':r2-jetty') - compile externalDependency.netty + implementation project(path: ':restli-netty', configuration: 'shadow') compile externalDependency.servletApi } \ No newline at end of file diff --git a/r2-sample/src/main/java/com/linkedin/r2/sample/Bootstrap.java b/r2-sample/src/main/java/com/linkedin/r2/sample/Bootstrap.java index a626ffd59b..89931c04ca 100644 --- a/r2-sample/src/main/java/com/linkedin/r2/sample/Bootstrap.java +++ b/r2-sample/src/main/java/com/linkedin/r2/sample/Bootstrap.java @@ -32,7 +32,7 @@ import com.linkedin.r2.transport.http.common.HttpProtocolVersion; import com.linkedin.r2.transport.http.server.HttpServerFactory; import com.linkedin.r2.util.NamedThreadFactory; -import io.netty.channel.EventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.EventLoopGroup; import java.net.URI; import java.util.HashMap; import java.util.Map; diff --git a/restli-int-test/build.gradle b/restli-int-test/build.gradle index fe88f7fb90..b43e2ce84a 100644 --- a/restli-int-test/build.gradle +++ b/restli-int-test/build.gradle @@ -6,6 +6,7 @@ dependencies { compile project(':data') compile project(':pegasus-common') compile project(':r2-core') + implementation project(path: ':restli-netty', configuration: 'shadow') compile project(':data-transform') compile project(':restli-client') compile project(':restli-server') diff --git a/restli-int-test/src/test/java/com/linkedin/restli/examples/TestRequestCompression.java b/restli-int-test/src/test/java/com/linkedin/restli/examples/TestRequestCompression.java index 318338a0ea..033e2bbc5b 100644 --- a/restli-int-test/src/test/java/com/linkedin/restli/examples/TestRequestCompression.java +++ b/restli-int-test/src/test/java/com/linkedin/restli/examples/TestRequestCompression.java @@ -66,7 +66,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import io.netty.channel.nio.NioEventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.nio.NioEventLoopGroup; /** * Integration tests for request compression. diff --git a/restli-int-test/src/test/java/com/linkedin/restli/examples/TestResponseCompression.java b/restli-int-test/src/test/java/com/linkedin/restli/examples/TestResponseCompression.java index 71f82682f3..0e00d24c02 100644 --- a/restli-int-test/src/test/java/com/linkedin/restli/examples/TestResponseCompression.java +++ b/restli-int-test/src/test/java/com/linkedin/restli/examples/TestResponseCompression.java @@ -61,7 +61,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import io.netty.channel.nio.NioEventLoopGroup; +import com.linkedin.pegasus.io.netty.channel.nio.NioEventLoopGroup; /** * Integration tests for response compression. diff --git a/restli-netty/build.gradle b/restli-netty/build.gradle new file mode 100644 index 0000000000..a7cdeed3bd --- /dev/null +++ b/restli-netty/build.gradle @@ -0,0 +1,33 @@ +apply plugin: 'com.github.johnrengelman.shadow' + +dependencies { + implementation externalDependency.netty + shadow externalDependency.slf4jApi +} + +tasks.named('shadowJar') { + archiveClassifier.set('') + + dependencies { + exclude dependency(externalDependency.slf4jApi) + } + + exclude 'META-INF/io.netty.versions.properties' + exclude 'META-INF/maven/' + exclude 'META-INF/native-image/' + + relocate 'io.netty', 'com.linkedin.pegasus.io.netty' + relocate 'META-INF/native/libnetty', 'META-INF/native/libcom_linkedin_pegasus_netty' + + mergeServiceFiles() +} + +tasks.named('jar') { + enabled = false + + // Workaround for IDEA-163411. + // Even when disabled, IntelliJ interprets the regular jar task as producing the unclassified jar. Although the build + // works with Gradle, IntelliJ will incorrectly fail to find the shaded classes and show spurious errors in the IDE. + // Giving this a specific classifier prevents IntelliJ's confusion. + archiveClassifier.set('slim') +} diff --git a/settings.gradle b/settings.gradle index 312912382b..97986cb663 100644 --- a/settings.gradle +++ b/settings.gradle @@ -37,6 +37,7 @@ include 'restli-client-parseq' include 'restli-client-util-recorder' include 'restli-disruptor' include 'restli-docgen' +include 'restli-netty' include 'restli-server' include 'restli-server-extras' include 'restli-common'