@InterfaceAudience.Private public class ActiveMasterManager extends ZooKeeperListener
Listens and responds to ZooKeeper notifications on the master znodes,
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.
watcher| Modifier and Type | Method and Description |
|---|---|
ServerName |
getActiveMasterServerName() |
List<ServerName> |
getBackupMasters() |
void |
nodeChildrenChanged(String path)
Called when an existing node has a child node added or removed.
|
void |
nodeCreated(String path)
Called when a new node has been created.
|
void |
nodeDeleted(String path)
Called when a node has been deleted
|
void |
setInfoPort(int infoPort) |
void |
stop() |
getWatcher, nodeDataChangedpublic void setInfoPort(int infoPort)
public void nodeCreated(String path)
ZooKeeperListenernodeCreated in class ZooKeeperListenerpath - full path of the new nodepublic void nodeChildrenChanged(String path)
ZooKeeperListenernodeChildrenChanged in class ZooKeeperListenerpath - full path of the node whose children have changedpublic void nodeDeleted(String path)
ZooKeeperListenernodeDeleted in class ZooKeeperListenerpath - full path of the deleted nodepublic ServerName getActiveMasterServerName()
public void stop()
public List<ServerName> getBackupMasters()
Copyright © 2007–2022 The Apache Software Foundation. All rights reserved.