You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ac...@apache.org on 2020/06/24 17:21:55 UTC
[hbase] branch branch-1 updated: HBASE-24618 Backport HBASE-21204
to branch-1
This is an automated email from the ASF dual-hosted git repository.
achouhan pushed a commit to branch branch-1
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-1 by this push:
new 54c38c8 HBASE-24618 Backport HBASE-21204 to branch-1
54c38c8 is described below
commit 54c38c840c25fd1388884cb8699c4954f0e506bd
Author: Abhishek Singh Chouhan <ac...@apache.org>
AuthorDate: Tue Jun 23 17:43:42 2020 -0700
HBASE-24618 Backport HBASE-21204 to branch-1
---
.../hbase/protobuf/generated/CellProtos.java | 24 ++++++++++++++------
hbase-protocol/src/main/protobuf/Cell.proto | 1 +
.../hbase/client/TestScannersFromClientSide.java | 26 ++++++++++++++++++++++
3 files changed, 44 insertions(+), 7 deletions(-)
diff --git a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/CellProtos.java b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/CellProtos.java
index 7fc4706..9c0ac9b 100644
--- a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/CellProtos.java
+++ b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/CellProtos.java
@@ -31,13 +31,17 @@ public final class CellProtos {
*/
DELETE(2, 8),
/**
+ * <code>DELETE_FAMILY_VERSION = 10;</code>
+ */
+ DELETE_FAMILY_VERSION(3, 10),
+ /**
* <code>DELETE_COLUMN = 12;</code>
*/
- DELETE_COLUMN(3, 12),
+ DELETE_COLUMN(4, 12),
/**
* <code>DELETE_FAMILY = 14;</code>
*/
- DELETE_FAMILY(4, 14),
+ DELETE_FAMILY(5, 14),
/**
* <code>MAXIMUM = 255;</code>
*
@@ -45,7 +49,7 @@ public final class CellProtos {
* MAXIMUM is used when searching; you look from maximum on down.
* </pre>
*/
- MAXIMUM(5, 255),
+ MAXIMUM(6, 255),
;
/**
@@ -61,6 +65,10 @@ public final class CellProtos {
*/
public static final int DELETE_VALUE = 8;
/**
+ * <code>DELETE_FAMILY_VERSION = 10;</code>
+ */
+ public static final int DELETE_FAMILY_VERSION_VALUE = 10;
+ /**
* <code>DELETE_COLUMN = 12;</code>
*/
public static final int DELETE_COLUMN_VALUE = 12;
@@ -85,6 +93,7 @@ public final class CellProtos {
case 0: return MINIMUM;
case 4: return PUT;
case 8: return DELETE;
+ case 10: return DELETE_FAMILY_VERSION;
case 12: return DELETE_COLUMN;
case 14: return DELETE_FAMILY;
case 255: return MAXIMUM;
@@ -2207,11 +2216,12 @@ public final class CellProtos {
"\030\007 \001(\014\"\220\001\n\010KeyValue\022\013\n\003row\030\001 \002(\014\022\016\n\006fami" +
"ly\030\002 \002(\014\022\021\n\tqualifier\030\003 \002(\014\022\021\n\ttimestamp" +
"\030\004 \001(\004\022$\n\010key_type\030\005 \001(\0162\022.hbase.pb.Cell" +
- "Type\022\r\n\005value\030\006 \001(\014\022\014\n\004tags\030\007 \001(\014*`\n\010Cel" +
+ "Type\022\r\n\005value\030\006 \001(\014\022\014\n\004tags\030\007 \001(\014*{\n\010Cel" +
"lType\022\013\n\007MINIMUM\020\000\022\007\n\003PUT\020\004\022\n\n\006DELETE\020\010\022" +
- "\021\n\rDELETE_COLUMN\020\014\022\021\n\rDELETE_FAMILY\020\016\022\014\n",
- "\007MAXIMUM\020\377\001B=\n*org.apache.hadoop.hbase.p" +
- "rotobuf.generatedB\nCellProtosH\001\240\001\001"
+ "\031\n\025DELETE_FAMILY_VERSION\020\n\022\021\n\rDELETE_COL",
+ "UMN\020\014\022\021\n\rDELETE_FAMILY\020\016\022\014\n\007MAXIMUM\020\377\001B=" +
+ "\n*org.apache.hadoop.hbase.protobuf.gener" +
+ "atedB\nCellProtosH\001\240\001\001"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
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;
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 7c23f0a..2558be2 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
@@ -16,6 +16,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.assertNotNull;
@@ -575,6 +577,30 @@ public class TestScannersFromClientSide {
"Testing offset + multiple CFs + maxResults");
}
+ @Test
+ public void testScanRawDeleteFamilyVersion() throws Exception {
+ TableName tableName = TableName.valueOf("testScanRawDeleteFamilyVersion");
+ 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().withStartRow(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.