hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1546442 - in /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase: client/TestRestoreSnapshotFromClient.java snapshot/TestRestoreFlushSnapshotFromClient.java
Date Thu, 28 Nov 2013 18:38:27 GMT
Author: larsh
Date: Thu Nov 28 18:38:26 2013
New Revision: 1546442

URL: http://svn.apache.org/r1546442
Log:
HBASE-10057 TestRestoreFlushSnapshotFromClient and TestRestoreSnapshotFromClient fail to finish
occasionally

Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java?rev=1546442&r1=1546441&r2=1546442&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java
Thu Nov 28 18:38:26 2013
@@ -109,30 +109,27 @@ public class TestRestoreSnapshotFromClie
     admin.snapshot(emptySnapshot, tableName);
 
     HTable table = new HTable(TEST_UTIL.getConfiguration(), tableName);
-    try {
-      // enable table and insert data
-      admin.enableTable(tableName);
-      SnapshotTestingUtils.loadData(TEST_UTIL, table, 500, FAMILY);
-      snapshot0Rows = TEST_UTIL.countRows(table);
-      admin.disableTable(tableName);
-
-      // take a snapshot
-      admin.snapshot(snapshotName0, tableName);
-
-      // enable table and insert more data
-      admin.enableTable(tableName);
-      SnapshotTestingUtils.loadData(TEST_UTIL, table, 500, FAMILY);
-      snapshot1Rows = TEST_UTIL.countRows(table);
-      admin.disableTable(tableName);
-
-      // take a snapshot of the updated table
-      admin.snapshot(snapshotName1, tableName);
-
-      // re-enable table
-      admin.enableTable(tableName);
-    } finally {
-      table.close();
-    }
+    // enable table and insert data
+    admin.enableTable(tableName);
+    SnapshotTestingUtils.loadData(TEST_UTIL, table, 500, FAMILY);
+    snapshot0Rows = TEST_UTIL.countRows(table);
+    admin.disableTable(tableName);
+
+    // take a snapshot
+    admin.snapshot(snapshotName0, tableName);
+
+    // enable table and insert more data
+    admin.enableTable(tableName);
+    SnapshotTestingUtils.loadData(TEST_UTIL, table, 500, FAMILY);
+    snapshot1Rows = TEST_UTIL.countRows(table);
+    admin.disableTable(tableName);
+
+    // take a snapshot of the updated table
+    admin.snapshot(snapshotName1, tableName);
+
+    // re-enable table
+    admin.enableTable(tableName);
+    table.close();
   }
 
   @After

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java?rev=1546442&r1=1546441&r2=1546442&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java
Thu Nov 28 18:38:26 2013
@@ -17,34 +17,22 @@
  */
 package org.apache.hadoop.hbase.snapshot;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 import java.io.IOException;
-import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
-import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.LargeTests;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
-import org.apache.hadoop.hbase.client.Put;
-import org.apache.hadoop.hbase.client.Durability;
 import org.apache.hadoop.hbase.master.MasterFileSystem;
 import org.apache.hadoop.hbase.master.snapshot.SnapshotManager;
 import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription;
-import org.apache.hadoop.hbase.regionserver.HRegion;
-import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.regionserver.snapshot.RegionServerSnapshotManager;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.FSUtils;
-import org.apache.hadoop.hbase.util.MD5Hash;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
@@ -65,7 +53,6 @@ public class TestRestoreFlushSnapshotFro
   private final static HBaseTestingUtility UTIL = new HBaseTestingUtility();
 
   private final byte[] FAMILY = Bytes.toBytes("cf");
-  private static final byte[] TEST_QUAL = Bytes.toBytes("q");
 
   private byte[] snapshotName0;
   private byte[] snapshotName1;
@@ -115,33 +102,30 @@ public class TestRestoreFlushSnapshotFro
     // create Table and disable it
     SnapshotTestingUtils.createTable(UTIL, tableName, FAMILY);
     HTable table = new HTable(UTIL.getConfiguration(), tableName);
-    try {
-      SnapshotTestingUtils.loadData(UTIL, table, 500, FAMILY);
-      snapshot0Rows = UTIL.countRows(table);
-      LOG.info("=== before snapshot with 500 rows");
-      logFSTree();
-
-      // take a snapshot
-      admin.snapshot(Bytes.toString(snapshotName0), tableName,
-          SnapshotDescription.Type.FLUSH);
-
-      LOG.info("=== after snapshot with 500 rows");
-      logFSTree();
-
-      // insert more data
-      SnapshotTestingUtils.loadData(UTIL, table, 500, FAMILY);
-      snapshot1Rows = UTIL.countRows(table);
-      LOG.info("=== before snapshot with 1000 rows");
-      logFSTree();
-
-      // take a snapshot of the updated table
-      admin.snapshot(Bytes.toString(snapshotName1), tableName,
-          SnapshotDescription.Type.FLUSH);
-      LOG.info("=== after snapshot with 1000 rows");
-      logFSTree();
-    } finally {
-      table.close();
-    }
+    SnapshotTestingUtils.loadData(UTIL, table, 500, FAMILY);
+    snapshot0Rows = UTIL.countRows(table);
+    LOG.info("=== before snapshot with 500 rows");
+    logFSTree();
+
+    // take a snapshot
+    admin.snapshot(Bytes.toString(snapshotName0), tableName,
+        SnapshotDescription.Type.FLUSH);
+
+    LOG.info("=== after snapshot with 500 rows");
+    logFSTree();
+
+    // insert more data
+    SnapshotTestingUtils.loadData(UTIL, table, 500, FAMILY);
+    snapshot1Rows = UTIL.countRows(table);
+    LOG.info("=== before snapshot with 1000 rows");
+    logFSTree();
+
+    // take a snapshot of the updated table
+    admin.snapshot(Bytes.toString(snapshotName1), tableName,
+        SnapshotDescription.Type.FLUSH);
+    LOG.info("=== after snapshot with 1000 rows");
+    logFSTree();
+    table.close();
   }
 
   @After



Mime
View raw message