@InterfaceAudience.Private @InterfaceStability.Unstable public class CuratorBasedElectorService extends org.apache.hadoop.service.AbstractService implements EmbeddedElector, org.apache.curator.framework.recipes.leader.LeaderLatchListener
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOG |
Constructor and Description |
---|
CuratorBasedElectorService(RMContext rmContext,
ResourceManager rm) |
Modifier and Type | Method and Description |
---|---|
org.apache.curator.framework.CuratorFramework |
getCuratorClient() |
String |
getZookeeperConnectionState()
Get information about the elector's connection to Zookeeper.
|
void |
isLeader() |
void |
notLeader() |
void |
rejoinElection()
Leave and rejoin leader election.
|
protected void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
protected void |
serviceStop() |
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceStart, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
public CuratorBasedElectorService(RMContext rmContext, ResourceManager rm)
protected void serviceInit(org.apache.hadoop.conf.Configuration conf) throws Exception
serviceInit
in class org.apache.hadoop.service.AbstractService
Exception
protected void serviceStop() throws Exception
serviceStop
in class org.apache.hadoop.service.AbstractService
Exception
public void rejoinElection()
EmbeddedElector
rejoinElection
in interface EmbeddedElector
public String getZookeeperConnectionState()
EmbeddedElector
getZookeeperConnectionState
in interface EmbeddedElector
public void isLeader()
isLeader
in interface org.apache.curator.framework.recipes.leader.LeaderLatchListener
public void notLeader()
notLeader
in interface org.apache.curator.framework.recipes.leader.LeaderLatchListener
public org.apache.curator.framework.CuratorFramework getCuratorClient()
Copyright © 2017 Apache Software Foundation. All Rights Reserved.