avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [avro] branch master updated: [AVRO-2106] Split netty/jetty out of avro-ipc
Date Thu, 07 Feb 2019 20:47:15 GMT
This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new ac95feb  [AVRO-2106] Split netty/jetty out of avro-ipc
ac95feb is described below

commit ac95febf82b15ffa564cac1d92475cdf6efed9f6
Author: Daniel Kulp <dkulp@apache.org>
AuthorDate: Thu Feb 7 14:11:39 2019 -0500

    [AVRO-2106] Split netty/jetty out of avro-ipc
---
 .../avro-service-archetype/src/main/pom/pom.xml    |   5 ++
 .../java/transport/SimpleOrderServiceClient.java   |   2 +-
 .../java/transport/SimpleOrderServiceEndpoint.java |   2 +-
 lang/java/compiler/pom.xml                         |  14 +---
 lang/java/{ipc => ipc-jetty}/pom.xml               |  87 +++++----------------
 .../org/apache/avro/ipc/jetty}/HttpServer.java     |  12 ++-
 .../org/apache/avro/ipc/jetty}/StaticServlet.java  |   4 +-
 .../org/apache/avro/ipc/jetty}/StatsServer.java    |   4 +-
 .../avro/ipc/jetty}/StatsPluginOverhead.java       |   4 +-
 .../org/apache/avro/ipc/jetty}/TestBulkData.java   |   3 +-
 .../apache/avro/ipc/jetty}/TestProtocolHttp.java   |   6 +-
 .../apache/avro/ipc/jetty}/TestProtocolHttps.java  |   4 +-
 .../avro/ipc/jetty}/TestStatsPluginAndServlet.java |   7 +-
 lang/java/ipc-jetty/src/test/keystore              | Bin 0 -> 1366 bytes
 .../resources/org/apache/avro/ipc/servercert.p12   | Bin 0 -> 1686 bytes
 lang/java/ipc-jetty/src/test/truststore            | Bin 0 -> 660 bytes
 lang/java/{ipc => ipc-netty}/pom.xml               |  85 +++++---------------
 .../org/apache/avro/ipc/netty}/NettyServer.java    |  10 ++-
 .../apache/avro/ipc/netty}/NettyTransceiver.java   |  11 ++-
 .../avro/ipc/netty}/NettyTransportCodec.java       |   2 +-
 .../netty}/NettyTransceiverWhenFailsToConnect.java |   2 +-
 .../apache/avro/ipc/netty}/TestNettyServer.java    |   8 +-
 .../netty}/TestNettyServerConcurrentExecution.java |   6 +-
 .../ipc/netty}/TestNettyServerWithCallbacks.java   |   7 +-
 .../ipc/netty}/TestNettyServerWithCompression.java |   5 +-
 .../avro/ipc/netty}/TestNettyServerWithSSL.java    |   7 +-
 .../TestNettyTransceiverWhenServerStops.java       |   3 +-
 .../apache/avro/ipc/netty}/TestProtocolNetty.java  |   5 +-
 lang/java/ipc-netty/src/test/keystore              | Bin 0 -> 1366 bytes
 .../resources/org/apache/avro/ipc/servercert.p12   | Bin 0 -> 1686 bytes
 lang/java/ipc-netty/src/test/truststore            | Bin 0 -> 660 bytes
 lang/java/ipc/pom.xml                              |  20 ++---
 .../ipc/src/main/java/org/apache/avro/ipc/Ipc.java |  23 ++++--
 .../org/apache/avro/ipc/stats/StatsPlugin.java     |  12 ++-
 .../org/apache/avro/ipc/stats/StatsServlet.java    |   2 +-
 .../java/org/apache/avro/ipc/stats/FakeTicks.java  |   2 +-
 lang/java/mapred/pom.xml                           |   5 ++
 .../apache/avro/mapred/tether/TetheredProcess.java |   2 +-
 .../avro/mapred/tether/TetherTaskRunner.java       |   2 +-
 lang/java/pom.xml                                  |   8 ++
 40 files changed, 170 insertions(+), 211 deletions(-)

diff --git a/lang/java/archetypes/avro-service-archetype/src/main/pom/pom.xml b/lang/java/archetypes/avro-service-archetype/src/main/pom/pom.xml
index d611e69..817ab8c 100644
--- a/lang/java/archetypes/avro-service-archetype/src/main/pom/pom.xml
+++ b/lang/java/archetypes/avro-service-archetype/src/main/pom/pom.xml
@@ -48,6 +48,11 @@
       <version>\${avro.version}</version>
     </dependency>
     <dependency>
+      <groupId>org.apache.avro</groupId>
+      <artifactId>avro-ipc-netty</artifactId>
+      <version>\${avro.version}</version>
+    </dependency>
+    <dependency>
       <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-core</artifactId>
       <version>\${jackson.version}</version>
diff --git a/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceClient.java b/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceClient.java
index dce4982..6fbbb5a 100644
--- a/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceClient.java
+++ b/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceClient.java
@@ -25,8 +25,8 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 
 import org.apache.avro.AvroRemoteException;
-import org.apache.avro.ipc.NettyTransceiver;
 import org.apache.avro.ipc.Transceiver;
+import org.apache.avro.ipc.netty.NettyTransceiver;
 import org.apache.avro.ipc.specific.SpecificRequestor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceEndpoint.java b/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceEndpoint.java
index f768e04..f00f07e 100644
--- a/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceEndpoint.java
+++ b/lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/transport/SimpleOrderServiceEndpoint.java
@@ -24,8 +24,8 @@ package ${package}.transport;
 import java.net.InetSocketAddress;
 
 import ${package}.service.SimpleOrderService;
-import org.apache.avro.ipc.NettyServer;
 import org.apache.avro.ipc.Server;
