org.apache.hadoop.hbase.master
Class ActiveMasterManager

java.lang.Object
  extended by org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
      extended by org.apache.hadoop.hbase.master.ActiveMasterManager

@InterfaceAudience.Private
public class ActiveMasterManager
extends ZooKeeperListener

Handles everything on master-side related to master election.

Listens and responds to ZooKeeper notifications on the master znode, both nodeCreated and nodeDeleted.

Contains blocking methods which will hold up backup masters, waiting for the active master to fail.

This class is instantiated in the HMaster constructor and the method #blockUntilBecomingActiveMaster() is called to wait until becoming the active master of the cluster.


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
watcher
 
Method Summary
 boolean isActiveMaster()
           
 void nodeCreated(String path)
           
 void nodeDeleted(String path)
           
 void stop()
           
 
Methods inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
getWatcher, nodeChildrenChanged, nodeDataChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

nodeCreated

public void nodeCreated(String path)
Overrides:
nodeCreated in class ZooKeeperListener

nodeDeleted

public void nodeDeleted(String path)
Overrides:
nodeDeleted in class ZooKeeperListener

isActiveMaster

public boolean isActiveMaster()
Returns:
True if cluster has an active master.

stop

public void stop()


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.