HBASE-4236 Don't lock the stream while serializing the response (Benoit Sigoure)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1160370 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
58dfa28fef
commit
8cc16ab55f
|
@ -388,6 +388,7 @@ Release 0.91.0 - Unreleased
|
||||||
HBASE-4229 Replace Jettison JSON encoding with Jackson in HLogPrettyPrinter
|
HBASE-4229 Replace Jettison JSON encoding with Jackson in HLogPrettyPrinter
|
||||||
(Riley Patterson)
|
(Riley Patterson)
|
||||||
HBASE-4230 Compaction threads need names
|
HBASE-4230 Compaction threads need names
|
||||||
|
HBASE-4236 Don't lock the stream while serializing the response (Benoit Sigoure)
|
||||||
|
|
||||||
TASKS
|
TASKS
|
||||||
HBASE-3559 Move report of split to master OFF the heartbeat channel
|
HBASE-3559 Move report of split to master OFF the heartbeat channel
|
||||||
|
|
|
@ -514,23 +514,22 @@ public class HBaseClient {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataOutputBuffer d=null;
|
// For serializing the data to be written.
|
||||||
|
|
||||||
|
final DataOutputBuffer d = new DataOutputBuffer();
|
||||||
try {
|
try {
|
||||||
|
if (LOG.isDebugEnabled())
|
||||||
|
LOG.debug(getName() + " sending #" + call.id);
|
||||||
|
|
||||||
|
d.writeInt(0xdeadbeef); // placeholder for data length
|
||||||
|
d.writeInt(call.id);
|
||||||
|
call.param.write(d);
|
||||||
|
byte[] data = d.getData();
|
||||||
|
int dataLength = d.getLength();
|
||||||
|
// fill in the placeholder
|
||||||
|
Bytes.putInt(data, 0, dataLength - 4);
|
||||||
//noinspection SynchronizeOnNonFinalField
|
//noinspection SynchronizeOnNonFinalField
|
||||||
synchronized (this.out) { // FindBugs IS2_INCONSISTENT_SYNC
|
synchronized (this.out) { // FindBugs IS2_INCONSISTENT_SYNC
|
||||||
if (LOG.isDebugEnabled())
|
|
||||||
LOG.debug(getName() + " sending #" + call.id);
|
|
||||||
|
|
||||||
//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();
|
|
||||||
// fill in the placeholder
|
|
||||||
Bytes.putInt(data, 0, dataLength - 4);
|
|
||||||
out.write(data, 0, dataLength);
|
out.write(data, 0, dataLength);
|
||||||
out.flush();
|
out.flush();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue