hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1329260 - in /hbase/branches/0.90: ./ src/main/java/org/apache/hadoop/hbase/client/ src/main/java/org/apache/hadoop/hbase/io/hfile/ src/main/java/org/apache/hadoop/hbase/regionserver/ src/main/java/org/apache/hadoop/hbase/util/ src/test/ja...
Date Mon, 23 Apr 2012 14:34:54 GMT
Author: stack
Date: Mon Apr 23 14:34:53 2012
New Revision: 1329260

URL: http://svn.apache.org/viewvc?rev=1329260&view=rev
Log:
HBASE-5833 0.92 build has been failing pretty consistently on TestMasterFailover

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HTable.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Mon Apr 23 14:34:53 2012
@@ -21,6 +21,7 @@ Release 0.90.7 - Unreleased
    HBASE-5781  Zookeeper session got closed while trying to assign the region to RS using
hbck -fix
    HBASE-5793  TestHBaseFsck#TestNoHdfsTable test hangs after client retries increased
    HBASE-5213  "hbase master stop" does not bring down backup masters (Gregory Chanan)
+   HBASE-5833  0.92 build has been failing pretty consistently on TestMasterFailover.
 
   IMPROVEMENT
    HBASE-5588  Deprecate/remove AssignmentManager#clearRegionFromTransition

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HTable.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HTable.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HTable.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HTable.java Mon Apr 23
14:34:53 2012
@@ -1342,7 +1342,7 @@ public class HTable implements HTableInt
             SecurityManager s = System.getSecurityManager();
             group = (s != null)? s.getThreadGroup() :
                                  Thread.currentThread().getThreadGroup();
-            namePrefix = "pool-" +
+            namePrefix = "htable-pool-" +
                           poolNumber.getAndIncrement() +
                          "-thread-";
         }

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
Mon Apr 23 14:34:53 2012
@@ -22,6 +22,7 @@ package org.apache.hadoop.hbase.io.hfile
 import java.lang.ref.WeakReference;
 import java.nio.ByteBuffer;
 import java.util.LinkedList;
+import java.util.List;
 import java.util.PriorityQueue;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.ReentrantLock;
