hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1343857 - in /hbase/trunk/hbase-server/src: main/java/org/apache/hadoop/hbase/master/ main/java/org/apache/hadoop/hbase/util/ test/java/org/apache/hadoop/hbase/ test/java/org/apache/hadoop/hbase/coprocessor/ test/java/org/apache/hadoop/hba...
Date Tue, 29 May 2012 17:12:10 GMT
Author: stack
Date: Tue May 29 17:12:09 2012
New Revision: 1343857

URL: http://svn.apache.org/viewvc?rev=1343857&view=rev
Log:
HBASE-6108 Use HRegion.closeHRegion instead of HRegion.close() and HRegion.getLog().close()

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestMultipleColumnPrefixFilter.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
Tue May 29 17:12:09 2012
@@ -405,10 +405,8 @@ public class MasterFileSystem {
       setInfoFamilyCachingForMeta(true);
       // Add first region from the META table to the ROOT region.
       HRegion.addRegionToMETA(root, meta);
-      root.close();
-      root.getLog().closeAndDelete();
-      meta.close();
-      meta.getLog().closeAndDelete();
+      HRegion.closeHRegion(root);
+      HRegion.closeHRegion(meta);
     } catch (IOException e) {
       e = RemoteExceptionHandler.checkIOException(e);
       LOG.error("bootstrap", e);

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java Tue
May 29 17:12:09 2012
@@ -705,8 +705,7 @@ public class HBaseFsck {
 
     // Add first region from the META table to the ROOT region.
     HRegion.addRegionToMETA(root, meta);
-    root.close();
-    root.getLog().closeAndDelete();
+    HRegion.closeHRegion(root);
     return meta;
   }
 
@@ -821,8 +820,7 @@ public class HBaseFsck {
       return false;
     }
     meta.put(puts.toArray(new Put[0]));
-    meta.close();
-    meta.getLog().closeAndDelete();
+    HRegion.closeHRegion(meta);
     LOG.info("Success! .META. table rebuilt.");
     return true;
   }

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestCase.java Tue
May 29 17:12:09 2012
@@ -681,14 +681,8 @@ public abstract class HBaseTestCase exte
   }
 
   protected void closeRootAndMeta() throws IOException {
-    if (meta != null) {
-      meta.close();
-      meta.getLog().closeAndDelete();
-    }
-    if (root != null) {
-      root.close();
-      root.getLog().closeAndDelete();
-    }
+    HRegion.closeHRegion(meta);
+    HRegion.closeHRegion(root);
   }
 
   public static void assertByteEquals(byte[] expected,

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java
Tue May 29 17:12:09 2012
@@ -237,8 +237,7 @@ public class TestCoprocessorInterface ex
     for (int i = 0; i < regions.length; i++) {
       regions[i] = reopenRegion(regions[i], CoprocessorImpl.class);
     }
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
     Coprocessor c = region.getCoprocessorHost().
       findCoprocessor(CoprocessorImpl.class.getName());
 
@@ -258,8 +257,7 @@ public class TestCoprocessorInterface ex
     assertTrue(((CoprocessorImpl)c).wasSplit());
 
     for (int i = 0; i < regions.length; i++) {
-      regions[i].close();
-      regions[i].getLog().closeAndDelete();
+      HRegion.closeHRegion(regions[i]);
       c = region.getCoprocessorHost()
             .findCoprocessor(CoprocessorImpl.class.getName());
       assertTrue("Coprocessor not started", ((CoprocessorImpl)c).wasStarted());

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java
Tue May 29 17:12:09 2012
@@ -98,12 +98,10 @@ public class TestColumnPrefixFilter {
         assertEquals(prefixMap.get(s).size(), results.size());
       }
     } finally {
-      region.close();
-      region.getLog().closeAndDelete();
+      HRegion.closeHRegion(region);
     }
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   @Test
@@ -165,12 +163,10 @@ public class TestColumnPrefixFilter {
         assertEquals(prefixMap.get(s).size(), results.size());
       }
     } finally {
-      region.close();
-      region.getLog().closeAndDelete();
+      HRegion.closeHRegion(region);
     }
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   List<String> generateRandomWords(int numberOfWords, String suffix) {

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java
Tue May 29 17:12:09 2012
@@ -82,8 +82,7 @@ public class TestDependentColumnFilter e
   @Override
   protected void tearDown() throws Exception {
     super.tearDown();
-    this.region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(this.region);
   }
 
   private void addData() throws IOException {

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestMultipleColumnPrefixFilter.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestMultipleColumnPrefixFilter.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestMultipleColumnPrefixFilter.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestMultipleColumnPrefixFilter.java
Tue May 29 17:12:09 2012
@@ -100,8 +100,7 @@ public class TestMultipleColumnPrefixFil
     while(scanner.next(results));
     assertEquals(prefixMap.get("p").size() + prefixMap.get("q").size(), results.size());
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   @Test
@@ -169,8 +168,7 @@ public class TestMultipleColumnPrefixFil
     while(scanner.next(results));
     assertEquals(prefixMap.get("p").size() + prefixMap.get("q").size(), results.size());
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
   
   @Test
@@ -225,8 +223,7 @@ public class TestMultipleColumnPrefixFil
     
     assertEquals(results1.size(), results2.size());
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
   
   List<String> generateRandomWords(int numberOfWords, String suffix) {

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java
Tue May 29 17:12:09 2012
@@ -160,8 +160,7 @@ public class TestOpenedRegionHandler {
       assertEquals("The region should not be opened successfully.", regionName,
           region.getRegionInfo().getEncodedName());
     } finally {
-      region.close();
-      region.getLog().closeAndDelete();
+      HRegion.closeHRegion(region);
       TEST_UTIL.shutdownMiniZKCluster();
     }
   }

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
Tue May 29 17:12:09 2012
@@ -156,8 +156,7 @@ public class TestColumnSeeking {
       HRegion.closeHRegion(region);
     }
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   @SuppressWarnings("unchecked")
@@ -265,8 +264,7 @@ public class TestColumnSeeking {
       assertTrue(results.containsAll(kvSet));
     }
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   List<String> generateRandomWords(int numberOfWords, String suffix) {

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
Tue May 29 17:12:09 2012
@@ -312,8 +312,7 @@ public class TestHRegion extends HBaseTe
         }
       } finally {
         if (this.region != null) {
-          this.region.close();
-          this.region.getLog().closeAndDelete();
+          HRegion.closeHRegion(this.region);
         }
       }
       done.set(true);
@@ -1608,8 +1607,7 @@ public class TestHRegion extends HBaseTe
       } finally {
         for (int i = 0; i < subregions.length; i++) {
           try {
-            subregions[i].close();
-            subregions[i].getLog().closeAndDelete();
+            HRegion.closeHRegion(subregions[i]);
           } catch (IOException e) {
             // Ignore.
           }

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java
Tue May 29 17:12:09 2012
@@ -134,8 +134,7 @@ public class TestKeepDeletes extends HBa
     checkResult(r, c0, c0, T1);
     assertEquals(0, countDeleteMarkers(region));
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   /**
@@ -184,8 +183,7 @@ public class TestKeepDeletes extends HBa
     scan.next(kvs);
     assertTrue(kvs.isEmpty());
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   /**
@@ -229,8 +227,7 @@ public class TestKeepDeletes extends HBa
     // major compaction deleted it
     assertEquals(0, countDeleteMarkers(region));
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   /**
@@ -253,8 +250,7 @@ public class TestKeepDeletes extends HBa
       // ok!
     }
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   /**
@@ -300,8 +296,7 @@ public class TestKeepDeletes extends HBa
     assertEquals(kvs.get(4).getValue(), T2);
     assertEquals(kvs.get(5).getValue(), T1);
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   /**
@@ -343,8 +338,7 @@ public class TestKeepDeletes extends HBa
     region.compactStores(true);
     assertEquals(0, countDeleteMarkers(region));
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   /**
@@ -406,8 +400,7 @@ public class TestKeepDeletes extends HBa
     region.compactStores(true);
     assertEquals(0, countDeleteMarkers(region));
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   /**
@@ -486,8 +479,7 @@ public class TestKeepDeletes extends HBa
     checkGet(region, T2, c1, c0, ts+3, T2, T1);
     checkGet(region, T2, c1, c1, ts+3, T2, T1);
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   /**
@@ -581,8 +573,7 @@ public class TestKeepDeletes extends HBa
     region.compactStores(true);
     assertEquals(1, countDeleteMarkers(region));
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   /**
@@ -632,8 +623,7 @@ public class TestKeepDeletes extends HBa
     assertEquals(4, kvs.size());
     scanner.close();
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   /**
@@ -710,8 +700,7 @@ public class TestKeepDeletes extends HBa
     region.compactStores(true);
     assertEquals(0, countDeleteMarkers(region));
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   private void checkGet(HRegion region, byte[] row, byte[] fam, byte[] col,

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java
Tue May 29 17:12:09 2012
@@ -88,8 +88,7 @@ public class TestMinVersions extends HBa
       r = region.getClosestRowBefore(T2, c0);
       checkResult(r, c0, T4);
     } finally {
-      region.close();
-      region.getLog().closeAndDelete();
+      HRegion.closeHRegion(region);
     }
   }
 
@@ -144,8 +143,7 @@ public class TestMinVersions extends HBa
       r = region.get(g, null);  // this'll use ExplicitColumnTracker
       checkResult(r, c0, T3,T2,T1);
     } finally {
-      region.close();
-      region.getLog().closeAndDelete();
+      HRegion.closeHRegion(region);
     }
   }
 
@@ -202,8 +200,7 @@ public class TestMinVersions extends HBa
       r = region.get(g, null);  // this'll use ExplicitColumnTracker
       checkResult(r, c0, T3);
     } finally {
-      region.close();
-      region.getLog().closeAndDelete();
+      HRegion.closeHRegion(region);
     }
   }
 
@@ -276,8 +273,7 @@ public class TestMinVersions extends HBa
       r = region.get(g, null);  // this'll use ExplicitColumnTracker
       checkResult(r, c0, T5,T4);
     } finally {
-      region.close();
-      region.getLog().closeAndDelete();
+      HRegion.closeHRegion(region);
     }
   }
 
@@ -367,8 +363,7 @@ public class TestMinVersions extends HBa
       r = region.get(g, null);
       assertTrue(r.isEmpty());
     } finally {
-      region.close();
-      region.getLog().closeAndDelete();
+      HRegion.closeHRegion(region);
     }
   }
 
@@ -441,8 +436,7 @@ public class TestMinVersions extends HBa
       r = region.get(g, null);
       checkResult(r, c0, T2);
     } finally {
-      region.close();
-      region.getLog().closeAndDelete();
+      HRegion.closeHRegion(region);
     }
   }
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
Tue May 29 17:12:09 2012
@@ -291,8 +291,7 @@ public class TestMultiColumnScanner {
         "pairs", lastDelTimeMap.size() > 0);
     LOG.info("Number of row/col pairs deleted at least once: " +
        lastDelTimeMap.size());
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   private static String getRowQualStr(KeyValue kv) {

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
Tue May 29 17:12:09 2012
@@ -97,8 +97,7 @@ public class TestResettingCounters {
     } finally {
       HRegion.closeHRegion(region);
     }
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   @org.junit.Rule

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java
Tue May 29 17:12:09 2012
@@ -113,8 +113,7 @@ public class TestScanWithBloomError {
     createStoreFile(new int[] {1, 9});
     scanColSet(new int[]{1, 4, 6, 7}, new int[]{1, 6, 7});
 
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
   }
 
   private void scanColSet(int[] colSet, int[] expectedResultCols)

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java
Tue May 29 17:12:09 2012
@@ -147,8 +147,7 @@ public class TestScanner extends HBaseTe
       assertTrue(count > 10);
       s.close();
     } finally {
-      this.r.close();
-      this.r.getLog().closeAndDelete();
+      HRegion.closeHRegion(this.r);
     }
   }
 
@@ -200,8 +199,7 @@ public class TestScanner extends HBaseTe
       rowInclusiveStopFilter(scan, stopRow);
 
     } finally {
-      this.r.close();
-      this.r.getLog().closeAndDelete();
+      HRegion.closeHRegion(this.r);
     }
   }
 
@@ -227,8 +225,7 @@ public class TestScanner extends HBaseTe
         return;
       }
     } finally {
-      this.r.close();
-      this.r.getLog().closeAndDelete();
+      HRegion.closeHRegion(this.r);
     }
   }
 
@@ -343,8 +340,7 @@ public class TestScanner extends HBaseTe
 
     } finally {
       // clean up
-      r.close();
-      r.getLog().closeAndDelete();
+      HRegion.closeHRegion(r);
     }
   }
 
@@ -464,8 +460,7 @@ public class TestScanner extends HBaseTe
       LOG.error("Failed", e);
       throw e;
     } finally {
-      this.r.close();
-      this.r.getLog().closeAndDelete();
+      HRegion.closeHRegion(this.r);
     }
   }
 
@@ -487,8 +482,7 @@ public class TestScanner extends HBaseTe
       LOG.error("Failed", e);
       throw e;
     } finally {
-      this.r.close();
-      this.r.getLog().closeAndDelete();
+      HRegion.closeHRegion(this.r);
     }
   }
 
@@ -549,8 +543,7 @@ public class TestScanner extends HBaseTe
       assertTrue(Bytes.BYTES_COMPARATOR.compare(fam2, results.get(1)
           .getFamily()) == 0);
     } finally {
-      this.r.close();
-      this.r.getLog().closeAndDelete();
+      HRegion.closeHRegion(this.r);
     }
   }
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java
Tue May 29 17:12:09 2012
@@ -440,8 +440,7 @@ public class TestSeekOptimizations {
   @After
   public void tearDown() throws IOException {
     if (region != null) {
-      region.close();
-      region.getLog().closeAndDelete();
+      HRegion.closeHRegion(region);
     }
 
     // We have to re-set the lazy seek flag back to the default so that other

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java
Tue May 29 17:12:09 2012
@@ -219,8 +219,7 @@ public class TestSplitTransaction {
         assertTrue(count > 0 && count != rowcount);
         daughtersRowCount += count;
       } finally {
-        openRegion.close();
-        openRegion.getLog().closeAndDelete();
+        HRegion.closeHRegion(openRegion);
       }
     }
     assertEquals(rowcount, daughtersRowCount);
@@ -275,8 +274,7 @@ public class TestSplitTransaction {
         assertTrue(count > 0 && count != rowcount);
         daughtersRowCount += count;
       } finally {
-        openRegion.close();
-        openRegion.getLog().closeAndDelete();
+        HRegion.closeHRegion(openRegion);
       }
     }
     assertEquals(rowcount, daughtersRowCount);
@@ -316,8 +314,7 @@ public class TestSplitTransaction {
     htd.addFamily(hcd);
     HRegionInfo hri = new HRegionInfo(htd.getName(), STARTROW, ENDROW);
     HRegion r = HRegion.createHRegion(hri, testdir, TEST_UTIL.getConfiguration(), htd);
-    r.close();
-    r.getLog().closeAndDelete();
+    HRegion.closeHRegion(r);
     return HRegion.openHRegion(testdir, hri, htd, wal,
       TEST_UTIL.getConfiguration());
   }

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java
Tue May 29 17:12:09 2012
@@ -131,8 +131,7 @@ public class TestWideScanner extends HBa
 
       s.close();
     } finally {
-      this.r.close();
-      this.r.getLog().closeAndDelete();
+      HRegion.closeHRegion(this.r);
     }
   }
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java
Tue May 29 17:12:09 2012
@@ -135,8 +135,7 @@ public class TestWALReplay {
     HTableDescriptor htd = createBasic3FamilyHTD(tableNameStr);
     HRegion region2 = HRegion.createHRegion(hri,
         hbaseRootDir, this.conf, htd);
-    region2.close();
-    region2.getLog().closeAndDelete();
+    HRegion.closeHRegion(region2);
     final byte [] tableName = Bytes.toBytes(tableNameStr);
     final byte [] rowName = tableName;
 
@@ -196,8 +195,7 @@ public class TestWALReplay {
     final HTableDescriptor htd = createBasic3FamilyHTD(tableNameStr);
     HRegion region2 = HRegion.createHRegion(hri,
         hbaseRootDir, this.conf, htd);
-    region2.close();
-    region2.getLog().closeAndDelete();
+    HRegion.closeHRegion(region2);
     HLog wal = createWAL(this.conf);
     HRegion region = HRegion.openHRegion(hri, htd, wal, this.conf);
     Path f =  new Path(basedir, "hfile");
@@ -257,8 +255,7 @@ public class TestWALReplay {
     final HTableDescriptor htd = createBasic3FamilyHTD(tableNameStr);
     HRegion region3 = HRegion.createHRegion(hri,
             hbaseRootDir, this.conf, htd);
-    region3.close();
-    region3.getLog().closeAndDelete();
+    HRegion.closeHRegion(region3);
     // Write countPerFamily edits into the three families.  Do a flush on one
     // of the families during the load of edits so its seqid is not same as
     // others to test we do right thing when different seqids.
@@ -375,8 +372,7 @@ public class TestWALReplay {
     final HTableDescriptor htd = createBasic3FamilyHTD(tableNameStr);
     HRegion region3 = HRegion.createHRegion(hri,
             hbaseRootDir, this.conf, htd);
-    region3.close();
-    region3.getLog().closeAndDelete();
+    HRegion.closeHRegion(region3);
     // Write countPerFamily edits into the three families.  Do a flush on one
     // of the families during the load of edits so its seqid is not same as
     // others to test we do right thing when different seqids.
@@ -442,8 +438,7 @@ public class TestWALReplay {
     final HTableDescriptor htd = createBasic3FamilyHTD(tableNameStr);
     HRegion region2 = HRegion.createHRegion(hri,
             hbaseRootDir, this.conf, htd);
-    region2.close();
-    region2.getLog().closeAndDelete();
+    HRegion.closeHRegion(region2);
     final HLog wal = createWAL(this.conf);
     final byte[] tableName = Bytes.toBytes(tableNameStr);
     final byte[] rowName = tableName;

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTable.java
Tue May 29 17:12:09 2012
@@ -150,8 +150,7 @@ public class TestMergeTable {
         region.flushcache();
       }
     }
-    region.close();
-    region.getLog().closeAndDelete();
+    HRegion.closeHRegion(region);
     return region;
   }
 
@@ -167,10 +166,8 @@ public class TestMergeTable {
     for (HRegion r: regions) {
       HRegion.addRegionToMETA(meta, r);
     }
-    meta.close();
-    meta.getLog().closeAndDelete();
-    root.close();
-    root.getLog().closeAndDelete();
+    HRegion.closeHRegion(meta);
+    HRegion.closeHRegion(root);
   }
 
   @org.junit.Rule

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java?rev=1343857&r1=1343856&r2=1343857&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java
Tue May 29 17:12:09 2012
@@ -172,8 +172,7 @@ public class TestMergeTool extends HBase
     for (int i = 0; i < sourceRegions.length; i++) {
       HRegion r = regions[i];
       if (r != null) {
-        r.close();
-        r.getLog().closeAndDelete();
+        HRegion.closeHRegion(r);
       }
     }
     TEST_UTIL.shutdownMiniCluster();
@@ -260,8 +259,7 @@ public class TestMergeTool extends HBase
         assertTrue(Bytes.equals(bytes, rows[i][j]));
       }
       // Close the region and delete the log
-      regions[i].close();
-      regions[i].getLog().closeAndDelete();
+      HRegion.closeHRegion(regions[i]);
     }
 
     // Create a log that we can reuse when we need to open regions



Mime
View raw message