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 2018/09/20 13:58:20 UTC

hbase git commit: HBASE-21204 NPE when scan raw DELETE_FAMILY_VERSION and codec is not set

Repository: hbase
Updated Branches:
  refs/heads/master dc767c06d -> cd161d976


HBASE-21204 NPE when scan raw DELETE_FAMILY_VERSION and codec is not set

Signed-off-by: tedyu <yu...@gmail.com>


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

Branch: refs/heads/master
Commit: cd161d976ef47b84e904f2d54bac65d2f3417c2a
Parents: dc767c0
Author: tianjingyun <ti...@gmail.com>
Authored: Thu Sep 20 09:17:52 2018 +0800
Committer: tedyu <yu...@gmail.com>
Committed: Thu Sep 20 06:57:50 2018 -0700

----------------------------------------------------------------------
 .../src/main/protobuf/Cell.proto                |  1 +
 hbase-protocol/src/main/protobuf/Cell.proto     |  1 +
 .../client/TestScannersFromClientSide.java      | 26 ++++++++++++++++++++
 3 files changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/cd161d97/hbase-protocol-shaded/src/main/protobuf/Cell.proto
----------------------------------------------------------------------
diff --git a/hbase-protocol-shaded/src/main/protobuf/Cell.proto b/hbase-protocol-shaded/src/main/protobuf/Cell.proto
index 0e9eb94..aada353 100644
--- a/hbase-protocol-shaded/src/main/protobuf/Cell.proto
+++ b/hbase-protocol-shaded/src/main/protobuf/Cell.proto
@@ -32,6 +32,7 @@ enum CellType {
     PUT = 4;
 
     DELETE = 8;
+    DELETE_FAMILY_VERSION = 10;
     DELETE_COLUMN = 12;
     DELETE_FAMILY = 14;
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/cd161d97/hbase-protocol/src/main/protobuf/Cell.proto
----------------------------------------------------------------------
diff --git a/hbase-protocol/src/main/protobuf/Cell.proto b/hbase-protocol/src/main/protobuf/Cell.proto
index 2c61035..e518e65 100644
--- a/hbase-protocol/src/main/protobuf/Cell.proto
+++ b/hbase-protocol/src/main/protobuf/Cell.proto
@@ -32,6 +32,7 @@ enum CellType {
     PUT = 4;
 
     DELETE = 8;
+    DELETE_FAMILY_VERSION = 10;
     DELETE_COLUMN = 12;
     DELETE_FAMILY = 14;
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/cd161d97/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java
index 6803a2e..5e8d107 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java
@@ -17,6 +17,8 @@
  */
 package org.apache.hadoop.hbase.client;
 
+import static org.apache.hadoop.hbase.HConstants.RPC_CODEC_CONF_KEY;
+import static org.apache.hadoop.hbase.ipc.RpcClient.DEFAULT_CODEC_CLASS;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -608,6 +610,30 @@ public class TestScannersFromClientSide {
        "Testing offset + multiple CFs + maxResults");
   }
 
+  @Test
+  public void testScanRawDeleteFamilyVersion() throws Exception {
+    TableName tableName = TableName.valueOf(name.getMethodName());
+    TEST_UTIL.createTable(tableName, FAMILY);
+    Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
+    conf.set(RPC_CODEC_CONF_KEY, "");
+    conf.set(DEFAULT_CODEC_CLASS, "");
+    try (Connection connection = ConnectionFactory.createConnection(conf);
+        Table table = connection.getTable(tableName)) {
+      Delete delete = new Delete(ROW);
+      delete.addFamilyVersion(FAMILY, 0L);
+      table.delete(delete);
+      Scan scan = new Scan(ROW).setRaw(true);
+      ResultScanner scanner = table.getScanner(scan);
+      int count = 0;
+      while (scanner.next() != null) {
+        count++;
+      }
+      assertEquals(1, count);
+    } finally {
+      TEST_UTIL.deleteTable(tableName);
+    }
+  }
+
   /**
    * Test from client side for scan while the region is reopened
    * on the same region server.