You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2011/08/22 20:45:20 UTC
svn commit: r1160370 - in /hbase/trunk: CHANGES.txt
src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java
Author: tedyu
Date: Mon Aug 22 18:45:20 2011
New Revision: 1160370
URL: http://svn.apache.org/viewvc?rev=1160370&view=rev
Log:
HBASE-4236 Don't lock the stream while serializing the response (Benoit Sigoure)
Modified:
hbase/trunk/CHANGES.txt
hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java
Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1160370&r1=1160369&r2=1160370&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Mon Aug 22 18:45:20 2011
@@ -388,6 +388,7 @@ Release 0.91.0 - Unreleased
HBASE-4229 Replace Jettison JSON encoding with Jackson in HLogPrettyPrinter
(Riley Patterson)
HBASE-4230 Compaction threads need names
+ HBASE-4236 Don't lock the stream while serializing the response (Benoit Sigoure)
TASKS
HBASE-3559 Move report of split to master OFF the heartbeat channel
Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java?rev=1160370&r1=1160369&r2=1160370&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java Mon Aug 22 18:45:20 2011
@@ -514,23 +514,22 @@ public class HBaseClient {
return;
}
- DataOutputBuffer d=null;
+ // For serializing the data to be written.
+
+ final DataOutputBuffer d = new DataOutputBuffer();
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
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.flush();
}