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)
          Called when a new node has been created.
 void nodeDeleted(String path)
          Called when a node has been deleted
 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)
Description copied from class: ZooKeeperListener
Called when a new node has been created.

Overrides:
nodeCreated in class ZooKeeperListener
Parameters:
path - full path of the new node

nodeDeleted

public void nodeDeleted(String path)
Description copied from class: ZooKeeperListener
Called when a node has been deleted

Overrides:
nodeDeleted in class ZooKeeperListener
Parameters:
path - full path of the deleted node

isActiveMaster

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

stop

public void stop()


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.