You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by vj...@apache.org on 2020/10/01 08:04:04 UTC
[hbase] branch master updated: HBASE-24981 Enable table replication
fails from 1.x to 2.x if table already exist at peer
This is an automated email from the ASF dual-hosted git repository.
vjasani pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new e9de7d9 HBASE-24981 Enable table replication fails from 1.x to 2.x if table already exist at peer
e9de7d9 is described below
commit e9de7d9e7e03cc0c46ecb17eaee5b80a9fa7e2ef
Author: Sanjeet Nishad <sa...@gmail.com>
AuthorDate: Thu Oct 1 13:24:31 2020 +0530
HBASE-24981 Enable table replication fails from 1.x to 2.x if table already exist at peer
Closes #2353
Signed-off-by: stack <st...@apache.org>
Signed-off-by: Viraj Jasani <vj...@apache.org>
Signed-off-by: Pankaj Kumar <pa...@apache.org>
---
.../client/ColumnFamilyDescriptorBuilder.java | 5 ----
.../client/TestColumnFamilyDescriptorBuilder.java | 31 ++++++++++++++++++++++
2 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java
index 3889d32..9a47cb5 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java
@@ -294,11 +294,6 @@ public class ColumnFamilyDescriptorBuilder {
DEFAULT_VALUES.put(BLOCKCACHE, String.valueOf(DEFAULT_BLOCKCACHE));
DEFAULT_VALUES.put(KEEP_DELETED_CELLS, String.valueOf(DEFAULT_KEEP_DELETED));
DEFAULT_VALUES.put(DATA_BLOCK_ENCODING, String.valueOf(DEFAULT_DATA_BLOCK_ENCODING));
- DEFAULT_VALUES.put(CACHE_DATA_ON_WRITE, String.valueOf(DEFAULT_CACHE_DATA_ON_WRITE));
- DEFAULT_VALUES.put(CACHE_INDEX_ON_WRITE, String.valueOf(DEFAULT_CACHE_INDEX_ON_WRITE));
- DEFAULT_VALUES.put(CACHE_BLOOMS_ON_WRITE, String.valueOf(DEFAULT_CACHE_BLOOMS_ON_WRITE));
- DEFAULT_VALUES.put(EVICT_BLOCKS_ON_CLOSE, String.valueOf(DEFAULT_EVICT_BLOCKS_ON_CLOSE));
- DEFAULT_VALUES.put(PREFETCH_BLOCKS_ON_OPEN, String.valueOf(DEFAULT_PREFETCH_BLOCKS_ON_OPEN));
// Do NOT add this key/value by default. NEW_VERSION_BEHAVIOR is NOT defined in hbase1 so
// it is not possible to make an hbase1 HCD the same as an hbase2 HCD and so the replication
// compare of schemas will fail. It is OK not adding the below to the initial map because of
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestColumnFamilyDescriptorBuilder.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestColumnFamilyDescriptorBuilder.java
index d6ea1b3..557d2f8 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestColumnFamilyDescriptorBuilder.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestColumnFamilyDescriptorBuilder.java
@@ -39,6 +39,7 @@ import org.junit.Assert;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import java.util.Map;
@Category({ MiscTests.class, SmallTests.class })
public class TestColumnFamilyDescriptorBuilder {
@@ -181,4 +182,34 @@ public class TestColumnFamilyDescriptorBuilder {
builder.setTimeToLive(ttl);
Assert.assertEquals(43282800, builder.build().getTimeToLive());
}
+
+ /**
+ * Test for verifying the ColumnFamilyDescriptorBuilder's default values so that backward
+ * compatibility with hbase-1.x can be mantained (see HBASE-24981).
+ */
+ @Test
+ public void testDefaultBuilder() {
+ final Map<String, String> defaultValueMap = ColumnFamilyDescriptorBuilder.getDefaultValues();
+ assertEquals(defaultValueMap.size(), 11);
+ assertEquals(defaultValueMap.get(ColumnFamilyDescriptorBuilder.BLOOMFILTER),
+ BloomType.ROW.toString());
+ assertEquals(defaultValueMap.get(ColumnFamilyDescriptorBuilder.REPLICATION_SCOPE), "0");
+ assertEquals(defaultValueMap.get(ColumnFamilyDescriptorBuilder.MAX_VERSIONS), "1");
+ assertEquals(defaultValueMap.get(ColumnFamilyDescriptorBuilder.MIN_VERSIONS), "0");
+ assertEquals(defaultValueMap.get(ColumnFamilyDescriptorBuilder.COMPRESSION),
+ Compression.Algorithm.NONE.toString());
+ assertEquals(defaultValueMap.get(ColumnFamilyDescriptorBuilder.TTL),
+ Integer.toString(Integer.MAX_VALUE));
+ assertEquals(defaultValueMap.get(ColumnFamilyDescriptorBuilder.BLOCKSIZE),
+ Integer.toString(64 * 1024));
+ assertEquals(defaultValueMap.get(ColumnFamilyDescriptorBuilder.IN_MEMORY),
+ Boolean.toString(false));
+ assertEquals(defaultValueMap.get(ColumnFamilyDescriptorBuilder.BLOCKCACHE),
+ Boolean.toString(true));
+ assertEquals(defaultValueMap.get(ColumnFamilyDescriptorBuilder.KEEP_DELETED_CELLS),
+ KeepDeletedCells.FALSE.toString());
+ assertEquals(defaultValueMap.get(ColumnFamilyDescriptorBuilder.DATA_BLOCK_ENCODING),
+ DataBlockEncoding.NONE.toString());
+
+ }
}