HBASE-3115. HBaseClient wastes 1 TCP packet per RPC

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1024125 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Todd Lipcon 2010-10-19 06:03:25 +00:00
parent 98dc0f7b8a
commit d4d7ceef68
2 changed files with 6 additions and 2 deletions

View File

@ -1013,6 +1013,7 @@ Release 0.21.0 - Unreleased
table in all tests and tests enable/disable/delete
HBASE-3097 Merge in hbase-1200 doc on bloomfilters into hbase book
HBASE-2700 Test of: Handle master failover for regions in transition
HBASE-3115 HBaseClient wastes 1 TCP packet per RPC
NEW FEATURES
HBASE-1961 HBase EC2 scripts

View File

@ -23,6 +23,7 @@ package org.apache.hadoop.hbase.ipc;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.io.DataOutputBuffer;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.io.ObjectWritable;
@ -484,12 +485,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) {