+import org.apache.avro.ipc.netty.NettyServer;
 import org.apache.avro.ipc.specific.SpecificResponder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/lang/java/compiler/pom.xml b/lang/java/compiler/pom.xml
index 3c29b36..8510b5e 100644
--- a/lang/java/compiler/pom.xml
+++ b/lang/java/compiler/pom.xml
@@ -82,6 +82,10 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
+          <!-- some tests hang if not run in a separate JVM -->
+          <forkCount>1</forkCount>
+          <reuseForks>false</reuseForks>
+          <parallel>none</parallel>
           <systemPropertyVariables>
             <test.idl.dir>${project.basedir}/src/test/idl</test.idl.dir>
           </systemPropertyVariables>
@@ -137,16 +141,6 @@
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <!-- some tests hang if not run in a separate JVM -->
-          <forkCount>1</forkCount>
-          <reuseForks>false</reuseForks>
-          <parallel>none</parallel>
-        </configuration>
-      </plugin>
     </plugins>
     <pluginManagement>
       <plugins>
diff --git a/lang/java/ipc/pom.xml b/lang/java/ipc-jetty/pom.xml
similarity index 55%
copy from lang/java/ipc/pom.xml
copy to lang/java/ipc-jetty/pom.xml
index f22a6a7..8fda076 100644
--- a/lang/java/ipc/pom.xml
+++ b/lang/java/ipc-jetty/pom.xml
@@ -27,32 +27,23 @@
     <relativePath>../</relativePath>
   </parent>
 
-  <artifactId>avro-ipc</artifactId>
+  <artifactId>avro-ipc-jetty</artifactId>
 
-  <name>Apache Avro IPC</name>
+  <name>Apache Avro IPC Jetty</name>
   <url>http://avro.apache.org</url>
-  <description>Avro inter-process communication components</description>
+  <description>Avro inter-process communication components using Jetty</description>
   <packaging>bundle</packaging>
 
   <properties>
     <osgi.import>
-      !org.apache.avro.ipc*,
+      !org.apache.avro.ipc.jetty*,
       org.apache.avro*;version="${project.version}",
-      org.jboss.netty*,
-      javax.servlet*;resolution:=optional,
-      org.eclipse*;resolution:=optional,
-      org.apache.velocity*;resolution:=optional,
       *
     </osgi.import>
-    <osgi.export>org.apache.avro.ipc*;version="${project.version}"</osgi.export>
+    <osgi.export>org.apache.avro.ipc.jetty*;version="${project.version}"</osgi.export>
   </properties>
 
   <build>
-    <resources>
-      <resource>
-        <directory>src/main/velocity</directory>
-      </resource>
-    </resources>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -61,40 +52,10 @@
           <!-- some tests hang if not run in a separate JVM -->
           <forkCount>1</forkCount>
           <reuseForks>false</reuseForks>
-           <parallel>none</parallel>
+          <parallel>none</parallel>
         </configuration>
       </plugin>
       <plugin>
-        <groupId>${project.groupId}</groupId>
-        <artifactId>avro-maven-plugin</artifactId>
-        <version>${project.version}</version>
-        <executions>
-          <execution>
-            <id>schemas</id>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>schema</goal>
-              <goal>protocol</goal>
-              <goal>idl-protocol</goal>
-            </goals>
-            <configuration>
-              <excludes>
-                <exclude>**/mapred/tether/**</exclude>
-                <exclude>org/apache/avro/data/Json.avsc</exclude>
-              </excludes>
-              <stringType>String</stringType>
-              <createOptionalGetters>true</createOptionalGetters>
-              <!--<gettersReturnOptional>true</gettersReturnOptional>-->
-              <sourceDirectory>${parent.project.basedir}/../../../../share/schemas/</sourceDirectory>
-              <outputDirectory>${project.build.directory}/generated-sources/java</outputDirectory>
-              <testSourceDirectory>${parent.project.basedir}/../../../../share/test/schemas/</testSourceDirectory>
-              <testOutputDirectory>${project.build.directory}/generated-test-sources/java</testOutputDirectory>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-
-      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>
         <executions>
@@ -115,6 +76,11 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>avro-ipc</artifactId>
+        <version>${project.version}</version>
+    </dependency>
+    <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>avro</artifactId>
       <version>${project.version}</version>
@@ -122,20 +88,19 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>avro-ipc</artifactId>
+        <version>${project.version}</version>
+        <type>test-jar</type>
+        <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>avro-compiler</artifactId>
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
-        <groupId>com.fasterxml.jackson.core</groupId>
-        <artifactId>jackson-core</artifactId>
-    </dependency>
-    <dependency>
-        <groupId>com.fasterxml.jackson.core</groupId>
-        <artifactId>jackson-databind</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.eclipse.jetty</groupId>
       <artifactId>jetty-server</artifactId>
     </dependency>
@@ -143,21 +108,7 @@
         <groupId>org.eclipse.jetty</groupId>
         <artifactId>jetty-servlet</artifactId>
     </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.velocity</groupId>
-      <artifactId>velocity-engine-core</artifactId>
-    </dependency>
-    <!-- javax.annotation-api dependency must be explicit for forward compatibility (Java > 9) -->
-    <dependency>
-      <groupId>javax.annotation</groupId>
-      <artifactId>javax.annotation-api</artifactId>
-      <version>1.3.2</version>
-    </dependency>
-
   </dependencies>
 
 </project>
+
diff --git a/lang/java/ipc/src/main/java/org/apache/avro/ipc/HttpServer.java b/lang/java/ipc-jetty/src/main/java/org/apache/avro/ipc/jetty/HttpServer.java
similarity index 92%
rename from lang/java/ipc/src/main/java/org/apache/avro/ipc/HttpServer.java
rename to lang/java/ipc-jetty/src/main/java/org/apache/avro/ipc/jetty/HttpServer.java
index 917a723..2a6df94 100644
--- a/lang/java/ipc/src/main/java/org/apache/avro/ipc/HttpServer.java
+++ b/lang/java/ipc-jetty/src/main/java/org/apache/avro/ipc/jetty/HttpServer.java
@@ -16,12 +16,16 @@
  * limitations under the License.
  */
 
