hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r1469654 - in /hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc: HBaseClient.java IPCUtil.java
Date Fri, 19 Apr 2013 01:15:29 GMT
Author: ddas
Date: Fri Apr 19 01:15:28 2013
New Revision: 1469654

URL: http://svn.apache.org/r1469654
Log:
HBASE-7239. Introduces chunked reading for large cellblocks

Modified:
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java?rev=1469654&r1=1469653&r2=1469654&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java (original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java Fri
Apr 19 01:15:28 2013
@@ -1026,7 +1026,7 @@ public class HBaseClient {
           if (responseHeader.hasCellBlockMeta()) {
             int size = responseHeader.getCellBlockMeta().getLength();
             byte [] cellBlock = new byte[size];
-            IOUtils.readFully(this.in, cellBlock, 0, cellBlock.length);
+            IPCUtil.readChunked(this.in, cellBlock, 0, size);
             cellBlockScanner = ipcUtil.createCellScanner(this.codec, this.compressor, cellBlock);
           }
           // it's possible that this call may have been cleaned up due to a RPC

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java?rev=1469654&r1=1469653&r2=1469654&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java (original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java Fri Apr
19 01:15:28 2013
@@ -18,6 +18,7 @@
 package org.apache.hadoop.hbase.ipc;
 
 import java.io.ByteArrayInputStream;
+import java.io.DataInput;
 import java.io.DataInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -231,6 +232,23 @@ class IPCUtil {
   }
 
   /**
+   * Read in chunks of 8K (HBASE-7239)
+   * @param in
+   * @param dest
+   * @param offset
+   * @param len
+   * @throws IOException
+   */
+  static void readChunked(final DataInput in, byte[] dest, int offset, int len)
+      throws IOException {
+    int maxRead = 8192;
+
+    for (; offset < len; offset += maxRead) {
+      in.readFully(dest, offset, Math.min(len - offset, maxRead));
+    }
+  }
+
+  /**
    * @param header
    * @param body
    * @return Size on the wire when the two messages are written with writeDelimitedTo



Mime
View raw message