hbase git commit: HBASE-21311 Split TestRestoreSnapshotFromClient

2018-10-16 Thread zhangduo
Repository: hbase
Updated Branches:
  refs/heads/branch-2.0 30d05e022 -> a586debe1


HBASE-21311 Split TestRestoreSnapshotFromClient


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

Branch: refs/heads/branch-2.0
Commit: a586debe1c854e6249a4b4a2573302f29996a39c
Parents: 30d05e0
Author: zhangduo 
Authored: Mon Oct 15 21:28:34 2018 +0800
Committer: Duo Zhang 
Committed: Wed Oct 17 11:29:00 2018 +0800

--
 ...FromClientAfterSplittingRegionsTestBase.java |  53 +++
 ...SnapshotFromClientAfterTruncateTestBase.java |  48 +++
 .../RestoreSnapshotFromClientCloneTestBase.java |  65 
 ...hotFromClientGetCompactionStateTestBase.java |  44 +++
 ...eSnapshotFromClientSchemaChangeTestBase.java | 105 ++
 ...RestoreSnapshotFromClientSimpleTestBase.java |  80 +
 .../RestoreSnapshotFromClientTestBase.java  | 150 
 .../TestMobRestoreSnapshotFromClient.java   |  78 -
 ...SnapshotFromClientAfterSplittingRegions.java |  67 
 ...bRestoreSnapshotFromClientAfterTruncate.java |  67 
 .../TestMobRestoreSnapshotFromClientClone.java  |  66 
 ...oreSnapshotFromClientGetCompactionState.java |  67 
 ...obRestoreSnapshotFromClientSchemaChange.java |  73 
 .../TestMobRestoreSnapshotFromClientSimple.java |  67 
 .../client/TestRestoreSnapshotFromClient.java   | 350 ---
 ...SnapshotFromClientAfterSplittingRegions.java |  53 +++
 ...tRestoreSnapshotFromClientAfterTruncate.java |  53 +++
 .../TestRestoreSnapshotFromClientClone.java |  52 +++
 ...oreSnapshotFromClientGetCompactionState.java |  53 +++
 ...stRestoreSnapshotFromClientSchemaChange.java |  53 +++
 .../TestRestoreSnapshotFromClientSimple.java|  52 +++
 ...oreSnapshotFromClientWithRegionReplicas.java |  16 +-
 22 files changed, 1274 insertions(+), 438 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/a586debe/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
