[18/20] hbase git commit: HBASE-20227 Add UT for ReplicationUtils.contains method
HBASE-20227 Add UT for ReplicationUtils.contains method Signed-off-by: zhangduoProject: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3b015d60 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3b015d60 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3b015d60 Branch: refs/heads/branch-2 Commit: 3b015d60a48927363cf1510f0f6dbea7b3abee18 Parents: 6f13b28 Author: tianjingyun Authored: Sat Mar 24 18:57:48 2018 +0800 Committer: zhangduo Committed: Mon Apr 9 15:18:44 2018 +0800 -- .../hbase/replication/ReplicationUtils.java | 2 +- .../hbase/replication/TestReplicationUtil.java | 235 +++ 2 files changed, 236 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/3b015d60/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java -- diff --git a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java index 1c42de4..c7568bb 100644 --- a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java +++ b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java @@ -145,7 +145,7 @@ public final class ReplicationUtils { if (excludeNamespaces != null && excludeNamespaces.contains(namespace)) { return false; } - Map excludedTableCFs = peerConfig.getTableCFsMap(); + Map excludedTableCFs = peerConfig.getExcludeTableCFsMap(); // trap here, must check existence first since HashMap allows null value. if (excludedTableCFs == null || !excludedTableCFs.containsKey(tableName)) { return true; http://git-wip-us.apache.org/repos/asf/hbase/blob/3b015d60/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java -- diff --git a/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java new file mode 100644 index 000..f8543fe --- /dev/null +++ b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java @@ -0,0 +1,235 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.replication; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.hadoop.hbase.HBaseClassTestRule; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.testclassification.ReplicationTests; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.junit.Assert; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +@Category({ ReplicationTests.class, SmallTests.class }) +public class TestReplicationUtil { + + @ClassRule + public static final HBaseClassTestRule CLASS_RULE = +HBaseClassTestRule.forClass(TestReplicationUtil.class); + + private static TableName TABLE_A = TableName.valueOf("replication", "testA"); + private static TableName TABLE_B = TableName.valueOf("replication", "testB"); + + @Test + public void testContainsWithReplicatingAll() { +ReplicationPeerConfig peerConfig; +ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl builder = + new ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl(); +Map tableCfs = new HashMap<>(); +Set namespaces = new HashSet<>(); + +// 1. replication_all flag is true, no namespaces and table-cfs config +builder.setReplicateAllUserTables(true); +peerConfig = builder.build(); +
[15/22] hbase git commit: HBASE-20227 Add UT for ReplicationUtils.contains method
HBASE-20227 Add UT for ReplicationUtils.contains method Signed-off-by: zhangduoProject: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3b015d60 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3b015d60 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3b015d60 Branch: refs/heads/HBASE-20046-branch-2 Commit: 3b015d60a48927363cf1510f0f6dbea7b3abee18 Parents: 6f13b28 Author: tianjingyun Authored: Sat Mar 24 18:57:48 2018 +0800 Committer: zhangduo Committed: Mon Apr 9 15:18:44 2018 +0800 -- .../hbase/replication/ReplicationUtils.java | 2 +- .../hbase/replication/TestReplicationUtil.java | 235 +++ 2 files changed, 236 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/3b015d60/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java -- diff --git a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java index 1c42de4..c7568bb 100644 --- a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java +++ b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java @@ -145,7 +145,7 @@ public final class ReplicationUtils { if (excludeNamespaces != null && excludeNamespaces.contains(namespace)) { return false; } - Map excludedTableCFs = peerConfig.getTableCFsMap(); + Map excludedTableCFs = peerConfig.getExcludeTableCFsMap(); // trap here, must check existence first since HashMap allows null value. if (excludedTableCFs == null || !excludedTableCFs.containsKey(tableName)) { return true; http://git-wip-us.apache.org/repos/asf/hbase/blob/3b015d60/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java -- diff --git a/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java new file mode 100644 index 000..f8543fe --- /dev/null +++ b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java @@ -0,0 +1,235 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.replication; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.hadoop.hbase.HBaseClassTestRule; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.testclassification.ReplicationTests; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.junit.Assert; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +@Category({ ReplicationTests.class, SmallTests.class }) +public class TestReplicationUtil { + + @ClassRule + public static final HBaseClassTestRule CLASS_RULE = +HBaseClassTestRule.forClass(TestReplicationUtil.class); + + private static TableName TABLE_A = TableName.valueOf("replication", "testA"); + private static TableName TABLE_B = TableName.valueOf("replication", "testB"); + + @Test + public void testContainsWithReplicatingAll() { +ReplicationPeerConfig peerConfig; +ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl builder = + new ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl(); +Map tableCfs = new HashMap<>(); +Set namespaces = new HashSet<>(); + +// 1. replication_all flag is true, no namespaces and table-cfs config +builder.setReplicateAllUserTables(true); +peerConfig = builder.build(); +
[16/20] hbase git commit: HBASE-20227 Add UT for ReplicationUtils.contains method
HBASE-20227 Add UT for ReplicationUtils.contains method Signed-off-by: zhangduoProject: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/daa5e0b9 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/daa5e0b9 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/daa5e0b9 Branch: refs/heads/HBASE-20046-branch-2 Commit: daa5e0b98de57f49be8f162e48562f01ae89d923 Parents: 5510389 Author: tianjingyun Authored: Sat Mar 24 18:57:48 2018 +0800 Committer: zhangduo Committed: Sun Apr 8 11:21:52 2018 +0800 -- .../hbase/replication/ReplicationUtils.java | 2 +- .../hbase/replication/TestReplicationUtil.java | 235 +++ 2 files changed, 236 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/daa5e0b9/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java -- diff --git a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java index 1c42de4..c7568bb 100644 --- a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java +++ b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java @@ -145,7 +145,7 @@ public final class ReplicationUtils { if (excludeNamespaces != null && excludeNamespaces.contains(namespace)) { return false; } - Map excludedTableCFs = peerConfig.getTableCFsMap(); + Map excludedTableCFs = peerConfig.getExcludeTableCFsMap(); // trap here, must check existence first since HashMap allows null value. if (excludedTableCFs == null || !excludedTableCFs.containsKey(tableName)) { return true; http://git-wip-us.apache.org/repos/asf/hbase/blob/daa5e0b9/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java -- diff --git a/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java new file mode 100644 index 000..f8543fe --- /dev/null +++ b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java @@ -0,0 +1,235 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.replication; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.hadoop.hbase.HBaseClassTestRule; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.testclassification.ReplicationTests; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.junit.Assert; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +@Category({ ReplicationTests.class, SmallTests.class }) +public class TestReplicationUtil { + + @ClassRule + public static final HBaseClassTestRule CLASS_RULE = +HBaseClassTestRule.forClass(TestReplicationUtil.class); + + private static TableName TABLE_A = TableName.valueOf("replication", "testA"); + private static TableName TABLE_B = TableName.valueOf("replication", "testB"); + + @Test + public void testContainsWithReplicatingAll() { +ReplicationPeerConfig peerConfig; +ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl builder = + new ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl(); +Map tableCfs = new HashMap<>(); +Set namespaces = new HashSet<>(); + +// 1. replication_all flag is true, no namespaces and table-cfs config +builder.setReplicateAllUserTables(true); +peerConfig = builder.build(); +
[17/50] [abbrv] hbase git commit: HBASE-20227 Add UT for ReplicationUtils.contains method
HBASE-20227 Add UT for ReplicationUtils.contains method Signed-off-by: zhangduoProject: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/e468b402 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/e468b402 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/e468b402 Branch: refs/heads/HBASE-19064 Commit: e468b4022f76688851b3e0c34722f01a56bd624f Parents: b50b2e5 Author: tianjingyun Authored: Sat Mar 24 18:57:48 2018 +0800 Committer: zhangduo Committed: Sat Mar 24 22:12:52 2018 +0800 -- .../hbase/replication/ReplicationUtils.java | 2 +- .../hbase/replication/TestReplicationUtil.java | 235 +++ 2 files changed, 236 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/e468b402/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java -- diff --git a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java index 1c42de4..c7568bb 100644 --- a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java +++ b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java @@ -145,7 +145,7 @@ public final class ReplicationUtils { if (excludeNamespaces != null && excludeNamespaces.contains(namespace)) { return false; } - Map excludedTableCFs = peerConfig.getTableCFsMap(); + Map excludedTableCFs = peerConfig.getExcludeTableCFsMap(); // trap here, must check existence first since HashMap allows null value. if (excludedTableCFs == null || !excludedTableCFs.containsKey(tableName)) { return true; http://git-wip-us.apache.org/repos/asf/hbase/blob/e468b402/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java -- diff --git a/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java new file mode 100644 index 000..f8543fe --- /dev/null +++ b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java @@ -0,0 +1,235 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.replication; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.hadoop.hbase.HBaseClassTestRule; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.testclassification.ReplicationTests; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.junit.Assert; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +@Category({ ReplicationTests.class, SmallTests.class }) +public class TestReplicationUtil { + + @ClassRule + public static final HBaseClassTestRule CLASS_RULE = +HBaseClassTestRule.forClass(TestReplicationUtil.class); + + private static TableName TABLE_A = TableName.valueOf("replication", "testA"); + private static TableName TABLE_B = TableName.valueOf("replication", "testB"); + + @Test + public void testContainsWithReplicatingAll() { +ReplicationPeerConfig peerConfig; +ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl builder = + new ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl(); +Map tableCfs = new HashMap<>(); +Set namespaces = new HashSet<>(); + +// 1. replication_all flag is true, no namespaces and table-cfs config +builder.setReplicateAllUserTables(true); +peerConfig = builder.build(); +
hbase git commit: HBASE-20227 Add UT for ReplicationUtils.contains method
Repository: hbase Updated Branches: refs/heads/master b50b2e51b -> e468b4022 HBASE-20227 Add UT for ReplicationUtils.contains method Signed-off-by: zhangduoProject: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/e468b402 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/e468b402 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/e468b402 Branch: refs/heads/master Commit: e468b4022f76688851b3e0c34722f01a56bd624f Parents: b50b2e5 Author: tianjingyun Authored: Sat Mar 24 18:57:48 2018 +0800 Committer: zhangduo Committed: Sat Mar 24 22:12:52 2018 +0800 -- .../hbase/replication/ReplicationUtils.java | 2 +- .../hbase/replication/TestReplicationUtil.java | 235 +++ 2 files changed, 236 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/e468b402/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java -- diff --git a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java index 1c42de4..c7568bb 100644 --- a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java +++ b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java @@ -145,7 +145,7 @@ public final class ReplicationUtils { if (excludeNamespaces != null && excludeNamespaces.contains(namespace)) { return false; } - Map excludedTableCFs = peerConfig.getTableCFsMap(); + Map excludedTableCFs = peerConfig.getExcludeTableCFsMap(); // trap here, must check existence first since HashMap allows null value. if (excludedTableCFs == null || !excludedTableCFs.containsKey(tableName)) { return true; http://git-wip-us.apache.org/repos/asf/hbase/blob/e468b402/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java -- diff --git a/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java new file mode 100644 index 000..f8543fe --- /dev/null +++ b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationUtil.java @@ -0,0 +1,235 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.replication; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.hadoop.hbase.HBaseClassTestRule; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.testclassification.ReplicationTests; +import org.apache.hadoop.hbase.testclassification.SmallTests; +import org.junit.Assert; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +@Category({ ReplicationTests.class, SmallTests.class }) +public class TestReplicationUtil { + + @ClassRule + public static final HBaseClassTestRule CLASS_RULE = +HBaseClassTestRule.forClass(TestReplicationUtil.class); + + private static TableName TABLE_A = TableName.valueOf("replication", "testA"); + private static TableName TABLE_B = TableName.valueOf("replication", "testB"); + + @Test + public void testContainsWithReplicatingAll() { +ReplicationPeerConfig peerConfig; +ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl builder = + new ReplicationPeerConfig.ReplicationPeerConfigBuilderImpl(); +Map tableCfs = new HashMap<>(); +Set namespaces = new HashSet<>(); + +// 1. replication_all flag is true, no namespaces and table-cfs config +