org.apache.hadoop.hbase.regionserver
Class RSZookeeperUpdater

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.RSZookeeperUpdater

public class RSZookeeperUpdater
extends Object

This is a helper class for region servers to update various states in Zookeeper. The various updates are abstracted out here. The "startRegionXXX" methods are to be called first, followed by the "finishRegionXXX" methods. Supports updating zookeeper periodically as a part of the "startRegionXXX". Currently handles the following state updates: - Close region - Open region


Constructor Summary
RSZookeeperUpdater(org.apache.hadoop.conf.Configuration conf, String regionServerName, String regionName)
           
RSZookeeperUpdater(org.apache.hadoop.conf.Configuration conf, String regionServerName, String regionName, int zkVersion)
           
 
Method Summary
 void abortOpenRegion(HMsg hmsg)
           
 void finishRegionCloseEvent(HMsg hmsg)
          This method updates the states in ZK to signal that the region has been closed.
 void finishRegionOpenEvent(HMsg hmsg)
          This method updates the states in ZK to signal that the region has been opened.
 boolean isClosingRegion()
           
 boolean isOpeningRegion()
           
 void startRegionCloseEvent(HMsg hmsg, boolean updatePeriodically)
          This method updates the various states in ZK to inform the master that the region server has started closing the region.
 void startRegionOpenEvent(HMsg hmsg, boolean updatePeriodically)
          This method updates the various states in ZK to inform the master that the region server has started opening the region.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RSZookeeperUpdater

public RSZookeeperUpdater(org.apache.hadoop.conf.Configuration conf,
                          String regionServerName,
                          String regionName)

RSZookeeperUpdater

public RSZookeeperUpdater(org.apache.hadoop.conf.Configuration conf,
                          String regionServerName,
                          String regionName,
                          int zkVersion)
Method Detail

startRegionCloseEvent

public void startRegionCloseEvent(HMsg hmsg,
                                  boolean updatePeriodically)
                           throws IOException
This method updates the various states in ZK to inform the master that the region server has started closing the region.

Parameters:
updatePeriodically - - if true, periodically updates the state in ZK
Throws:
IOException

finishRegionCloseEvent

public void finishRegionCloseEvent(HMsg hmsg)
                            throws IOException
This method updates the states in ZK to signal that the region has been closed. This will stop the periodic updater thread if one was started.

Throws:
IOException

startRegionOpenEvent

public void startRegionOpenEvent(HMsg hmsg,
                                 boolean updatePeriodically)
                          throws IOException
This method updates the various states in ZK to inform the master that the region server has started opening the region.

Parameters:
updatePeriodically - - if true, periodically updates the state in ZK
Throws:
IOException

finishRegionOpenEvent

public void finishRegionOpenEvent(HMsg hmsg)
                           throws IOException
This method updates the states in ZK to signal that the region has been opened. This will stop the periodic updater thread if one was started.

Throws:
IOException

isClosingRegion

public boolean isClosingRegion()

isOpeningRegion

public boolean isOpeningRegion()

abortOpenRegion

public void abortOpenRegion(HMsg hmsg)
                     throws IOException
Throws:
IOException


Copyright © 2010 Apache Software Foundation. All Rights Reserved.