new file mode 100644
index 000..51fbb82
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
@@ -0,0 +1,53 @@
+/**
+ * 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.snapshot.SnapshotTestingUtils;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.junit.Test;
+
+public class RestoreSnapshotFromClientAfterSplittingRegionsTestBase
+extends RestoreSnapshotFromClientTestBase {
+
+  @Test
+  public void testRestoreSnapshotAfterSplittingRegions() throws IOException, 
InterruptedException {
+List regionInfos = admin.getRegions(tableName);
+RegionReplicaUtil.removeNonDefaultRegions(regionInfos);
+
+// Split the first region
+splitRegion(regionInfos.get(0));
+
+// Take a snapshot
+admin.snapshot(snapshotName1, tableName);
+
+// Load more data
+SnapshotTestingUtils.loadData(TEST_UTIL, tableName, 500, FAMILY);
+
+// Split the second region
+splitRegion(regionInfos.get(1));
+
+// Restore the snapshot
+admin.disableTable(tableName);
+admin.restoreSnapshot(snapshotName1);
+admin.enableTable(tableName);
+
+verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);
+  }
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/a586debe/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterTruncateTestBase.java
--

hbase git commit: HBASE-21311 Split TestRestoreSnapshotFromClient

2018-10-16 Thread zhangduo
Repository: hbase
Updated Branches:
  refs/heads/branch-2.1 dd836aae1 -> b0846fb76


HBASE-21311 Split TestRestoreSnapshotFromClient


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

Branch: refs/heads/branch-2.1
Commit: b0846fb7629a198298782522a97e3015132cb46e
Parents: dd836aa
Author: zhangduo 
Authored: Mon Oct 15 21:28:34 2018 +0800
Committer: Duo Zhang 
Committed: Wed Oct 17 11:19:10 2018 +0800

--
 ...FromClientAfterSplittingRegionsTestBase.java |  53 +++
 ...SnapshotFromClientAfterTruncateTestBase.java |  48 +++
 .../RestoreSnapshotFromClientCloneTestBase.java |  65 
 ...hotFromClientGetCompactionStateTestBase.java |  44 +++
 ...eSnapshotFromClientSchemaChangeTestBase.java | 105 ++
 ...RestoreSnapshotFromClientSimpleTestBase.java |  80 +
 .../RestoreSnapshotFromClientTestBase.java  | 150 
 .../TestMobRestoreSnapshotFromClient.java   |  78 -
 ...SnapshotFromClientAfterSplittingRegions.java |  67 
 ...bRestoreSnapshotFromClientAfterTruncate.java |  67 
 .../TestMobRestoreSnapshotFromClientClone.java  |  66 
 ...oreSnapshotFromClientGetCompactionState.java |  67 
 ...obRestoreSnapshotFromClientSchemaChange.java |  73 
 .../TestMobRestoreSnapshotFromClientSimple.java |  67 
 .../client/TestRestoreSnapshotFromClient.java   | 350 ---
 ...SnapshotFromClientAfterSplittingRegions.java |  53 +++
 ...tRestoreSnapshotFromClientAfterTruncate.java |  53 +++
 .../TestRestoreSnapshotFromClientClone.java |  52 +++
 ...oreSnapshotFromClientGetCompactionState.java |  53 +++
 ...stRestoreSnapshotFromClientSchemaChange.java |  53 +++
 .../TestRestoreSnapshotFromClientSimple.java|  52 +++
 ...oreSnapshotFromClientWithRegionReplicas.java |  13 +-
 22 files changed, 1274 insertions(+), 435 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/b0846fb7/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
new file mode 100644
index 000..51fbb82
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
@@ -0,0 +1,53 @@
+/**
+ * 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.snapshot.SnapshotTestingUtils;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.junit.Test;
+
+public class RestoreSnapshotFromClientAfterSplittingRegionsTestBase
+extends RestoreSnapshotFromClientTestBase {
+
+  @Test
+  public void testRestoreSnapshotAfterSplittingRegions() throws IOException, 
InterruptedException {
+List regionInfos = admin.getRegions(tableName);
+RegionReplicaUtil.removeNonDefaultRegions(regionInfos);
+
+// Split the first region
+splitRegion(regionInfos.get(0));
+
+// Take a snapshot
+admin.snapshot(snapshotName1, tableName);
+
+// Load more data
+SnapshotTestingUtils.loadData(TEST_UTIL, tableName, 500, FAMILY);
+
+// Split the second region
+splitRegion(regionInfos.get(1));
+
+// Restore the snapshot
+admin.disableTable(tableName);
+admin.restoreSnapshot(snapshotName1);
+admin.enableTable(tableName);
+
+verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);
+  }
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/b0846fb7/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterTruncateTestBase.java
--

hbase git commit: HBASE-21311 Split TestRestoreSnapshotFromClient

2018-10-16 Thread zhangduo
Repository: hbase
Updated Branches:
  refs/heads/branch-2 6511dae07 -> 1a0e1039a


HBASE-21311 Split TestRestoreSnapshotFromClient


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

Branch: refs/heads/branch-2
Commit: 1a0e1039a2e20e7846f559df64dc9c1d216e88e8
Parents: 6511dae
Author: zhangduo 
Authored: Mon Oct 15 21:28:34 2018 +0800
Committer: Duo Zhang 
Committed: Wed Oct 17 11:18:34 2018 +0800

--
 ...FromClientAfterSplittingRegionsTestBase.java |  53 +++
 ...SnapshotFromClientAfterTruncateTestBase.java |  48 +++
 .../RestoreSnapshotFromClientCloneTestBase.java |  65 +++
 ...hotFromClientGetCompactionStateTestBase.java |  44 +++
 ...eSnapshotFromClientSchemaChangeTestBase.java | 105 +
 ...RestoreSnapshotFromClientSimpleTestBase.java |  80 
 .../RestoreSnapshotFromClientTestBase.java  | 150 +++
 .../TestMobRestoreSnapshotFromClient.java   |  78 
 ...SnapshotFromClientAfterSplittingRegions.java |  67 
 ...bRestoreSnapshotFromClientAfterTruncate.java |  67 
 .../TestMobRestoreSnapshotFromClientClone.java  |  66 
 ...oreSnapshotFromClientGetCompactionState.java |  67 
 ...obRestoreSnapshotFromClientSchemaChange.java |  73 
 .../TestMobRestoreSnapshotFromClientSimple.java |  67 
 .../client/TestRestoreSnapshotFromClient.java   | 396 ---
 ...SnapshotFromClientAfterSplittingRegions.java |  53 +++
 ...tRestoreSnapshotFromClientAfterTruncate.java |  53 +++
 .../TestRestoreSnapshotFromClientClone.java |  52 +++
 ...oreSnapshotFromClientGetCompactionState.java |  53 +++
 ...stRestoreSnapshotFromClientSchemaChange.java |  53 +++
 .../TestRestoreSnapshotFromClientSimple.java|  52 +++
 ...oreSnapshotFromClientWithRegionReplicas.java |  13 +-
 22 files changed, 1274 insertions(+), 481 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/1a0e1039/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
new file mode 100644
index 000..51fbb82
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
@@ -0,0 +1,53 @@
+/**
+ * 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.snapshot.SnapshotTestingUtils;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.junit.Test;
+
+public class RestoreSnapshotFromClientAfterSplittingRegionsTestBase
+extends RestoreSnapshotFromClientTestBase {
+
+  @Test
+  public void testRestoreSnapshotAfterSplittingRegions() throws IOException, 
InterruptedException {
+List regionInfos = admin.getRegions(tableName);
+RegionReplicaUtil.removeNonDefaultRegions(regionInfos);
+
+// Split the first region
+splitRegion(regionInfos.get(0));
+
+// Take a snapshot
+admin.snapshot(snapshotName1, tableName);
+
+// Load more data
+SnapshotTestingUtils.loadData(TEST_UTIL, tableName, 500, FAMILY);
+
+// Split the second region
+splitRegion(regionInfos.get(1));
+
+// Restore the snapshot
+admin.disableTable(tableName);
+admin.restoreSnapshot(snapshotName1);
+admin.enableTable(tableName);
+
+verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);
+  }
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/1a0e1039/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterTruncateTestBase.java
---

hbase git commit: HBASE-21311 Split TestRestoreSnapshotFromClient

2018-10-15 Thread zhangduo
Repository: hbase
Updated Branches:
  refs/heads/master 07e2247d2 -> fc7a6a64c


HBASE-21311 Split TestRestoreSnapshotFromClient


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

Branch: refs/heads/master
Commit: fc7a6a64c2b5c250fee3b9dadb2bed99904b4a74
Parents: 07e2247
Author: zhangduo 
Authored: Mon Oct 15 21:28:34 2018 +0800
Committer: zhangduo 
Committed: Tue Oct 16 08:29:35 2018 +0800

--
 ...FromClientAfterSplittingRegionsTestBase.java |  52 +++
 ...SnapshotFromClientAfterTruncateTestBase.java |  48 +++
 .../RestoreSnapshotFromClientCloneTestBase.java |  65 +++
 ...hotFromClientGetCompactionStateTestBase.java |  44 +++
 ...eSnapshotFromClientSchemaChangeTestBase.java | 105 +
 ...RestoreSnapshotFromClientSimpleTestBase.java |  80 
 .../RestoreSnapshotFromClientTestBase.java  | 150 +++
 .../TestMobRestoreSnapshotFromClient.java   |  78 
 ...SnapshotFromClientAfterSplittingRegions.java |  67 
 ...bRestoreSnapshotFromClientAfterTruncate.java |  67 
 .../TestMobRestoreSnapshotFromClientClone.java  |  66 
 ...oreSnapshotFromClientGetCompactionState.java |  67 
 ...obRestoreSnapshotFromClientSchemaChange.java |  73 
 .../TestMobRestoreSnapshotFromClientSimple.java |  67 
 .../client/TestRestoreSnapshotFromClient.java   | 396 ---
 ...SnapshotFromClientAfterSplittingRegions.java |  53 +++
 ...tRestoreSnapshotFromClientAfterTruncate.java |  53 +++
 .../TestRestoreSnapshotFromClientClone.java |  52 +++
 ...oreSnapshotFromClientGetCompactionState.java |  53 +++
 ...stRestoreSnapshotFromClientSchemaChange.java |  53 +++
 .../TestRestoreSnapshotFromClientSimple.java|  52 +++
 ...oreSnapshotFromClientWithRegionReplicas.java |  13 +-
 22 files changed, 1273 insertions(+), 481 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/fc7a6a64/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
new file mode 100644
index 000..59f0fd4
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java
@@ -0,0 +1,52 @@
+/**
+ * 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.snapshot.SnapshotTestingUtils;
+import org.junit.Test;
+
+public class RestoreSnapshotFromClientAfterSplittingRegionsTestBase
+extends RestoreSnapshotFromClientTestBase {
+
+  @Test
+  public void testRestoreSnapshotAfterSplittingRegions() throws IOException, 
InterruptedException {
+List regionInfos = admin.getRegions(tableName);
+RegionReplicaUtil.removeNonDefaultRegions(regionInfos);
+
+// Split the first region
+splitRegion(regionInfos.get(0));
+
+// Take a snapshot
+admin.snapshot(snapshotName1, tableName);
+
+// Load more data
+SnapshotTestingUtils.loadData(TEST_UTIL, tableName, 500, FAMILY);
+
+// Split the second region
+splitRegion(regionInfos.get(1));
+
+// Restore the snapshot
+admin.disableTable(tableName);
+admin.restoreSnapshot(snapshotName1);
+admin.enableTable(tableName);
+
+verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);
+  }
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/fc7a6a64/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterTruncateTestBase.java
--
diff --git 
a/hbase-server/src/test/java/org/