-package org.apache.avro.ipc;
+package org.apache.avro.ipc.jetty;
 
 import java.io.IOException;
+import java.net.InetSocketAddress;
 import java.util.Arrays;
 
 import org.apache.avro.AvroRuntimeException;
+import org.apache.avro.ipc.Responder;
+import org.apache.avro.ipc.ResponderServlet;
+import org.apache.avro.ipc.Server;
 import org.eclipse.jetty.server.ConnectionFactory;
 import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.HttpConfiguration;
@@ -45,6 +49,12 @@ public class HttpServer implements Server {
     this(servlet, null, port);
   }
 
+
+  /** Constructs a server to run on the named port on the specified address. */
+  public HttpServer(Responder responder, InetSocketAddress addr) throws IOException {
+      this(new ResponderServlet(responder), addr.getHostString(), addr.getPort());
+  }
+
   /** Constructs a server to run on the named port on the specified address. */
   public HttpServer(Responder responder, String bindAddress, int port) throws IOException {
     this(new ResponderServlet(responder), bindAddress, port);
diff --git a/lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StaticServlet.java b/lang/java/ipc-jetty/src/main/java/org/apache/avro/ipc/jetty/StaticServlet.java
similarity index 94%
rename from lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StaticServlet.java
rename to lang/java/ipc-jetty/src/main/java/org/apache/avro/ipc/jetty/StaticServlet.java
index 53d16a8..b9e5633 100644
--- a/lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StaticServlet.java
+++ b/lang/java/ipc-jetty/src/main/java/org/apache/avro/ipc/jetty/StaticServlet.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.avro.ipc.stats;
+package org.apache.avro.ipc.jetty;
 
 import java.net.URL;
 
@@ -27,6 +27,8 @@ import org.eclipse.jetty.util.resource.Resource;
  * Very simple servlet class capable of serving static files.
  */
 public class StaticServlet extends DefaultServlet {
+  private static final long serialVersionUID = 1L;
+
   public Resource getResource(String pathInContext) {
     // Take only last slice of the URL as a filename, so we can adjust path.
     // This also prevents mischief like '../../foo.css'
diff --git a/lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StatsServer.java b/lang/java/ipc-jetty/src/main/java/org/apache/avro/ipc/jetty/StatsServer.java
similarity index 93%
rename from lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StatsServer.java
rename to lang/java/ipc-jetty/src/main/java/org/apache/avro/ipc/jetty/StatsServer.java
index 19d818a..687e9f2 100644
--- a/lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StatsServer.java
+++ b/lang/java/ipc-jetty/src/main/java/org/apache/avro/ipc/jetty/StatsServer.java
@@ -1,4 +1,6 @@
-package org.apache.avro.ipc.stats;
+package org.apache.avro.ipc.jetty;
+import org.apache.avro.ipc.stats.StatsPlugin;
+import org.apache.avro.ipc.stats.StatsServlet;
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/StatsPluginOverhead.java b/lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/StatsPluginOverhead.java
similarity index 97%
rename from lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/StatsPluginOverhead.java
rename to lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/StatsPluginOverhead.java
index e0c9a67..f7d2f84 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/StatsPluginOverhead.java
+++ b/lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/StatsPluginOverhead.java
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.avro.ipc.stats;
+package org.apache.avro.ipc.jetty;
 
 import java.io.IOException;
 import java.net.URL;
@@ -23,12 +23,12 @@ import java.net.URL;
 import org.apache.avro.AvroRemoteException;
 import org.apache.avro.Protocol;
 import org.apache.avro.Protocol.Message;
-import org.apache.avro.ipc.HttpServer;
 import org.apache.avro.ipc.HttpTransceiver;
 import org.apache.avro.ipc.Responder;
 import org.apache.avro.ipc.Transceiver;
 import org.apache.avro.ipc.generic.GenericRequestor;
 import org.apache.avro.ipc.generic.GenericResponder;
+import org.apache.avro.ipc.stats.StatsPlugin;
 
 /**
  * Naively measures overhead of using the stats plugin.
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/TestBulkData.java b/lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestBulkData.java
similarity index 98%
rename from lang/java/ipc/src/test/java/org/apache/avro/TestBulkData.java
rename to lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestBulkData.java
index db9220f..5b9add6 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/TestBulkData.java
+++ b/lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestBulkData.java
@@ -15,9 +15,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.avro;
+package org.apache.avro.ipc.jetty;
 
-import org.apache.avro.ipc.HttpServer;
 import org.apache.avro.ipc.HttpTransceiver;
 import org.apache.avro.ipc.Server;
 import org.apache.avro.ipc.Transceiver;
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/TestProtocolHttp.java b/lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestProtocolHttp.java
similarity index 95%
rename from lang/java/ipc/src/test/java/org/apache/avro/TestProtocolHttp.java
rename to lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestProtocolHttp.java
index d73f22d..d067edf 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/TestProtocolHttp.java
+++ b/lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestProtocolHttp.java
@@ -15,13 +15,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.avro;
+package org.apache.avro.ipc.jetty;
 
+import org.apache.avro.AvroRemoteException;
+import org.apache.avro.Protocol;
 import org.apache.avro.Schema;
+import org.apache.avro.TestProtocolSpecific;
 import org.apache.avro.ipc.Server;
 import org.apache.avro.ipc.Transceiver;
 import org.apache.avro.ipc.Responder;
-import org.apache.avro.ipc.HttpServer;
 import org.apache.avro.ipc.HttpTransceiver;
 import org.apache.avro.ipc.generic.GenericRequestor;
 import org.apache.avro.ipc.specific.SpecificRequestor;
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/TestProtocolHttps.java b/lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestProtocolHttps.java
similarity index 96%
rename from lang/java/ipc/src/test/java/org/apache/avro/TestProtocolHttps.java
rename to lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestProtocolHttps.java
index 67182e1..9611a1c 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/TestProtocolHttps.java
+++ b/lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestProtocolHttps.java
@@ -15,12 +15,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.avro;
+package org.apache.avro.ipc.jetty;
 
 import org.apache.avro.ipc.Server;
 import org.apache.avro.ipc.Transceiver;
 import org.apache.avro.ipc.Responder;
-import org.apache.avro.ipc.HttpServer;
+import org.apache.avro.TestProtocolSpecific;
 import org.apache.avro.ipc.HttpTransceiver;
 import org.eclipse.jetty.server.SslConnectionFactory;
 import org.eclipse.jetty.util.ssl.SslContextFactory;
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/TestStatsPluginAndServlet.java b/lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestStatsPluginAndServlet.java
similarity index 97%
rename from lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/TestStatsPluginAndServlet.java
rename to lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestStatsPluginAndServlet.java
index 2585520..9206d47 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/TestStatsPluginAndServlet.java
+++ b/lang/java/ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestStatsPluginAndServlet.java
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.avro.ipc.stats;
+package org.apache.avro.ipc.jetty;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -33,7 +33,6 @@ import org.apache.avro.Protocol;
 import org.apache.avro.Protocol.Message;
 import org.apache.avro.generic.GenericData;
 import org.apache.avro.generic.GenericRecord;
-import org.apache.avro.ipc.HttpServer;
 import org.apache.avro.ipc.HttpTransceiver;
 import org.apache.avro.ipc.LocalTransceiver;
 import org.apache.avro.ipc.RPCContext;
@@ -41,6 +40,8 @@ import org.apache.avro.ipc.Responder;
 import org.apache.avro.ipc.Transceiver;
 import org.apache.avro.ipc.generic.GenericRequestor;
 import org.apache.avro.ipc.generic.GenericResponder;
+import org.apache.avro.ipc.stats.StatsPlugin;
+import org.apache.avro.ipc.stats.StatsServlet;
 import org.junit.Test;
 
 public class TestStatsPluginAndServlet {
@@ -111,7 +112,7 @@ public class TestStatsPluginAndServlet {
 
   @Test
   public void testMultipleRPCs() throws IOException {
-    FakeTicks t = new FakeTicks();
+    org.apache.avro.ipc.stats.FakeTicks t = new org.apache.avro.ipc.stats.FakeTicks();
     StatsPlugin statsPlugin = new StatsPlugin(t, StatsPlugin.LATENCY_SEGMENTER,
         StatsPlugin.PAYLOAD_SEGMENTER);
     RPCContext context1 = makeContext();
diff --git a/lang/java/ipc-jetty/src/test/keystore b/lang/java/ipc-jetty/src/test/keystore
new file mode 100644
index 0000000..a13beae
Binary files /dev/null and b/lang/java/ipc-jetty/src/test/keystore differ
diff --git a/lang/java/ipc-jetty/src/test/resources/org/apache/avro/ipc/servercert.p12 b/lang/java/ipc-jetty/src/test/resources/org/apache/avro/ipc/servercert.p12
new file mode 100644
index 0000000..7911ce6
Binary files /dev/null and b/lang/java/ipc-jetty/src/test/resources/org/apache/avro/ipc/servercert.p12 differ
diff --git a/lang/java/ipc-jetty/src/test/truststore b/lang/java/ipc-jetty/src/test/truststore
new file mode 100644
index 0000000..e442bdc
Binary files /dev/null and b/lang/java/ipc-jetty/src/test/truststore differ
diff --git a/lang/java/ipc/pom.xml b/lang/java/ipc-netty/pom.xml
similarity index 57%
copy from lang/java/ipc/pom.xml
copy to lang/java/ipc-netty/pom.xml
index f22a6a7..f8a6811 100644
--- a/lang/java/ipc/pom.xml
+++ b/lang/java/ipc-netty/pom.xml
@@ -27,20 +27,18 @@
     <relativePath>../</relativePath>
   </parent>
 
-  <artifactId>avro-ipc</artifactId>
+  <artifactId>avro-ipc-netty</artifactId>
 
-  <name>Apache Avro IPC</name>
+  <name>Apache Avro IPC Netty</name>
   <url>http://avro.apache.org</url>
   <description>Avro inter-process communication components</description>
   <packaging>bundle</packaging>
 
   <properties>
     <osgi.import>
-      !org.apache.avro.ipc*,
+      !org.apache.avro.ipc.netty*,
       org.apache.avro*;version="${project.version}",
       org.jboss.netty*,
-      javax.servlet*;resolution:=optional,
-      org.eclipse*;resolution:=optional,
       org.apache.velocity*;resolution:=optional,
       *
     </osgi.import>
@@ -48,11 +46,6 @@
   </properties>
 
   <build>
-    <resources>
-      <resource>
-        <directory>src/main/velocity</directory>
-      </resource>
-    </resources>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -61,40 +54,10 @@
           <!-- some tests hang if not run in a separate JVM -->
           <forkCount>1</forkCount>
           <reuseForks>false</reuseForks>
-           <parallel>none</parallel>
+          <parallel>none</parallel>
         </configuration>
       </plugin>
       <plugin>
-        <groupId>${project.groupId}</groupId>
-        <artifactId>avro-maven-plugin</artifactId>
-        <version>${project.version}</version>
-        <executions>
-          <execution>
-            <id>schemas</id>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>schema</goal>
-              <goal>protocol</goal>
-              <goal>idl-protocol</goal>
-            </goals>
-            <configuration>
-              <excludes>
-                <exclude>**/mapred/tether/**</exclude>
-                <exclude>org/apache/avro/data/Json.avsc</exclude>
-              </excludes>
-              <stringType>String</stringType>
-              <createOptionalGetters>true</createOptionalGetters>
-              <!--<gettersReturnOptional>true</gettersReturnOptional>-->
-              <sourceDirectory>${parent.project.basedir}/../../../../share/schemas/</sourceDirectory>
-              <outputDirectory>${project.build.directory}/generated-sources/java</outputDirectory>
-              <testSourceDirectory>${parent.project.basedir}/../../../../share/test/schemas/</testSourceDirectory>
-              <testOutputDirectory>${project.build.directory}/generated-test-sources/java</testOutputDirectory>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-
-      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>
         <executions>
@@ -115,6 +78,11 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>avro-ipc</artifactId>
+        <version>${project.version}</version>
+    </dependency>
+    <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>avro</artifactId>
       <version>${project.version}</version>
@@ -122,42 +90,25 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>avro-ipc</artifactId>
+        <version>${project.version}</version>
+        <type>test-jar</type>
+        <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>avro-compiler</artifactId>
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
-        <groupId>com.fasterxml.jackson.core</groupId>
-        <artifactId>jackson-core</artifactId>
-    </dependency>
-    <dependency>
-        <groupId>com.fasterxml.jackson.core</groupId>
-        <artifactId>jackson-databind</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.jetty</groupId>
-      <artifactId>jetty-server</artifactId>
-    </dependency>
-    <dependency>
-        <groupId>org.eclipse.jetty</groupId>
-        <artifactId>jetty-servlet</artifactId>
-    </dependency>
-    <dependency>
       <groupId>io.netty</groupId>
       <artifactId>netty</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.apache.velocity</groupId>
-      <artifactId>velocity-engine-core</artifactId>
-    </dependency>
-    <!-- javax.annotation-api dependency must be explicit for forward compatibility (Java > 9) -->
-    <dependency>
-      <groupId>javax.annotation</groupId>
-      <artifactId>javax.annotation-api</artifactId>
-      <version>1.3.2</version>
-    </dependency>
+
 
   </dependencies>
 
 </project>
+
diff --git a/lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyServer.java b/lang/java/ipc-netty/src/main/java/org/apache/avro/ipc/netty/NettyServer.java
similarity index 95%
rename from lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyServer.java
rename to lang/java/ipc-netty/src/main/java/org/apache/avro/ipc/netty/NettyServer.java
index 2e299a0..3f146db 100644
--- a/lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyServer.java
+++ b/lang/java/ipc-netty/src/main/java/org/apache/avro/ipc/netty/NettyServer.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.avro.ipc;
+package org.apache.avro.ipc.netty;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -25,9 +25,11 @@ import java.util.List;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Executors;
 
-import org.apache.avro.ipc.NettyTransportCodec.NettyDataPack;
-import org.apache.avro.ipc.NettyTransportCodec.NettyFrameDecoder;
-import org.apache.avro.ipc.NettyTransportCodec.NettyFrameEncoder;
+import org.apache.avro.ipc.Responder;
+import org.apache.avro.ipc.Server;
+import org.apache.avro.ipc.netty.NettyTransportCodec.NettyDataPack;
+import org.apache.avro.ipc.netty.NettyTransportCodec.NettyFrameDecoder;
+import org.apache.avro.ipc.netty.NettyTransportCodec.NettyFrameEncoder;
 import org.jboss.netty.bootstrap.ServerBootstrap;
 import org.jboss.netty.channel.Channel;
 import org.jboss.netty.channel.ChannelEvent;
diff --git a/lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyTransceiver.java b/lang/java/ipc-netty/src/main/java/org/apache/avro/ipc/netty/NettyTransceiver.java
similarity index 98%
rename from lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyTransceiver.java
rename to lang/java/ipc-netty/src/main/java/org/apache/avro/ipc/netty/NettyTransceiver.java
index 107aac8..24f542f 100644
--- a/lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyTransceiver.java
+++ b/lang/java/ipc-netty/src/main/java/org/apache/avro/ipc/netty/NettyTransceiver.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.avro.ipc;
+package org.apache.avro.ipc.netty;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -32,9 +32,12 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.avro.Protocol;
-import org.apache.avro.ipc.NettyTransportCodec.NettyDataPack;
-import org.apache.avro.ipc.NettyTransportCodec.NettyFrameDecoder;
-import org.apache.avro.ipc.NettyTransportCodec.NettyFrameEncoder;
+import org.apache.avro.ipc.CallFuture;
+import org.apache.avro.ipc.Callback;
+import org.apache.avro.ipc.Transceiver;
+import org.apache.avro.ipc.netty.NettyTransportCodec.NettyDataPack;
+import org.apache.avro.ipc.netty.NettyTransportCodec.NettyFrameDecoder;
+import org.apache.avro.ipc.netty.NettyTransportCodec.NettyFrameEncoder;
 import org.jboss.netty.bootstrap.ClientBootstrap;
 import org.jboss.netty.channel.Channel;
 import org.jboss.netty.channel.ChannelEvent;
diff --git a/lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyTransportCodec.java b/lang/java/ipc-netty/src/main/java/org/apache/avro/ipc/netty/NettyTransportCodec.java
similarity index 99%
rename from lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyTransportCodec.java
rename to lang/java/ipc-netty/src/main/java/org/apache/avro/ipc/netty/NettyTransportCodec.java
index 80f1f83..432fe28 100644
--- a/lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyTransportCodec.java
+++ b/lang/java/ipc-netty/src/main/java/org/apache/avro/ipc/netty/NettyTransportCodec.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.avro.ipc;
+package org.apache.avro.ipc.netty;
 
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/NettyTransceiverWhenFailsToConnect.java b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/NettyTransceiverWhenFailsToConnect.java
similarity index 98%
rename from lang/java/ipc/src/test/java/org/apache/avro/ipc/NettyTransceiverWhenFailsToConnect.java
rename to lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/NettyTransceiverWhenFailsToConnect.java
index 6776353..60196bc 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/NettyTransceiverWhenFailsToConnect.java
+++ b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/NettyTransceiverWhenFailsToConnect.java
@@ -15,7 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.avro.ipc;
+package org.apache.avro.ipc.netty;
 
 import org.jboss.netty.channel.ChannelFactory;
 import org.jboss.netty.channel.ChannelPipeline;
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServer.java b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServer.java
similarity index 96%
rename from lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServer.java
rename to lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServer.java
index a892744..3970a5e 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServer.java
+++ b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServer.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.avro.ipc;
+package org.apache.avro.ipc.netty;
 
 import java.io.IOException;
 import java.io.OutputStream;
@@ -29,7 +29,11 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
 import org.junit.Assert;
-
+import org.apache.avro.ipc.Responder;
+import org.apache.avro.ipc.Server;
+import org.apache.avro.ipc.Transceiver;
+import org.apache.avro.ipc.netty.NettyServer;
+import org.apache.avro.ipc.netty.NettyTransceiver;
 import org.apache.avro.ipc.specific.SpecificRequestor;
 import org.apache.avro.ipc.specific.SpecificResponder;
 import org.apache.avro.test.Mail;
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerConcurrentExecution.java b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerConcurrentExecution.java
similarity index 97%
rename from lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerConcurrentExecution.java
rename to lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerConcurrentExecution.java
index de0ea35..afdc60b 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerConcurrentExecution.java
+++ b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerConcurrentExecution.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.avro.ipc;
+package org.apache.avro.ipc.netty;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -25,6 +25,10 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Executors;
 
 import org.apache.avro.AvroRemoteException;
+import org.apache.avro.ipc.Server;
+import org.apache.avro.ipc.Transceiver;
+import org.apache.avro.ipc.netty.NettyServer;
+import org.apache.avro.ipc.netty.NettyTransceiver;
 import org.apache.avro.ipc.specific.SpecificRequestor;
 import org.apache.avro.ipc.specific.SpecificResponder;
 import org.apache.avro.test.Simple;
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithCallbacks.java b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerWithCallbacks.java
similarity index 99%
rename from lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithCallbacks.java
rename to lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerWithCallbacks.java
index 77c89a3..127f41b 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithCallbacks.java
+++ b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerWithCallbacks.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.avro.ipc;
+package org.apache.avro.ipc.netty;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -34,6 +34,11 @@ import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
 
 import org.apache.avro.AvroRemoteException;
+import org.apache.avro.ipc.CallFuture;
+import org.apache.avro.ipc.Callback;
+import org.apache.avro.ipc.Responder;
+import org.apache.avro.ipc.Server;
+import org.apache.avro.ipc.Transceiver;
 import org.apache.avro.ipc.specific.SpecificRequestor;
 import org.apache.avro.ipc.specific.SpecificResponder;
 import org.apache.avro.test.Simple;
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithCompression.java b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerWithCompression.java
similarity index 95%
rename from lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithCompression.java
rename to lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerWithCompression.java
index ab8de99..ca6fdeb 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithCompression.java
+++ b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerWithCompression.java
@@ -15,12 +15,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.avro.ipc;
+package org.apache.avro.ipc.netty;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.util.concurrent.Executors;
 
+import org.apache.avro.ipc.Responder;
+import org.apache.avro.ipc.Server;
+import org.apache.avro.ipc.Transceiver;
 import org.jboss.netty.channel.ChannelFactory;
 import org.jboss.netty.channel.ChannelPipeline;
 import org.jboss.netty.channel.ChannelPipelineFactory;
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithSSL.java b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerWithSSL.java
similarity index 95%
rename from lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithSSL.java
rename to lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerWithSSL.java
index dfc8271..c021de3 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithSSL.java
+++ b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerWithSSL.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.avro.ipc;
+package org.apache.avro.ipc.netty;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -30,6 +30,11 @@ import javax.net.ssl.SSLEngine;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
 
+import org.apache.avro.ipc.Responder;
+import org.apache.avro.ipc.Server;
+import org.apache.avro.ipc.Transceiver;
+import org.apache.avro.ipc.netty.NettyServer;
+import org.apache.avro.ipc.netty.NettyTransceiver;
 import org.jboss.netty.channel.ChannelFactory;
 import org.jboss.netty.channel.ChannelPipeline;
 import org.jboss.netty.channel.ChannelPipelineFactory;
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyTransceiverWhenServerStops.java b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyTransceiverWhenServerStops.java
similarity index 98%
rename from lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyTransceiverWhenServerStops.java
rename to lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyTransceiverWhenServerStops.java
index d79ce45..a191e87 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyTransceiverWhenServerStops.java
+++ b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyTransceiverWhenServerStops.java
@@ -15,8 +15,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.avro.ipc;
+package org.apache.avro.ipc.netty;
 
+import org.apache.avro.ipc.Responder;
 import org.apache.avro.ipc.specific.SpecificRequestor;
 import org.apache.avro.ipc.specific.SpecificResponder;
 import org.apache.avro.test.Mail;
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/TestProtocolNetty.java b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestProtocolNetty.java
similarity index 93%
rename from lang/java/ipc/src/test/java/org/apache/avro/TestProtocolNetty.java
rename to lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestProtocolNetty.java
index 84da84d..c25b781 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/TestProtocolNetty.java
+++ b/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestProtocolNetty.java
@@ -16,12 +16,11 @@
  * limitations under the License.
  */
 
-package org.apache.avro;
+package org.apache.avro.ipc.netty;
 
 import java.net.InetSocketAddress;
 
-import org.apache.avro.ipc.NettyServer;
-import org.apache.avro.ipc.NettyTransceiver;
+import org.apache.avro.TestProtocolSpecific;
 import org.apache.avro.ipc.Responder;
 import org.apache.avro.ipc.Server;
 import org.apache.avro.ipc.Transceiver;
diff --git a/lang/java/ipc-netty/src/test/keystore b/lang/java/ipc-netty/src/test/keystore
new file mode 100644
index 0000000..a13beae
Binary files /dev/null and b/lang/java/ipc-netty/src/test/keystore differ
diff --git a/lang/java/ipc-netty/src/test/resources/org/apache/avro/ipc/servercert.p12 b/lang/java/ipc-netty/src/test/resources/org/apache/avro/ipc/servercert.p12
new file mode 100644
index 0000000..7911ce6
Binary files /dev/null and b/lang/java/ipc-netty/src/test/resources/org/apache/avro/ipc/servercert.p12 differ
diff --git a/lang/java/ipc-netty/src/test/truststore b/lang/java/ipc-netty/src/test/truststore
new file mode 100644
index 0000000..e442bdc
Binary files /dev/null and b/lang/java/ipc-netty/src/test/truststore differ
diff --git a/lang/java/ipc/pom.xml b/lang/java/ipc/pom.xml
index f22a6a7..6812265 100644
--- a/lang/java/ipc/pom.xml
+++ b/lang/java/ipc/pom.xml
@@ -38,13 +38,12 @@
     <osgi.import>
       !org.apache.avro.ipc*,
       org.apache.avro*;version="${project.version}",
-      org.jboss.netty*,
       javax.servlet*;resolution:=optional,
-      org.eclipse*;resolution:=optional,
       org.apache.velocity*;resolution:=optional,
       *
     </osgi.import>
     <osgi.export>org.apache.avro.ipc*;version="${project.version}"</osgi.export>
+    <osgi.dynamic.import>org.apache.avro.ipc.jetty,org.apache.avro.ipc.netty</osgi.dynamic.import>
   </properties>
 
   <build>
@@ -136,21 +135,14 @@
         <artifactId>jackson-databind</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.jetty</groupId>
-      <artifactId>jetty-server</artifactId>
-    </dependency>
-    <dependency>
-        <groupId>org.eclipse.jetty</groupId>
-        <artifactId>jetty-servlet</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.velocity</groupId>
       <artifactId>velocity-engine-core</artifactId>
     </dependency>
+    <dependency>
+        <groupId>javax.servlet</groupId>
+        <artifactId>javax.servlet-api</artifactId>
+        <scope>provided</scope>
+    </dependency>
     <!-- javax.annotation-api dependency must be explicit for forward compatibility (Java > 9) -->
     <dependency>
       <groupId>javax.annotation</groupId>
diff --git a/lang/java/ipc/src/main/java/org/apache/avro/ipc/Ipc.java b/lang/java/ipc/src/main/java/org/apache/avro/ipc/Ipc.java
index 06bf041..75b8bbb 100644
--- a/lang/java/ipc/src/main/java/org/apache/avro/ipc/Ipc.java
+++ b/lang/java/ipc/src/main/java/org/apache/avro/ipc/Ipc.java
@@ -22,9 +22,12 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.URI;
 
+import org.slf4j.LoggerFactory;
+
 /** IPC utilities, including client and server factories. */
 public class Ipc {
   private Ipc() {}                                // no public ctor
+  static boolean warned = false;
 
   /** Create a client {@link Transceiver} connecting to the provided URI. */
   public static Transceiver createTransceiver(URI uri) throws IOException {
@@ -41,13 +44,23 @@ public class Ipc {
    * responder. */
   public static Server createServer(Responder responder,
                                     URI uri) throws IOException {
-    if ("http".equals(uri.getScheme()))
-      return new HttpServer(responder, uri.getPort());
-    else if ("avro".equals(uri.getScheme()))
+    if ("avro".equals(uri.getScheme())) {
       return new SaslSocketServer
         (responder, new InetSocketAddress(uri.getHost(), uri.getPort()));
-    else
-      throw new IOException("unknown uri scheme: "+uri);
+    } else if ("http".equals(uri.getScheme())) {
+      if (!warned) {
+        LoggerFactory.getLogger(Ipc.class).error("Using Ipc.createServer to create http instances is deprecated.  Create "
+            + " an instace of org.apache.avro.ipc.jetty.HttpServer directly.");
+        warned = true;
+      }
+      try {
+        Class<?> cls = Class.forName("org.apache.avro.ipc.jetty.HttpServer");
+        return (Server)cls.getConstructor(Responder.class, Integer.TYPE).newInstance(responder, uri.getPort());
+      } catch (Throwable t) {
+        //ignore, exception will be thrown
+      }
+    }
+    throw new IOException("unknown uri scheme: "+uri);
   }
 
 }
diff --git a/lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StatsPlugin.java b/lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StatsPlugin.java
index 553b424..120d3f2 100644
--- a/lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StatsPlugin.java
+++ b/lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StatsPlugin.java
@@ -43,7 +43,7 @@ import org.apache.avro.ipc.stats.Stopwatch.Ticks;
  */
 public class StatsPlugin extends RPCPlugin {
   /** Static declaration of histogram buckets. */
-  static final Segmenter<String, Float> LATENCY_SEGMENTER =
+  public static final Segmenter<String, Float> LATENCY_SEGMENTER =
       new Histogram.TreeMapSegmenter<>(new TreeSet<>(Arrays.asList(
             0f,
            25f,
@@ -61,7 +61,7 @@ public class StatsPlugin extends RPCPlugin {
         60000f, // 1 minute
        600000f)));
 
-  static final Segmenter<String, Integer> PAYLOAD_SEGMENTER =
+  public static final Segmenter<String, Integer> PAYLOAD_SEGMENTER =
       new Histogram.TreeMapSegmenter<>(new TreeSet<>(Arrays.asList(
             0,
            25,
@@ -102,7 +102,7 @@ public class StatsPlugin extends RPCPlugin {
   private Segmenter<?, Integer> integerSegmenter;
 
   /** Construct a plugin with custom Ticks and Segmenter implementations. */
-  StatsPlugin(Ticks ticks, Segmenter<?, Float> floatSegmenter,
+  public StatsPlugin(Ticks ticks, Segmenter<?, Float> floatSegmenter,
       Segmenter<?, Integer> integerSegmenter) {
     this.floatSegmenter = floatSegmenter;
     this.integerSegmenter = integerSegmenter;
@@ -209,14 +209,12 @@ public class StatsPlugin extends RPCPlugin {
     }
   }
 
-  @SuppressWarnings("unchecked")
   private FloatHistogram<?> createNewFloatHistogram() {
-    return new FloatHistogram(floatSegmenter);
+    return new FloatHistogram<>(floatSegmenter);
   }
 
-  @SuppressWarnings("unchecked")
   private IntegerHistogram<?> createNewIntegerHistogram() {
-    return new IntegerHistogram(integerSegmenter);
+    return new IntegerHistogram<>(integerSegmenter);
   }
 
   /** Converts nanoseconds to milliseconds. */
diff --git a/lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StatsServlet.java b/lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StatsServlet.java
index f51789a..8605095 100644
--- a/lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StatsServlet.java
+++ b/lang/java/ipc/src/main/java/org/apache/avro/ipc/stats/StatsServlet.java
@@ -125,7 +125,7 @@ public class StatsServlet extends HttpServlet {
     }
   }
 
-  void writeStats(Writer w) throws IOException {
+  public void writeStats(Writer w) throws IOException {
     VelocityContext context = new VelocityContext();
     context.put("title", "Avro RPC Stats");
 
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/FakeTicks.java b/lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/FakeTicks.java
index 68358b7..e3854b7 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/FakeTicks.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/FakeTicks.java
@@ -20,7 +20,7 @@ package org.apache.avro.ipc.stats;
 import org.apache.avro.ipc.stats.Stopwatch.Ticks;
 
 /** Implements Ticks with manual time-winding. */
-class FakeTicks implements Ticks {
+public class FakeTicks implements Ticks {
   long time = 0;
 
   @Override
diff --git a/lang/java/mapred/pom.xml b/lang/java/mapred/pom.xml
index 7be401e..e0fee81 100644
--- a/lang/java/mapred/pom.xml
+++ b/lang/java/mapred/pom.xml
@@ -123,6 +123,11 @@
     </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
+      <artifactId>avro-ipc-jetty</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
       <artifactId>avro-ipc</artifactId>
       <classifier>tests</classifier>
       <version>${project.version}</version>
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetheredProcess.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetheredProcess.java
index 3d3153b..a1094af 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetheredProcess.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetheredProcess.java
@@ -44,7 +44,7 @@ import org.apache.avro.ipc.SaslSocketServer;
 import org.apache.avro.ipc.SaslSocketTransceiver;
 import org.apache.avro.ipc.specific.SpecificRequestor;
 import org.apache.avro.ipc.specific.SpecificResponder;
-import org.apache.avro.ipc.HttpServer;
+import org.apache.avro.ipc.jetty.HttpServer;
 import org.apache.avro.ipc.HttpTransceiver;
 
 import org.slf4j.Logger;
diff --git a/lang/java/mapred/src/test/java/org/apache/avro/mapred/tether/TetherTaskRunner.java b/lang/java/mapred/src/test/java/org/apache/avro/mapred/tether/TetherTaskRunner.java
index 39cdc42..cd69943 100644
--- a/lang/java/mapred/src/test/java/org/apache/avro/mapred/tether/TetherTaskRunner.java
+++ b/lang/java/mapred/src/test/java/org/apache/avro/mapred/tether/TetherTaskRunner.java
@@ -25,10 +25,10 @@ import java.nio.ByteBuffer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.avro.ipc.HttpServer;
 import org.apache.avro.ipc.SaslSocketServer;
 import org.apache.avro.ipc.specific.SpecificResponder;
 import org.apache.avro.ipc.Server;
+import org.apache.avro.ipc.jetty.HttpServer;
 
 /** Java implementation of a tether executable.  Useless except for testing,
  * since it's already possible to write Java MapReduce programs without
diff --git a/lang/java/pom.xml b/lang/java/pom.xml
index 7e733ef..c93bc7d 100644
--- a/lang/java/pom.xml
+++ b/lang/java/pom.xml
@@ -40,6 +40,7 @@
 
     <hadoop2.version>2.7.3</hadoop2.version>
     <jackson.version>2.9.8</jackson.version>
+    <servlet-api.version>3.1.0</servlet-api.version>
     <jetty.version>9.4.14.v20181114</jetty.version>
     <jopt-simple.version>5.0.4</jopt-simple.version>
     <junit.version>4.12</junit.version>
@@ -86,6 +87,8 @@
     <module>compiler</module>
     <module>maven-plugin</module>
     <module>ipc</module>
+    <module>ipc-jetty</module>
+    <module>ipc-netty</module>
     <module>trevni</module>
     <module>tools</module>
     <module>mapred</module>
@@ -459,6 +462,11 @@
           <version>${jetty.version}</version>
       </dependency>
       <dependency>
+          <groupId>javax.servlet</groupId>
+          <artifactId>javax.servlet-api</artifactId>
+          <version>${servlet-api.version}</version>
+      </dependency>
+      <dependency>
         <groupId>io.netty</groupId>
         <artifactId>netty</artifactId>
         <version>${netty.version}</version>


Mime
View raw message