hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject hbase git commit: HBASE-15005 Use value array in computing block length for 1.2 and 1.3
Date Fri, 18 Dec 2015 08:31:48 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 14dedcc58 -> 71286c109


HBASE-15005 Use value array in computing block length for 1.2 and 1.3


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/71286c10
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/71286c10
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/71286c10

Branch: refs/heads/branch-1.2
Commit: 71286c1096293630309f5aa1456ce269e178ac8a
Parents: 14dedcc
Author: Elliott Clark <eclark@apache.org>
Authored: Thu Dec 17 23:36:43 2015 -0800
Committer: Elliott Clark <eclark@apache.org>
Committed: Fri Dec 18 00:22:32 2015 -0800

----------------------------------------------------------------------
 .../hbase/regionserver/RSRpcServices.java       | 11 +++++------
 .../hbase/client/TestMultiRespectsLimits.java   | 20 +++++++++++++++-----
 2 files changed, 20 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/71286c10/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index 8141156..e4b3acb 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
@@ -1011,17 +1011,16 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
     if (context != null && !r.isEmpty()) {
       for (Cell c : r.rawCells()) {
         context.incrementResponseCellSize(CellUtil.estimatedHeapSizeOf(c));
-
         // We're using the last block being the same as the current block as
         // a proxy for pointing to a new block. This won't be exact.
         // If there are multiple gets that bounce back and forth
         // Then it's possible that this will over count the size of
         // referenced blocks. However it's better to over count and
-        // use two rpcs than to OOME the regionserver.
-        byte[] rowArray = c.getRowArray();
-        if (rowArray != lastBlock) {
-          context.incrementResponseBlockSize(rowArray.length);
-          lastBlock = rowArray;
+        // use two RPC's than to OOME the RegionServer.
+        byte[] valueArray = c.getValueArray();
+        if (valueArray != lastBlock) {
+          context.incrementResponseBlockSize(valueArray.length);
+          lastBlock = valueArray;
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/71286c10/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java
index 1febadf..687da22 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java
@@ -20,9 +20,12 @@ package org.apache.hadoop.hbase.client;
 
 import org.apache.hadoop.hbase.CompatibilityFactory;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.Waiter;
+import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
 import org.apache.hadoop.hbase.ipc.RpcServerInterface;
 import org.apache.hadoop.hbase.metrics.BaseSource;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
@@ -110,7 +113,12 @@ public class TestMultiRespectsLimits {
   @Test
   public void testBlockMultiLimits() throws Exception {
     final TableName name = TableName.valueOf("testBlockMultiLimits");
-    Table t = TEST_UTIL.createTable(name, FAMILY);
+    HTableDescriptor desc = new HTableDescriptor(name);
+    HColumnDescriptor hcd = new HColumnDescriptor(FAMILY);
+    hcd.setDataBlockEncoding(DataBlockEncoding.FAST_DIFF);
+    desc.addFamily(hcd);
+    TEST_UTIL.getHBaseAdmin().createTable(desc);
+    Table t = TEST_UTIL.getConnection().getTable(name);
 
     final HRegionServer regionServer = TEST_UTIL.getHBaseCluster().getRegionServer(0);
     RpcServerInterface rpcServer = regionServer.getRpcServer();
@@ -122,14 +130,16 @@ public class TestMultiRespectsLimits {
     byte[][] cols = new byte[][]{
         Bytes.toBytes("0"), // Get this
         Bytes.toBytes("1"), // Buffer
-        Bytes.toBytes("2"), // Get This
-        Bytes.toBytes("3"), // Buffer
+        Bytes.toBytes("2"), // Buffer
+        Bytes.toBytes("3"), // Get This
+        Bytes.toBytes("4"), // Buffer
+        Bytes.toBytes("5"), // Buffer
     };
 
     // Set the value size so that one result will be less than the MAX_SIE
     // however the block being reference will be larger than MAX_SIZE.
     // This should cause the regionserver to try and send a result immediately.
-    byte[] value = new byte[MAX_SIZE - 200];
+    byte[] value = new byte[MAX_SIZE - 100];
     ThreadLocalRandom.current().nextBytes(value);
 
     for (byte[] col:cols) {
@@ -155,7 +165,7 @@ public class TestMultiRespectsLimits {
     gets.add(g0);
 
     Get g2 = new Get(row);
-    g2.addColumn(FAMILY, cols[2]);
+    g2.addColumn(FAMILY, cols[3]);
     gets.add(g2);
 
     Result[] results = t.get(gets);


Mime
View raw message