hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1024404 - in /hbase/branches/0.20: CHANGES.txt src/java/org/apache/hadoop/hbase/ipc/HBaseClient.java
Date Tue, 19 Oct 2010 20:40:48 GMT
Author: apurtell
Date: Tue Oct 19 20:40:48 2010
New Revision: 1024404

URL: http://svn.apache.org/viewvc?rev=1024404&view=rev
Log:
HBASE-3115 HBaseClient wastes 1 TCP packet per RPC

Modified:
    hbase/branches/0.20/CHANGES.txt
    hbase/branches/0.20/src/java/org/apache/hadoop/hbase/ipc/HBaseClient.java

Modified: hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.20/CHANGES.txt?rev=1024404&r1=1024403&r2=1024404&view=diff
==============================================================================
--- hbase/branches/0.20/CHANGES.txt (original)
+++ hbase/branches/0.20/CHANGES.txt Tue Oct 19 20:40:48 2010
@@ -10,7 +10,8 @@ Release 0.20.7 - Unreleased
    HBASE-2906  [rest/stargate] URI decoding in RowResource
    HBASE-3121  [rest/stargate] Do not perform cache control when returning
                results
-
+   HBASE-3115  HBaseClient wastes 1 TCP packet per RPC
+ 
   IMPROVEMENTS
    HBASE-2988  Support alternate compression for major compactions
    HBASE-2907  [rest/stargate] Improve error response when trying to create a

Modified: hbase/branches/0.20/src/java/org/apache/hadoop/hbase/ipc/HBaseClient.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/ipc/HBaseClient.java?rev=1024404&r1=1024403&r2=1024404&view=diff
==============================================================================
--- hbase/branches/0.20/src/java/org/apache/hadoop/hbase/ipc/HBaseClient.java (original)
+++ hbase/branches/0.20/src/java/org/apache/hadoop/hbase/ipc/HBaseClient.java Tue Oct 19 20:40:48
2010
@@ -49,6 +49,7 @@ import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableUtils;
 import org.apache.hadoop.io.DataOutputBuffer;
 import org.apache.hadoop.ipc.RemoteException;
+import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.util.ReflectionUtils;
@@ -476,12 +477,14 @@ public class HBaseClient {
           //for serializing the
           //data to be written
           d = new DataOutputBuffer();
+          d.writeInt(0xdeadbeef); // placeholder for data length
           d.writeInt(call.id);
           call.param.write(d);
           byte[] data = d.getData();
           int dataLength = d.getLength();
-          out.writeInt(dataLength);      //first put the data length
-          out.write(data, 0, dataLength);//write the data
+          // fill in the placeholder
+          Bytes.putInt(data, 0, dataLength - 4);
+          out.write(data, 0, dataLength);
           out.flush();
         }
       } catch(IOException e) {



Mime
View raw message