hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1491683 - in /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common: CHANGES.txt src/main/java/org/apache/hadoop/ipc/Client.java src/main/java/org/apache/hadoop/ipc/Server.java
Date Tue, 11 Jun 2013 03:31:11 GMT
Author: llu
Date: Tue Jun 11 03:31:10 2013
New Revision: 1491683

URL: http://svn.apache.org/r1491683
Log:
HADOOP-9630. [RPC v9] Remove IpcSerializationType. (Junping Du via llu)

Modified:
    hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt
    hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
    hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java

Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1491683&r1=1491682&r2=1491683&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt Tue Jun
11 03:31:10 2013
@@ -30,17 +30,19 @@ Release 2.1.0-beta - UNRELEASED
 
     HADOOP-8886. Remove KFS support. (eli)
 
-    HADOOP-9163 The rpc msg in ProtobufRpcEngine.proto should be moved out to
+    HADOOP-9163. [RPC v9] The rpc msg in ProtobufRpcEngine.proto should be moved out to
     avoid an extra copy (Sanjay Radia)
 
-    HADOOP-9151 Include RPC error info in RpcResponseHeader instead of sending
+    HADOOP-9151. [RPC v9] Include RPC error info in RpcResponseHeader instead of sending
     it separately (sanjay Radia)
 
-    HADOOP-9380 Add totalLength to rpc response  (sanjay Radia)
+    HADOOP-9380. [RPC v9] Add totalLength to rpc response  (sanjay Radia)
 
-    HADOOP-9425 Add error codes to rpc-response (sanjay Radia)
+    HADOOP-9425. [RPC v9] Add error codes to rpc-response (sanjay Radia)
 
-    HADOOP-9194. RPC support for QoS. (Junping Du via llu)
+    HADOOP-9194. [RPC v9] RPC support for QoS. (Junping Du via llu)
+
+    HADOOP-9630. [RPC v9] Remove IpcSerializationType. (Junping Du via llu)
 
   NEW FEATURES
 

Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java?rev=1491683&r1=1491682&r2=1491683&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
Tue Jun 11 03:31:10 2013
@@ -748,8 +748,6 @@ public class Client {
      * +----------------------------------+
      * |  Authmethod (1 byte)             |      
      * +----------------------------------+
-     * |  IpcSerializationType (1 byte)   |      
-     * +----------------------------------+
      */
     private void writeConnectionHeader(OutputStream outStream)
         throws IOException {
@@ -759,7 +757,6 @@ public class Client {
       out.write(Server.CURRENT_VERSION);
       out.write(serviceClass);
       authMethod.write(out);
-      Server.IpcSerializationType.PROTOBUF.write(out);
       out.flush();
     }
     

Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java?rev=1491683&r1=1491682&r2=1491683&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java
Tue Jun 11 03:31:10 2013
@@ -162,22 +162,6 @@ public abstract class Server {
   public static final ByteBuffer HEADER = ByteBuffer.wrap("hrpc".getBytes());
   
   /**
-   * Serialization type for ConnectionContext and RpcRequestHeader
-   */
-  public enum IpcSerializationType {
-    // Add new serialization type to the end without affecting the enum order
-    PROTOBUF;
-    
-    void write(DataOutput out) throws IOException {
-      out.writeByte(this.ordinal());
-    }
-    
-    static IpcSerializationType fromByte(byte b) {
-      return IpcSerializationType.values()[b];
-    }
-  }
-  
-  /**
    * If the user accidentally sends an HTTP GET to an IPC port, we detect this
    * and send back a nicer response.
    */
@@ -1319,7 +1303,7 @@ public abstract class Server {
         if (!connectionHeaderRead) {
           //Every connection is expected to send the header.
           if (connectionHeaderBuf == null) {
-            connectionHeaderBuf = ByteBuffer.allocate(4);
+            connectionHeaderBuf = ByteBuffer.allocate(3);
           }
           count = channelRead(channel, connectionHeaderBuf);
           if (count < 0 || connectionHeaderBuf.remaining() > 0) {
@@ -1352,13 +1336,6 @@ public abstract class Server {
             return -1;
           }
           
-          IpcSerializationType serializationType = IpcSerializationType
-              .fromByte(connectionHeaderBuf.get(3));
-          if (serializationType != IpcSerializationType.PROTOBUF) {
-            respondUnsupportedSerialization(serializationType);
-            return -1;
-          }
-          
           dataLengthBuffer.clear();
           if (authMethod == null) {
             throw new IOException("Unable to read authentication method");
@@ -1551,18 +1528,6 @@ public abstract class Server {
       }
     }
     
-    private void respondUnsupportedSerialization(IpcSerializationType st) throws IOException
{
-      String errMsg = "Server IPC version " + CURRENT_VERSION
-          + " do not support serilization " + st.toString();
-      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-
-      Call fakeCall = new Call(-1, null, this);
-      setupResponse(buffer, fakeCall, 
-       RpcStatusProto.FATAL,  RpcErrorCodeProto.FATAL_UNSUPPORTED_SERIALIZATION,
-       null, IpcException.class.getName(), errMsg);
-      responder.doRespond(fakeCall);
-    }
-    
     private void setupHttpRequestOnIpcPortResponse() throws IOException {
       Call fakeCall =  new Call(0, null, this);
       fakeCall.setResponse(ByteBuffer.wrap(



Mime
View raw message