org.apache.hadoop.hbase.util
Class HBaseFsckRepair

java.lang.Object
  extended by org.apache.hadoop.hbase.util.HBaseFsckRepair

public class HBaseFsckRepair
extends Object

This class contains helper methods that repair parts of hbase's filesystem contents.


Field Summary
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
HBaseFsckRepair()
           
 
Method Summary
static void closeRegionSilentlyAndWait(HBaseAdmin admin, ServerName server, HRegionInfo region)
          Contacts a region server and waits up to hbase.hbck.close.timeout ms (default 120s) to close the region.
static HRegion createHDFSRegionDir(org.apache.hadoop.conf.Configuration conf, HRegionInfo hri, HTableDescriptor htd)
          Creates, flushes, and closes a new region.
static void fixMetaHoleOnline(org.apache.hadoop.conf.Configuration conf, HRegionInfo hri)
          Puts the specified HRegionInfo into META.
static void fixMultiAssignment(HBaseAdmin admin, HRegionInfo region, List<ServerName> servers)
          Fix multiple assignment by doing silent closes on each RS hosting the region and then force ZK unassigned node to OFFLINE to trigger assignment by master.
static void fixUnassigned(HBaseAdmin admin, HRegionInfo region)
          Fix unassigned by creating/transition the unassigned ZK node for this region to OFFLINE state with a special flag to tell the master that this is a forced operation by HBCK.
static void waitUntilAssigned(HBaseAdmin admin, HRegionInfo region)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
Constructor Detail

HBaseFsckRepair

public HBaseFsckRepair()
Method Detail

fixMultiAssignment

public static void fixMultiAssignment(HBaseAdmin admin,
                                      HRegionInfo region,
                                      List<ServerName> servers)
                               throws IOException,
                                      org.apache.zookeeper.KeeperException,
                                      InterruptedException
Fix multiple assignment by doing silent closes on each RS hosting the region and then force ZK unassigned node to OFFLINE to trigger assignment by master.

Parameters:
admin - HBase admin used to undeploy
region - Region to undeploy
servers - list of Servers to undeploy from
Throws:
IOException
org.apache.zookeeper.KeeperException
InterruptedException

fixUnassigned

public static void fixUnassigned(HBaseAdmin admin,
                                 HRegionInfo region)
                          throws IOException,
                                 org.apache.zookeeper.KeeperException
Fix unassigned by creating/transition the unassigned ZK node for this region to OFFLINE state with a special flag to tell the master that this is a forced operation by HBCK. This assumes that info is in META.

Parameters:
conf -
region -
Throws:
IOException
org.apache.zookeeper.KeeperException

waitUntilAssigned

public static void waitUntilAssigned(HBaseAdmin admin,
                                     HRegionInfo region)
                              throws IOException,
                                     InterruptedException
Throws:
IOException
InterruptedException

closeRegionSilentlyAndWait

public static void closeRegionSilentlyAndWait(HBaseAdmin admin,
                                              ServerName server,
                                              HRegionInfo region)
                                       throws IOException,
                                              InterruptedException
Contacts a region server and waits up to hbase.hbck.close.timeout ms (default 120s) to close the region. This bypasses the active hmaster.

Throws:
IOException
InterruptedException

fixMetaHoleOnline

public static void fixMetaHoleOnline(org.apache.hadoop.conf.Configuration conf,
                                     HRegionInfo hri)
                              throws IOException
Puts the specified HRegionInfo into META.

Throws:
IOException

createHDFSRegionDir

public static HRegion createHDFSRegionDir(org.apache.hadoop.conf.Configuration conf,
                                          HRegionInfo hri,
                                          HTableDescriptor htd)
                                   throws IOException
Creates, flushes, and closes a new region.

Throws:
IOException


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.