From b11ab1c4cfe21cc3330240d9ded97b0d4c86fe66 Mon Sep 17 00:00:00 2001 From: Toshihiro Suzuki Date: Sat, 23 Mar 2019 15:24:33 +0900 Subject: [PATCH] HBASE-22093 Combine TestRestoreSnapshotFromClientWithRegionReplicas to CloneSnapshotFromClientAfterSplittingRegionTestBase#testCloneSnapshotAfterSplittingRegion Signed-off-by: Duo Zhang --- ...romClientAfterSplittingRegionTestBase.java | 2 + ...eSnapshotFromClientWithRegionReplicas.java | 62 ------------------- 2 files changed, 2 insertions(+), 62 deletions(-) delete mode 100644 hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClientWithRegionReplicas.java diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/CloneSnapshotFromClientAfterSplittingRegionTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/CloneSnapshotFromClientAfterSplittingRegionTestBase.java index d1108c0094e..5ed100f6d29 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/CloneSnapshotFromClientAfterSplittingRegionTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/CloneSnapshotFromClientAfterSplittingRegionTestBase.java @@ -57,6 +57,8 @@ public class CloneSnapshotFromClientAfterSplittingRegionTestBase admin.cloneSnapshot(snapshotName2, clonedTableName); SnapshotTestingUtils.waitForTableToBeOnline(TEST_UTIL, clonedTableName); + verifyRowCount(TEST_UTIL, clonedTableName, snapshot1Rows); + RegionStates regionStates = TEST_UTIL.getHBaseCluster().getMaster().getAssignmentManager().getRegionStates(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClientWithRegionReplicas.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClientWithRegionReplicas.java deleted file mode 100644 index ea47e9d27f2..00000000000 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClientWithRegionReplicas.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * 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.client; - -import java.io.IOException; -import java.util.List; - -import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.TableName; -import org.apache.hadoop.hbase.testclassification.ClientTests; -import org.apache.hadoop.hbase.testclassification.LargeTests; -import org.junit.ClassRule; -import org.junit.Test; -import org.junit.experimental.categories.Category; - -@Category({ LargeTests.class, ClientTests.class }) -public class TestRestoreSnapshotFromClientWithRegionReplicas - extends RestoreSnapshotFromClientTestBase { - - @ClassRule - public static final HBaseClassTestRule CLASS_RULE = - HBaseClassTestRule.forClass(TestRestoreSnapshotFromClientWithRegionReplicas.class); - - @Override - protected int getNumReplicas() { - return 3; - } - - @Test - public void testOnlineSnapshotAfterSplittingRegions() throws IOException, InterruptedException { - List regionInfos = admin.getRegions(tableName); - RegionReplicaUtil.removeNonDefaultRegions(regionInfos); - - // Split a region - splitRegion(regionInfos.get(0)); - - // Take a online snapshot - admin.snapshot(snapshotName1, tableName); - - // Clone the snapshot to another table - TableName clonedTableName = - TableName.valueOf(name.getMethodName() + "-" + System.currentTimeMillis()); - admin.cloneSnapshot(snapshotName1, clonedTableName); - - verifyRowCount(TEST_UTIL, clonedTableName, snapshot1Rows); - } -}