You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ra...@apache.org on 2012/01/14 16:15:56 UTC

svn commit: r1231511 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java

Author: ramkrishna
Date: Sat Jan 14 15:15:56 2012
New Revision: 1231511

URL: http://svn.apache.org/viewvc?rev=1231511&view=rev
Log:
HBASE-5192 Backport HBASE-4236 Don't lock the stream while serializing the response (Ram)

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

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1231511&r1=1231510&r2=1231511&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Sat Jan 14 15:15:56 2012
@@ -24,6 +24,7 @@ Release 0.90.6 - Unreleased
    HBASE-5160  Backport HBASE-4397 - -ROOT-, .META. tables stay offline for too long in 
                recovery phase after all RSs are shutdown at the same time (Ram)
    HBASE-5160  Addendum adding the removed method in AssignmentManager (Ram)
+   HBASE-5192  Backport HBASE-4236 Don't lock the stream while serializing the response (Ram)
 
   IMPROVEMENT
    HBASE-5102  Change the default value of the property "hbase.connection.per.config" to false in

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java?rev=1231511&r1=1231510&r2=1231511&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java Sat Jan 14 15:15:56 2012
@@ -499,28 +499,28 @@ public class HBaseClient {
 
       DataOutputBuffer d=null;
       try {
-        //noinspection SynchronizeOnNonFinalField
-        synchronized (this.out) { // FindBugs IS2_INCONSISTENT_SYNC
-          if (LOG.isDebugEnabled())
-            LOG.debug(getName() + " sending #" + call.id);
+        // noinspection SynchronizeOnNonFinalField
+        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);
+        // 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);
+        synchronized (this.out) { // FindBugs IS2_INCONSISTENT_SYNC
           out.write(data, 0, dataLength);
           out.flush();
         }
-      } catch(IOException e) {
+      } catch (IOException e) {
         markClosed(e);
       } finally {
-        //the buffer is just an in-memory buffer, but it is still polite to
+        // the buffer is just an in-memory buffer, but it is still polite to
         // close early
         IOUtils.closeStream(d);
       }