hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndimi...@apache.org
Subject hbase git commit: HBASE-13905 TestRecoveredEdits.testReplayWorksThoughLotsOfFlushing failing consistently on branch-1.1
Date Tue, 16 Jun 2015 00:41:55 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 7c6c916a4 -> a8fe95cce


HBASE-13905 TestRecoveredEdits.testReplayWorksThoughLotsOfFlushing failing consistently on
branch-1.1


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

Branch: refs/heads/branch-1.1
Commit: a8fe95cced717c00ffa3635224427bd6fba27d0c
Parents: 7c6c916
Author: Nick Dimiduk <ndimiduk@apache.org>
Authored: Mon Jun 15 17:15:22 2015 -0700
Committer: Nick Dimiduk <ndimiduk@apache.org>
Committed: Mon Jun 15 17:15:22 2015 -0700

----------------------------------------------------------------------
 .../hbase/regionserver/TestRecoveredEdits.java  | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/a8fe95cc/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java
index 3d651ef..d363701 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java
@@ -23,6 +23,8 @@ 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.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -41,6 +43,7 @@ import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.wal.WAL;
 import org.apache.hadoop.hbase.wal.WALFactory;
 import org.apache.hadoop.hbase.wal.WALKey;
@@ -49,7 +52,6 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TestName;
-import org.mortbay.log.Log;
 
 /**
  * Tests around replay of recovered.edits content.
@@ -57,6 +59,7 @@ import org.mortbay.log.Log;
 @Category({MediumTests.class})
 public class TestRecoveredEdits {
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
+  private static final Log LOG = LogFactory.getLog(TestRecoveredEdits.class);
   @Rule public TestName testName = new TestName();
 
   /**
@@ -66,7 +69,7 @@ public class TestRecoveredEdits {
    * made it in.
    * @throws IOException
    */
-  @Test (timeout=30000)
+  @Test (timeout=60000)
   public void testReplayWorksThoughLotsOfFlushing() throws IOException {
     Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
     // Set it so we flush every 1M or so.  Thats a lot.
@@ -95,6 +98,14 @@ public class TestRecoveredEdits {
       }
     };
     Path hbaseRootDir = TEST_UTIL.getDataTestDir();
+    FileSystem fs = FileSystem.get(TEST_UTIL.getConfiguration());
+    Path tableDir = FSUtils.getTableDir(hbaseRootDir, htd.getTableName());
+    HRegionFileSystem hrfs =
+        new HRegionFileSystem(TEST_UTIL.getConfiguration(), fs, tableDir, hri);
+    if (fs.exists(hrfs.getRegionDir())) {
+      LOG.info("Region directory already exists. Deleting.");
+      fs.delete(hrfs.getRegionDir(), true);
+    }
     HRegion region = HRegion.createHRegion(hri, hbaseRootDir, conf, htd, null);
     assertEquals(encodedRegionName, region.getRegionInfo().getEncodedName());
     List<String> storeFiles = region.getStoreFileList(columnFamilyAsByteArray);
@@ -108,7 +119,6 @@ public class TestRecoveredEdits {
       System.getProperty("project.build.testSourceDirectory", "src" + Path.SEPARATOR + "test"),
       "data"), "0000000000000016310");
     // Copy this file under the region's recovered.edits dir so it is replayed on reopen.
-    FileSystem fs = FileSystem.get(conf);
     Path destination = new Path(recoveredEditsDir, recoveredEditsFile.getName());
     fs.copyToLocalFile(recoveredEditsFile, destination);
     assertTrue(fs.exists(destination));
@@ -122,7 +132,7 @@ public class TestRecoveredEdits {
     assertTrue("Files count=" + storeFiles.size(), storeFiles.size() > 10);
     // Now verify all edits made it into the region.
     int count = verifyAllEditsMadeItIn(fs, conf, recoveredEditsFile, region);
-    Log.info("Checked " + count + " edits made it in");
+    LOG.info("Checked " + count + " edits made it in");
   }
 
   /**
@@ -174,4 +184,4 @@ public class TestRecoveredEdits {
     }
     return count;
   }
-}
\ No newline at end of file
+}


Mime
View raw message