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:
parent
98dc0f7b8a
commit
d4d7ceef68
|
@ -1013,6 +1013,7 @@ Release 0.21.0 - Unreleased
|
||||||
table in all tests and tests enable/disable/delete
|
table in all tests and tests enable/disable/delete
|
||||||
HBASE-3097 Merge in hbase-1200 doc on bloomfilters into hbase book
|
HBASE-3097 Merge in hbase-1200 doc on bloomfilters into hbase book
|
||||||
HBASE-2700 Test of: Handle master failover for regions in transition
|
HBASE-2700 Test of: Handle master failover for regions in transition
|
||||||
|
HBASE-3115 HBaseClient wastes 1 TCP packet per RPC
|
||||||
|
|
||||||
NEW FEATURES
|
NEW FEATURES
|
||||||
HBASE-1961 HBase EC2 scripts
|
HBASE-1961 HBase EC2 scripts
|
||||||
|
|
|
@ -23,6 +23,7 @@ package org.apache.hadoop.hbase.ipc;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
|
import org.apache.hadoop.hbase.util.Bytes;
|
||||||
import org.apache.hadoop.io.DataOutputBuffer;
|
import org.apache.hadoop.io.DataOutputBuffer;
|
||||||
import org.apache.hadoop.io.IOUtils;
|
import org.apache.hadoop.io.IOUtils;
|
||||||
import org.apache.hadoop.io.ObjectWritable;
|
import org.apache.hadoop.io.ObjectWritable;
|
||||||
|
@ -484,12 +485,14 @@ public class HBaseClient {
|
||||||
//for serializing the
|
//for serializing the
|
||||||
//data to be written
|
//data to be written
|
||||||
d = new DataOutputBuffer();
|
d = new DataOutputBuffer();
|
||||||
|
d.writeInt(0xdeadbeef); // placeholder for data length
|
||||||
d.writeInt(call.id);
|
d.writeInt(call.id);
|
||||||
call.param.write(d);
|
call.param.write(d);
|
||||||
byte[] data = d.getData();
|
byte[] data = d.getData();
|
||||||
int dataLength = d.getLength();
|
int dataLength = d.getLength();
|
||||||
out.writeInt(dataLength); //first put the data length
|
// fill in the placeholder
|
||||||
out.write(data, 0, dataLength);//write the data
|
Bytes.putInt(data, 0, dataLength - 4);
|
||||||
|
out.write(data, 0, dataLength);
|
||||||
out.flush();
|
out.flush();
|
||||||
}
|
}
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
|
|
Loading…
Reference in New Issue