Review Board 1.7.22


HBASE-4377 [hbck] Offline rebuild .META. from fs data only -- 0.90 version.

Review Request #2287 - Created Oct. 7, 2011 and submitted

Jonathan Hsieh
0.90
HBASE-4377
Reviewers
hbase
tedyu
hbase-git
Backport to 0.90

commit 89862b73c6358e27220b87b0362599d86ab0fe4a
Author: Jonathan Hsieh <jon@cloudera.com>
Date:   Wed Sep 28 10:18:11 2011 -0700

    HBASE-4377 [hbck] Offline rebuild .META. from fs data only
    
Note, the assertion test result is different in the failure cases due to HBASE-451 changes. (0.90 returns 0 tables since it does a meta scan on empty meta, trunk branch looks at hdfs dirs, and returns 1).

This version passes after HBASE-4508 (backport HBASE-3777 to 0.90 branch) is applied. 

I believe if that patch is not applied, I could modify the test code to force some explicit HConnection deletions.
src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
Revision ef246c3 New Change
[20] 285 lines
[+20] [+] private static void bootstrap(final Path rd, final Configuration c)
286
      throw e;
286
      throw e;
287
    }
287
    }
288
  }
288
  }
289

    
   
289

   
290
  /**
290
  /**

    
   
291
   * Enable in-memory caching for specified region.

    
   
292
   *
291
   * @param hri Set all family block caching to <code>b</code>
293
   * @param hri Set all family block caching to <code>b</code>
292
   * @param b
294
   * @param b
293
   */
295
   */
294
  private static void setInfoFamilyCaching(final HRegionInfo hri, final boolean b) {
296
  public static void setInfoFamilyCaching(final HRegionInfo hri, final boolean b) {
295
    for (HColumnDescriptor hcd: hri.getTableDesc().families.values()) {
297
    for (HColumnDescriptor hcd: hri.getTableDesc().families.values()) {
296
      if (Bytes.equals(hcd.getName(), HConstants.CATALOG_FAMILY)) {
298
      if (Bytes.equals(hcd.getName(), HConstants.CATALOG_FAMILY)) {
297
        hcd.setBlockCacheEnabled(b);
299
        hcd.setBlockCacheEnabled(b);
298
        hcd.setInMemory(b);
300
        hcd.setInMemory(b);
299
      }
301
      }
[+20] [20] 24 lines
src/main/java/org/apache/hadoop/hbase/util/Bytes.java
Revision 13ad026 New Change
 
src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
Revision e0bd77e New Change
 
src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java
Revision a981f72 New Change
 
src/main/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRepair.java
New File
 
src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
Revision bd3b2f3 New Change
 
src/test/java/org/apache/hadoop/hbase/util/hbck/HbckTestingUtil.java
New File
 
src/test/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRebuildTestCore.java
New File
 
src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildBase.java
New File
 
src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildHole.java
New File
 
src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildOverlap.java
New File
 
  1. src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java: Loading...
  2. src/main/java/org/apache/hadoop/hbase/util/Bytes.java: Loading...
  3. src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java: Loading...
  4. src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java: Loading...
  5. src/main/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRepair.java: Loading...
  6. src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java: Loading...
  7. src/test/java/org/apache/hadoop/hbase/util/hbck/HbckTestingUtil.java: Loading...
  8. src/test/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRebuildTestCore.java: Loading...
  9. src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildBase.java: Loading...
  10. src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildHole.java: Loading...
  11. src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildOverlap.java: Loading...