@@ -504,16 +505,17 @@ public class LruBlockCache implements Bl
    */
   private static class EvictionThread extends Thread {
     private WeakReference<LruBlockCache> cache;
+    private boolean go = true;
 
     public EvictionThread(LruBlockCache cache) {
-      super("LruBlockCache.EvictionThread");
+      super(Thread.currentThread().getName() + ".LruBlockCache.EvictionThread");
       setDaemon(true);
       this.cache = new WeakReference<LruBlockCache>(cache);
     }
 
     @Override
     public void run() {
-      while(true) {
+      while (this.go) {
         synchronized(this) {
           try {
             this.wait();
@@ -524,11 +526,17 @@ public class LruBlockCache implements Bl
         cache.evict();
       }
     }
+
     public void evict() {
       synchronized(this) {
         this.notify(); // FindBugs NN_NAKED_NOTIFY
       }
     }
+
+    void shutdown() {
+      this.go = false;
+      interrupt();
+    }
   }
 
   /*
@@ -711,5 +719,20 @@ public class LruBlockCache implements Bl
 
   public void shutdown() {
     this.scheduleThreadPool.shutdown();
+    for (int i = 0; i < 10; i++) {
+      if (!this.scheduleThreadPool.isShutdown()) {
+        try {
+          Thread.sleep(10);
+        } catch (InterruptedException e) {
+          Thread.currentThread().interrupt();
+          break;
+        }
+      }
+    }
+    if (!this.scheduleThreadPool.isShutdown()) {
+      List<Runnable> runnables = this.scheduleThreadPool.shutdownNow();
+      LOG.debug("Still running " + runnables);
+    }
+    this.evictionThread.shutdown();
   }
 }

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java Mon
Apr 23 14:34:53 2012
@@ -2584,7 +2584,11 @@ public class HRegion implements HeapSize
    * bootstrap code in the HMaster constructor.
    * Note, this method creates an {@link HLog} for the created region. It
    * needs to be closed explicitly.  Use {@link HRegion#getLog()} to get
-   * access.
+   * access.  <b>When done with a region created using this method, you will
+   * need to explicitly close the {@link HLog} it created too; it will not be
+   * done for you.  Not closing the log will leave at least a daemon thread
+   * running.</b>  Call {@link #closeHRegion(HRegion)} and it will do
+   * necessary cleanup for you.
    * @param info Info for region to create.
    * @param rootDir Root directory for HBase instance
    * @param conf
@@ -2608,6 +2612,23 @@ public class HRegion implements HeapSize
     return region;
   }
 
+   /**
+   * This will do the necessary cleanup a call to {@link #createHRegion(HRegionInfo, Path,
Configuration, HTableDescriptor)}
+   * requires.  This method will close the region and then close its
+   * associated {@link HLog} file.  You use it if you call the other createHRegion,
+   * the one that takes an {@link HLog} instance but don't be surprised by the
+   * call to the {@link HLog#closeAndDelete()} on the {@link HLog} the
+   * HRegion was carrying.
+   * @param r
+   * @throws IOException
+   */
+  public static void closeHRegion(final HRegion r) throws IOException {
+    if (r == null) return;
+    r.close();
+    if (r.getLog() == null) return;
+    r.getLog().closeAndDelete();
+  }
+
   /**
    * Open a Region.
    * @param info Info for region to be opened.

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java Mon
Apr 23 14:34:53 2012
@@ -187,7 +187,7 @@ public class JVMClusterUtil {
     }
     // Wait for an active master
     while (true) {
-      for (JVMClusterUtil.MasterThread t : masters) {
+      for (JVMClusterUtil.MasterThread t: masters) {
         if (t.master.isActiveMaster()) {
           return t.master.getMasterAddress().toString();
         }
@@ -208,13 +208,17 @@ public class JVMClusterUtil {
       final List<RegionServerThread> regionservers) {
     LOG.debug("Shutting down HBase Cluster");
     if (masters != null) {
+      // Do backups first.
+      JVMClusterUtil.MasterThread activeMaster = null;
       for (JVMClusterUtil.MasterThread t : masters) {
-        if (t.master.isActiveMaster()) {
-          t.master.shutdown();
-        } else {
+        if (!t.master.isActiveMaster()) {
           t.master.stopMaster();
+        } else {
+          activeMaster = t;
         }
       }
+      // Do active after.
+      if (activeMaster != null) activeMaster.master.shutdown();
     }
     // regionServerThreads can never be null because they are initialized when
     // the class is constructed.

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java (original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java Mon Apr 23
14:34:53 2012
@@ -152,6 +152,16 @@ public abstract class HBaseTestCase exte
         conf.get(TEST_DIRECTORY_KEY, "target/test/data"), testName);
   }
 
+  /**
+   * You must call close on the returned region and then close on the log file
+   * it created. Do {@link HRegion#close()} followed by {@link HRegion#getLog()}
+   * and on it call close.
+   * @param desc
+   * @param startKey
+   * @param endKey
+   * @return An {@link HRegion}
+   * @throws IOException
+   */
   protected HRegion createNewHRegion(HTableDescriptor desc, byte [] startKey,
       byte [] endKey)
   throws IOException {
@@ -159,7 +169,6 @@ public abstract class HBaseTestCase exte
     Path rootdir = filesystem.makeQualified(
         new Path(conf.get(HConstants.HBASE_DIR)));
     filesystem.mkdirs(rootdir);
-
     return HRegion.createHRegion(new HRegionInfo(desc, startKey, endKey),
         rootdir, conf);
   }
@@ -652,6 +661,11 @@ public abstract class HBaseTestCase exte
     }
   }
 
+  /**
+   * You must call {@link #closeRootAndMeta()} when done after calling this
+   * method. It does cleanup.
+   * @throws IOException
+   */
   protected void createRootAndMetaRegions() throws IOException {
     root = HRegion.createHRegion(HRegionInfo.ROOT_REGIONINFO, testDir, conf);
     meta = HRegion.createHRegion(HRegionInfo.FIRST_META_REGIONINFO, testDir,

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java
(original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java
Mon Apr 23 14:34:53 2012
@@ -53,51 +53,55 @@ public class TestColumnPrefixFilter {
     HRegionInfo info = new HRegionInfo(htd, null, null, false);
     HRegion region = HRegion.createHRegion(info, HBaseTestingUtility.
         getTestDir(), TEST_UTIL.getConfiguration());
+    try {
 
-    List<String> rows = generateRandomWords(100, "row");
-    List<String> columns = generateRandomWords(10000, "column");
-    long maxTimestamp = 2;
-
-    List<KeyValue> kvList = new ArrayList<KeyValue>();
-
-    Map<String, List<KeyValue>> prefixMap = new HashMap<String,
-        List<KeyValue>>();
-
-    prefixMap.put("p", new ArrayList<KeyValue>());
-    prefixMap.put("s", new ArrayList<KeyValue>());
-
-    String valueString = "ValueString";
-
-    for (String row: rows) {
-      Put p = new Put(Bytes.toBytes(row));
-      for (String column: columns) {
-        for (long timestamp = 1; timestamp <= maxTimestamp; timestamp++) {
-          KeyValue kv = KeyValueTestUtil.create(row, family, column, timestamp,
-              valueString);
-          p.add(kv);
-          kvList.add(kv);
-          for (String s: prefixMap.keySet()) {
-            if (column.startsWith(s)) {
-              prefixMap.get(s).add(kv);
-            }
-          }
-        }
+      List<String> rows = generateRandomWords(100, "row");
+      List<String> columns = generateRandomWords(10000, "column");
+      long maxTimestamp = 2;
+
+      List<KeyValue> kvList = new ArrayList<KeyValue>();
+
+      Map<String, List<KeyValue>> prefixMap = new HashMap<String,
+	  List<KeyValue>>();
+
+      prefixMap.put("p", new ArrayList<KeyValue>());
+      prefixMap.put("s", new ArrayList<KeyValue>());
+
+      String valueString = "ValueString";
+
+      for (String row: rows) {
+	Put p = new Put(Bytes.toBytes(row));
+	for (String column: columns) {
+	  for (long timestamp = 1; timestamp <= maxTimestamp; timestamp++) {
+	    KeyValue kv = KeyValueTestUtil.create(row, family, column, timestamp,
+		valueString);
+	    p.add(kv);
+	    kvList.add(kv);
+	    for (String s: prefixMap.keySet()) {
+	      if (column.startsWith(s)) {
+		prefixMap.get(s).add(kv);
+	      }
+	    }
+	  }
+	}
+	region.put(p);
       }
-      region.put(p);
-    }
 
-    ColumnPrefixFilter filter;
-    Scan scan = new Scan();
-    scan.setMaxVersions();
-    for (String s: prefixMap.keySet()) {
-      filter = new ColumnPrefixFilter(Bytes.toBytes(s));
-
-      scan.setFilter(filter);
-
-      InternalScanner scanner = region.getScanner(scan);
-      List<KeyValue> results = new ArrayList<KeyValue>();
-      while(scanner.next(results));
-      assertEquals(prefixMap.get(s).size(), results.size());
+      ColumnPrefixFilter filter;
+      Scan scan = new Scan();
+      scan.setMaxVersions();
+      for (String s: prefixMap.keySet()) {
+	filter = new ColumnPrefixFilter(Bytes.toBytes(s));
+
+	scan.setFilter(filter);
+
+	InternalScanner scanner = region.getScanner(scan);
+	List<KeyValue> results = new ArrayList<KeyValue>();
+	while(scanner.next(results));
+	assertEquals(prefixMap.get(s).size(), results.size());
+      }
+    } finally {
+      HRegion.closeHRegion(region);
     }
   }
 
@@ -109,54 +113,57 @@ public class TestColumnPrefixFilter {
     HRegionInfo info = new HRegionInfo(htd, null, null, false);
     HRegion region = HRegion.createHRegion(info, HBaseTestingUtility.
         getTestDir(), TEST_UTIL.getConfiguration());
+    try {
+      List<String> rows = generateRandomWords(100, "row");
+      List<String> columns = generateRandomWords(10000, "column");
+      long maxTimestamp = 2;
 
-    List<String> rows = generateRandomWords(100, "row");
-    List<String> columns = generateRandomWords(10000, "column");
-    long maxTimestamp = 2;
-
-    List<KeyValue> kvList = new ArrayList<KeyValue>();
+      List<KeyValue> kvList = new ArrayList<KeyValue>();
 
-    Map<String, List<KeyValue>> prefixMap = new HashMap<String,
+      Map<String, List<KeyValue>> prefixMap = new HashMap<String,
         List<KeyValue>>();
 
-    prefixMap.put("p", new ArrayList<KeyValue>());
-    prefixMap.put("s", new ArrayList<KeyValue>());
+      prefixMap.put("p", new ArrayList<KeyValue>());
+      prefixMap.put("s", new ArrayList<KeyValue>());
 
-    String valueString = "ValueString";
+      String valueString = "ValueString";
 
-    for (String row: rows) {
-      Put p = new Put(Bytes.toBytes(row));
-      for (String column: columns) {
-        for (long timestamp = 1; timestamp <= maxTimestamp; timestamp++) {
-          KeyValue kv = KeyValueTestUtil.create(row, family, column, timestamp,
-              valueString);
-          p.add(kv);
-          kvList.add(kv);
-          for (String s: prefixMap.keySet()) {
-            if (column.startsWith(s)) {
-              prefixMap.get(s).add(kv);
-            }
-          }
-        }
+      for (String row: rows) {
+	Put p = new Put(Bytes.toBytes(row));
+	for (String column: columns) {
+	  for (long timestamp = 1; timestamp <= maxTimestamp; timestamp++) {
+	    KeyValue kv = KeyValueTestUtil.create(row, family, column, timestamp,
+		valueString);
+	    p.add(kv);
+	    kvList.add(kv);
+	    for (String s: prefixMap.keySet()) {
+	      if (column.startsWith(s)) {
+		prefixMap.get(s).add(kv);
+	      }
+	    }
+	  }
+	}
+	region.put(p);
       }
-      region.put(p);
-    }
 
-    ColumnPrefixFilter filter;
-    Scan scan = new Scan();
-    scan.setMaxVersions();
-    for (String s: prefixMap.keySet()) {
-      filter = new ColumnPrefixFilter(Bytes.toBytes(s));
-
-      //this is how this test differs from the one above
-      FilterList filterList = new FilterList(FilterList.Operator.MUST_PASS_ALL);
-      filterList.addFilter(filter);
-      scan.setFilter(filterList);
-
-      InternalScanner scanner = region.getScanner(scan);
-      List<KeyValue> results = new ArrayList<KeyValue>();
-      while(scanner.next(results));
-      assertEquals(prefixMap.get(s).size(), results.size());
+      ColumnPrefixFilter filter;
+      Scan scan = new Scan();
+      scan.setMaxVersions();
+      for (String s: prefixMap.keySet()) {
+	filter = new ColumnPrefixFilter(Bytes.toBytes(s));
+
+	//this is how this test differs from the one above
+	FilterList filterList = new FilterList(FilterList.Operator.MUST_PASS_ALL);
+	filterList.addFilter(filter);
+	scan.setFilter(filterList);
+
+	InternalScanner scanner = region.getScanner(scan);
+	List<KeyValue> results = new ArrayList<KeyValue>();
+	while(scanner.next(results));
+	assertEquals(prefixMap.get(s).size(), results.size());
+      }
+    } finally {
+      HRegion.closeHRegion(region);
     }
   }
 

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java
(original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java
Mon Apr 23 14:34:53 2012
@@ -84,6 +84,7 @@ public class TestDependentColumnFilter e
   protected void tearDown() throws Exception {
     super.tearDown();
     this.region.close();
+    this.region.getLog().closeAndDelete();
   }
 
   private void addData() throws IOException {

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java (original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java Mon Apr
23 14:34:53 2012
@@ -163,6 +163,7 @@ public class TestFilter extends HBaseTes
 
   protected void tearDown() throws Exception {
     this.region.close();
+    this.region.getLog().closeAndDelete();
     super.tearDown();
   }
 

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java
(original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java
Mon Apr 23 14:34:53 2012
@@ -61,6 +61,51 @@ import org.junit.Test;
 public class TestMasterFailover {
   private static final Log LOG = LogFactory.getLog(TestMasterFailover.class);
 
+  @Test (timeout=180000)
+  public void testShouldCheckMasterFailOverWhenMETAIsInOpenedState()
+      throws Exception {
+    final int NUM_MASTERS = 1;
+    final int NUM_RS = 2;
+
+    Configuration conf = HBaseConfiguration.create();
+    conf.setInt("hbase.master.assignment.timeoutmonitor.period", 2000);
+    conf.setInt("hbase.master.assignment.timeoutmonitor.timeout", 8000);
+    // Start the cluster
+    HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(conf);
+    TEST_UTIL.startMiniCluster(NUM_MASTERS, NUM_RS);
+    MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
+
+    // Find regionserver carrying meta.
+    List<RegionServerThread> regionServerThreads = cluster.getRegionServerThreads();
+    int count = -1;
+    HRegion metaRegion = null;
+    for (RegionServerThread regionServerThread : regionServerThreads) {
+      HRegionServer regionServer = regionServerThread.getRegionServer();
+      metaRegion = regionServer.getOnlineRegion(HRegionInfo.FIRST_META_REGIONINFO.getRegionName());
+      count++;
+      regionServer.abort("");
+      if (null != metaRegion) break;
+    }
+    HRegionServer regionServer = cluster.getRegionServer(count);
+
+    TEST_UTIL.shutdownMiniHBaseCluster();
+
+    // Create a ZKW to use in the test
+    ZooKeeperWatcher zkw = 
+      HBaseTestingUtility.createAndForceNodeToOpenedState(TEST_UTIL,
+        metaRegion, regionServer.getServerName());
+
+    LOG.info("Staring cluster for second time");
+    TEST_UTIL.startMiniHBaseCluster(1, 1);
+
+    // Failover should be completed, now wait for no RIT
+    log("Waiting for no more RIT");
+    ZKAssign.blockUntilNoRIT(zkw);
+
+    // Stop the cluster
+    TEST_UTIL.shutdownMiniCluster();
+  }
+
   /**
    * Simple test of master failover.
    * <p>
@@ -142,60 +187,6 @@ public class TestMasterFailover {
     TEST_UTIL.shutdownMiniCluster();
   }
   
-  @Test
-  public void testShouldCheckMasterFailOverWhenMETAIsInOpenedState()
-      throws Exception {
-    final int NUM_MASTERS = 1;
-    final int NUM_RS = 2;
-
-    Configuration conf = HBaseConfiguration.create();
-    conf.setInt("hbase.master.assignment.timeoutmonitor.period", 2000);
-    conf.setInt("hbase.master.assignment.timeoutmonitor.timeout", 8000);
-    // Start the cluster
-    HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(conf);
-    TEST_UTIL.startMiniCluster(NUM_MASTERS, NUM_RS);
-    MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
-
-    // get all the master threads
-    List<MasterThread> masterThreads = cluster.getMasterThreads();
-
-    // wait for each to come online
-    for (MasterThread mt : masterThreads) {
-      assertTrue(mt.isAlive());
-    }
-    assertEquals(NUM_MASTERS, masterThreads.size());
-    assertEquals(1, masterThreads.size());
-
-    List<RegionServerThread> regionServerThreads = cluster
-        .getRegionServerThreads();
-    int count = -1;
-    HRegion metaRegion = null;
-    for (RegionServerThread regionServerThread : regionServerThreads) {
-      HRegionServer regionServer = regionServerThread.getRegionServer();
-      metaRegion = regionServer
-          .getOnlineRegion(HRegionInfo.FIRST_META_REGIONINFO.getRegionName());
-      count++;
-      regionServer.abort("");
-      if (null != metaRegion) {
-        break;
-      }
-    }
-    HRegionServer regionServer = cluster.getRegionServer(count);
-
-    cluster.shutdown();
-    ZooKeeperWatcher zkw = 
-      HBaseTestingUtility.createAndForceNodeToOpenedState(TEST_UTIL,
-        metaRegion, regionServer.getServerName());
-
-    TEST_UTIL.startMiniHBaseCluster(1, 1);
-
-    // Failover should be completed, now wait for no RIT
-    log("Waiting for no more RIT");
-    ZKAssign.blockUntilNoRIT(zkw);
-
-    // Stop the cluster
-    TEST_UTIL.shutdownMiniCluster();
-  }
 
 
 

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
(original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
Mon Apr 23 14:34:53 2012
@@ -118,6 +118,7 @@ public class TestOpenedRegionHandler {
   @Test
   public void testShouldNotCompeleteOpenedRegionSuccessfullyIfVersionMismatches()
       throws Exception {
+    HRegion region = null;
     try {
       TEST_UTIL.startMiniZKCluster();
       final Server server = new MockServer();
@@ -125,8 +126,7 @@ public class TestOpenedRegionHandler {
           "testShouldNotCompeleteOpenedRegionSuccessfullyIfVersionMismatches");
       final HRegionInfo hri = new HRegionInfo(htd, HConstants.EMPTY_END_ROW,
           HConstants.EMPTY_END_ROW);
-      HRegion region = HRegion.createHRegion(hri, HBaseTestingUtility
-          .getTestDir(), server.getConfiguration());
+      region = HRegion.createHRegion(hri, HBaseTestingUtility.getTestDir(), server.getConfiguration());
       assertNotNull(region);
       AssignmentManager am = Mockito.mock(AssignmentManager.class);
       when(am.isRegionInTransition(hri)).thenReturn(
@@ -165,6 +165,8 @@ public class TestOpenedRegionHandler {
       assertEquals("The region should not be opened successfully.", regionName,
           region.getRegionInfo().getEncodedName());
     } finally {
+      region.close();
+      region.getLog().closeAndDelete();
       TEST_UTIL.shutdownMiniZKCluster();
     }
   }

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
(original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
Mon Apr 23 14:34:53 2012
@@ -72,94 +72,97 @@ public class TestColumnSeeking {
     HRegion region =
         HRegion.createHRegion(info, HBaseTestingUtility.getTestDir(), TEST_UTIL
             .getConfiguration());
-
-    List<String> rows = generateRandomWords(10, "row");
-    List<String> allColumns = generateRandomWords(10, "column");
-    List<String> values = generateRandomWords(100, "value");
-
-    long maxTimestamp = 2;
-    double selectPercent = 0.5;
-    int numberOfTests = 5;
-    double flushPercentage = 0.2;
-    double minorPercentage = 0.2;
-    double majorPercentage = 0.2;
-    double putPercentage = 0.2;
-
-    HashMap<String, KeyValue> allKVMap = new HashMap<String, KeyValue>();
-
-    HashMap<String, KeyValue>[] kvMaps = new HashMap[numberOfTests];
-    ArrayList<String>[] columnLists = new ArrayList[numberOfTests];
-
-    for (int i = 0; i < numberOfTests; i++) {
-      kvMaps[i] = new HashMap<String, KeyValue>();
-      columnLists[i] = new ArrayList<String>();
-      for (String column : allColumns) {
-        if (Math.random() < selectPercent) {
-          columnLists[i].add(column);
-        }
-      }
-    }
-
-    for (String value : values) {
-      for (String row : rows) {
-        Put p = new Put(Bytes.toBytes(row));
-        for (String column : allColumns) {
-          for (long timestamp = 1; timestamp <= maxTimestamp; timestamp++) {
-            KeyValue kv =
-                KeyValueTestUtil.create(row, family, column, timestamp, value);
-            if (Math.random() < putPercentage) {
-              p.add(kv);
-              allKVMap.put(kv.getKeyString(), kv);
-              for (int i = 0; i < numberOfTests; i++) {
-                if (columnLists[i].contains(column)) {
-                  kvMaps[i].put(kv.getKeyString(), kv);
-                }
-              }
-            }
-          }
-        }
-        region.put(p);
-        if (Math.random() < flushPercentage) {
-          LOG.info("Flushing... ");
-          region.flushcache();
-        }
-
-        if (Math.random() < minorPercentage) {
-          LOG.info("Minor compacting... ");
-          region.compactStores(false);
-        }
-
-        if (Math.random() < majorPercentage) {
-          LOG.info("Major compacting... ");
-          region.compactStores(true);
-        }
-      }
-    }
-
-    for (int i = 0; i < numberOfTests + 1; i++) {
-      Collection<KeyValue> kvSet;
-      Scan scan = new Scan();
-      scan.setMaxVersions();
-      if (i < numberOfTests) {
-        kvSet = kvMaps[i].values();
-        for (String column : columnLists[i]) {
-          scan.addColumn(familyBytes, Bytes.toBytes(column));
-        }
-        LOG.info("ExplicitColumns scanner");
-        LOG.info("Columns: " + columnLists[i].size() + "  Keys: "
-            + kvSet.size());
-      } else {
-        kvSet = allKVMap.values();
-        LOG.info("Wildcard scanner");
-        LOG.info("Columns: " + allColumns.size() + "  Keys: " + kvSet.size());
-
-      }
-      InternalScanner scanner = region.getScanner(scan);
-      List<KeyValue> results = new ArrayList<KeyValue>();
-      while (scanner.next(results))
-        ;
-      assertEquals(kvSet.size(), results.size());
-      assertTrue(results.containsAll(kvSet));
+    try {
+      List<String> rows = generateRandomWords(10, "row");
+      List<String> allColumns = generateRandomWords(10, "column");
+      List<String> values = generateRandomWords(100, "value");
+
+      long maxTimestamp = 2;
+      double selectPercent = 0.5;
+      int numberOfTests = 5;
+      double flushPercentage = 0.2;
+      double minorPercentage = 0.2;
+      double majorPercentage = 0.2;
+      double putPercentage = 0.2;
+
+      HashMap<String, KeyValue> allKVMap = new HashMap<String, KeyValue>();
+
+      HashMap<String, KeyValue>[] kvMaps = new HashMap[numberOfTests];
+      ArrayList<String>[] columnLists = new ArrayList[numberOfTests];
+
+      for (int i = 0; i < numberOfTests; i++) {
+	kvMaps[i] = new HashMap<String, KeyValue>();
+	columnLists[i] = new ArrayList<String>();
+	for (String column : allColumns) {
+	  if (Math.random() < selectPercent) {
+	    columnLists[i].add(column);
+	  }
+	}
+      }
+
+      for (String value : values) {
+	for (String row : rows) {
+	  Put p = new Put(Bytes.toBytes(row));
+	  for (String column : allColumns) {
+	    for (long timestamp = 1; timestamp <= maxTimestamp; timestamp++) {
+	      KeyValue kv =
+		  KeyValueTestUtil.create(row, family, column, timestamp, value);
+	      if (Math.random() < putPercentage) {
+		p.add(kv);
+		allKVMap.put(kv.getKeyString(), kv);
+		for (int i = 0; i < numberOfTests; i++) {
+		  if (columnLists[i].contains(column)) {
+		    kvMaps[i].put(kv.getKeyString(), kv);
+		  }
+		}
+	      }
+	    }
+	  }
+	  region.put(p);
+	  if (Math.random() < flushPercentage) {
+	    LOG.info("Flushing... ");
+	    region.flushcache();
+	  }
+
+	  if (Math.random() < minorPercentage) {
+	    LOG.info("Minor compacting... ");
+	    region.compactStores(false);
+	  }
+
+	  if (Math.random() < majorPercentage) {
+	    LOG.info("Major compacting... ");
+	    region.compactStores(true);
+	  }
+	}
+      }
+
+      for (int i = 0; i < numberOfTests + 1; i++) {
+	Collection<KeyValue> kvSet;
+	Scan scan = new Scan();
+	scan.setMaxVersions();
+	if (i < numberOfTests) {
+	  kvSet = kvMaps[i].values();
+	  for (String column : columnLists[i]) {
+	    scan.addColumn(familyBytes, Bytes.toBytes(column));
+	  }
+	  LOG.info("ExplicitColumns scanner");
+	  LOG.info("Columns: " + columnLists[i].size() + "  Keys: "
+	      + kvSet.size());
+	} else {
+	  kvSet = allKVMap.values();
+	  LOG.info("Wildcard scanner");
+	  LOG.info("Columns: " + allColumns.size() + "  Keys: " + kvSet.size());
+
+	  }
+	InternalScanner scanner = region.getScanner(scan);
+	List<KeyValue> results = new ArrayList<KeyValue>();
+	while (scanner.next(results))
+	  ;
+	  assertEquals(kvSet.size(), results.size());
+	  assertTrue(results.containsAll(kvSet));
+	}
+      } finally {
+      HRegion.closeHRegion(region);
     }
   }
 
@@ -176,94 +179,97 @@ public class TestColumnSeeking {
     HRegion region =
         HRegion.createHRegion(info, HBaseTestingUtility.getTestDir(), TEST_UTIL
             .getConfiguration());
-
-    List<String> rows = generateRandomWords(10, "row");
-    List<String> allColumns = generateRandomWords(100, "column");
-
-    long maxTimestamp = 2;
-    double selectPercent = 0.5;
-    int numberOfTests = 5;
-    double flushPercentage = 0.2;
-    double minorPercentage = 0.2;
-    double majorPercentage = 0.2;
-    double putPercentage = 0.2;
-
-    HashMap<String, KeyValue> allKVMap = new HashMap<String, KeyValue>();
-
-    HashMap<String, KeyValue>[] kvMaps = new HashMap[numberOfTests];
-    ArrayList<String>[] columnLists = new ArrayList[numberOfTests];
-    String valueString = "Value";
-
-    for (int i = 0; i < numberOfTests; i++) {
-      kvMaps[i] = new HashMap<String, KeyValue>();
-      columnLists[i] = new ArrayList<String>();
-      for (String column : allColumns) {
-        if (Math.random() < selectPercent) {
+    try {
+      List<String> rows = generateRandomWords(10, "row");
+      List<String> allColumns = generateRandomWords(100, "column");
+
+      long maxTimestamp = 2;
+      double selectPercent = 0.5;
+      int numberOfTests = 5;
+      double flushPercentage = 0.2;
+      double minorPercentage = 0.2;
+      double majorPercentage = 0.2;
+      double putPercentage = 0.2;
+
+      HashMap<String, KeyValue> allKVMap = new HashMap<String, KeyValue>();
+
+      HashMap<String, KeyValue>[] kvMaps = new HashMap[numberOfTests];
+      ArrayList<String>[] columnLists = new ArrayList[numberOfTests];
+      String valueString = "Value";
+
+      for (int i = 0; i < numberOfTests; i++) {
+	kvMaps[i] = new HashMap<String, KeyValue>();
+	columnLists[i] = new ArrayList<String>();
+	for (String column : allColumns) {
+	  if (Math.random() < selectPercent) {
           columnLists[i].add(column);
-        }
-      }
-    }
-
-    for (String row : rows) {
-      Put p = new Put(Bytes.toBytes(row));
-      for (String column : allColumns) {
-        for (long timestamp = 1; timestamp <= maxTimestamp; timestamp++) {
-          KeyValue kv =
-              KeyValueTestUtil.create(row, family, column, timestamp,
-                  valueString);
-          if (Math.random() < putPercentage) {
-            p.add(kv);
-            allKVMap.put(kv.getKeyString(), kv);
-            for (int i = 0; i < numberOfTests; i++) {
-              if (columnLists[i].contains(column)) {
-                kvMaps[i].put(kv.getKeyString(), kv);
-              }
-            }
-          }
-
-        }
-      }
-      region.put(p);
-      if (Math.random() < flushPercentage) {
-        LOG.info("Flushing... ");
-        region.flushcache();
+	  }
+	}
       }
 
-      if (Math.random() < minorPercentage) {
-        LOG.info("Minor compacting... ");
-        region.compactStores(false);
-      }
+      for (String row : rows) {
+	Put p = new Put(Bytes.toBytes(row));
+	for (String column : allColumns) {
+	  for (long timestamp = 1; timestamp <= maxTimestamp; timestamp++) {
+	    KeyValue kv =
+		KeyValueTestUtil.create(row, family, column, timestamp,
+		    valueString);
+	    if (Math.random() < putPercentage) {
+	      p.add(kv);
+	      allKVMap.put(kv.getKeyString(), kv);
+	      for (int i = 0; i < numberOfTests; i++) {
+		if (columnLists[i].contains(column)) {
+		  kvMaps[i].put(kv.getKeyString(), kv);
+		}
+	      }
+	    }
+
+	  }
+	}
+	region.put(p);
+	if (Math.random() < flushPercentage) {
+	  LOG.info("Flushing... ");
+	  region.flushcache();
+	}
+
+	if (Math.random() < minorPercentage) {
+	  LOG.info("Minor compacting... ");
+	  region.compactStores(false);
+	}
 
       if (Math.random() < majorPercentage) {
-        LOG.info("Major compacting... ");
-        region.compactStores(true);
-      }
-    }
-
-    for (int i = 0; i < numberOfTests + 1; i++) {
-      Collection<KeyValue> kvSet;
-      Scan scan = new Scan();
-      scan.setMaxVersions();
-      if (i < numberOfTests) {
-        kvSet = kvMaps[i].values();
-        for (String column : columnLists[i]) {
-          scan.addColumn(familyBytes, Bytes.toBytes(column));
-        }
-        LOG.info("ExplicitColumns scanner");
-        LOG.info("Columns: " + columnLists[i].size() + "  Keys: "
-            + kvSet.size());
-      } else {
-        kvSet = allKVMap.values();
-        LOG.info("Wildcard scanner");
-        LOG.info("Columns: " + allColumns.size() + "  Keys: " + kvSet.size());
-
+	  LOG.info("Major compacting... ");
+	  region.compactStores(true);
+	}
+      }
+
+      for (int i = 0; i < numberOfTests + 1; i++) {
+	Collection<KeyValue> kvSet;
+	Scan scan = new Scan();
+	scan.setMaxVersions();
+	if (i < numberOfTests) {
+	  kvSet = kvMaps[i].values();
+	  for (String column : columnLists[i]) {
+	    scan.addColumn(familyBytes, Bytes.toBytes(column));
+	  }
+	  LOG.info("ExplicitColumns scanner");
+	  LOG.info("Columns: " + columnLists[i].size() + "  Keys: "
+	      + kvSet.size());
+	} else {
+	  kvSet = allKVMap.values();
+	  LOG.info("Wildcard scanner");
+	  LOG.info("Columns: " + allColumns.size() + "  Keys: " + kvSet.size());
+
+        }
+        InternalScanner scanner = region.getScanner(scan);
+        List<KeyValue> results = new ArrayList<KeyValue>();
+        while (scanner.next(results))
+          ;
+        assertEquals(kvSet.size(), results.size());
+        assertTrue(results.containsAll(kvSet));
       }
-      InternalScanner scanner = region.getScanner(scan);
-      List<KeyValue> results = new ArrayList<KeyValue>();
-      while (scanner.next(results))
-        ;
-      assertEquals(kvSet.size(), results.size());
-      assertTrue(results.containsAll(kvSet));
+    } finally {
+      HRegion.closeHRegion(region);
     }
   }
 

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
(original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
Mon Apr 23 14:34:53 2012
@@ -70,31 +70,34 @@ public class TestResettingCounters {
       }
     }
     HRegion region = HRegion.createHRegion(hri, path, conf);
+    try {
+      Increment odd = new Increment(rows[0]);
+      Increment even = new Increment(rows[0]);
+      Increment all = new Increment(rows[0]);
+      for (int i=0;i<numQualifiers;i++) {
+	if (i % 2 == 0) even.addColumn(families[0], qualifiers[i], 1);
+	else odd.addColumn(families[0], qualifiers[i], 1);
+	all.addColumn(families[0], qualifiers[i], 1);
+      }
 
-    Increment odd = new Increment(rows[0]);
-    Increment even = new Increment(rows[0]);
-    Increment all = new Increment(rows[0]);
-    for (int i=0;i<numQualifiers;i++) {
-      if (i % 2 == 0) even.addColumn(families[0], qualifiers[i], 1);
-      else odd.addColumn(families[0], qualifiers[i], 1);
-      all.addColumn(families[0], qualifiers[i], 1);
-    }
-
-    // increment odd qualifiers 5 times and flush
-    for (int i=0;i<5;i++) region.increment(odd, null, false);
-    region.flushcache();
+      // increment odd qualifiers 5 times and flush
+      for (int i=0;i<5;i++) region.increment(odd, null, false);
+      region.flushcache();
 
-    // increment even qualifiers 5 times
-    for (int i=0;i<5;i++) region.increment(even, null, false);
+      // increment even qualifiers 5 times
+      for (int i=0;i<5;i++) region.increment(even, null, false);
 
-    // increment all qualifiers, should have value=6 for all
-    Result result = region.increment(all, null, false);
-    assertEquals(numQualifiers, result.size());
-    KeyValue [] kvs = result.raw();
-    for (int i=0;i<kvs.length;i++) {
-      System.out.println(kvs[i].toString());
-      assertTrue(Bytes.equals(kvs[i].getQualifier(), qualifiers[i]));
-      assertEquals(6, Bytes.toLong(kvs[i].getValue()));
+      // increment all qualifiers, should have value=6 for all
+      Result result = region.increment(all, null, false);
+      assertEquals(numQualifiers, result.size());
+      KeyValue [] kvs = result.raw();
+      for (int i=0;i<kvs.length;i++) {
+	System.out.println(kvs[i].toString());
+	assertTrue(Bytes.equals(kvs[i].getQualifier(), qualifiers[i]));
+	assertEquals(6, Bytes.toLong(kvs[i].getValue()));
+      }
+    } finally {
+      HRegion.closeHRegion(region);
     }
   }
 }

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java
(original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java
Mon Apr 23 14:34:53 2012
@@ -117,6 +117,7 @@ public class TestOpenRegionHandler {
     // post OPENING; again will expect it to come back w/o NPE or exception.
     handler.process();
   }
+
   @Test
   public void testFailedOpenRegion() throws Exception {
     Server server = new MockServer();

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java (original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java Mon
Apr 23 14:34:53 2012
@@ -165,8 +165,8 @@ public class TestMergeTable {
       HRegion.addRegionToMETA(meta, r);
     }
     meta.close();
-    meta.getLog().closeAndDelete();
+    if (meta.getLog() != null) meta.getLog().closeAndDelete();
     root.close();
-    root.getLog().closeAndDelete();
+    if (root.getLog() != null) root.getLog().closeAndDelete();
   }
 }

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java?rev=1329260&r1=1329259&r2=1329260&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java (original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java Mon
Apr 23 14:34:53 2012
@@ -163,6 +163,13 @@ public class TestMergeTool extends HBase
   @Override
   public void tearDown() throws Exception {
     super.tearDown();
+    for (int i = 0; i < sourceRegions.length; i++) {
+      HRegion r = regions[i];
+      if (r != null) {
+        r.close();
+        if (r.getLog() != null) r.getLog().close();
+      }
+    }
     shutdownDfs(dfsCluster);
   }
 



Mime
View raw message