ZKFailoverController (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.ha, class: ZKFailoverController

Package org.apache.hadoop.ha

# Class ZKFailoverController

java.lang.Object
org.apache.hadoop.ha.ZKFailoverController

@LimitedPrivate("HDFS") public abstract class ZKFailoverController extends Object

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Configuration`
  `conf`
  `protected final HAServiceTarget`
  `localTarget`
  `protected ZKFCRpcServer`
  `rpcServer`
  `protected static final String`
  `USAGE`
  `static final String`
  `ZK_ACL_KEY`
  `static final String`
  `ZK_AUTH_KEY`
  `static final String`
  `ZK_QUORUM_KEY`
  `protected static final String[]`
  `ZKFC_CONF_KEYS`
  All of the conf keys used by the ZKFC.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `ZKFailoverController(Configuration conf, HAServiceTarget localTarget)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected abstract void`
  `checkRpcAdminAccess()`
  `protected abstract HAServiceTarget`
  `dataToTarget(byte[] data)`
  `protected abstract List<HAServiceTarget>`
  `getAllOtherNodes()`
  `ActiveStandbyElector`
  `getElectorForTests()`
  `protected HealthMonitor.State`
  `getLastHealthState()`
  `HAServiceTarget`
  `getLocalTarget()`
  `protected abstract PolicyProvider`
  `getPolicyProvider()`
  `protected abstract InetSocketAddress`
  `getRpcAddressToBindTo()`
  `protected abstract String`
  `getScopeInsideParentNode()`
  Return the name of a znode inside the configured parent znode in which the ZKFC will do all of its work.
  `HAServiceProtocol.HAServiceState`
  `getServiceState()`
  `protected void`
  `initRPC()`
  `protected abstract boolean`
  `isSSLEnabled()`
  `protected abstract void`
  `loginAsFCUser()`
  `int`
  `run(String[] args)`
  `protected void`
  `setLastHealthState(HealthMonitor.State newState)`
  `protected void`
  `startRPC()`
  `protected abstract byte[]`
  `targetToData(HAServiceTarget target)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### ZK_QUORUM_KEY

    public static final String ZK_QUORUM_KEY
    See Also:
      - Constant Field Values

  - ### ZK_ACL_KEY

    public static final String ZK_ACL_KEY
    See Also:
      - Constant Field Values

  - ### ZK_AUTH_KEY

    public static final String ZK_AUTH_KEY
    See Also:
      - Constant Field Values

  - ### ZKFC_CONF_KEYS

    protected static final String[] ZKFC_CONF_KEYS
    All of the conf keys used by the ZKFC. This is used in order to allow them to be overridden on a per-nameservice or per-namenode basis.

  - ### USAGE

    protected static final String USAGE
    See Also:
      - Constant Field Values

  - ### conf

    protected Configuration conf

  - ### localTarget

    protected final HAServiceTarget localTarget

  - ### rpcServer

    protected ZKFCRpcServer rpcServer

- ## Constructor Details

  - ### ZKFailoverController

    protected ZKFailoverController(Configuration conf, HAServiceTarget localTarget)

- ## Method Details

  - ### targetToData

    protected abstract byte[] targetToData(HAServiceTarget target)

  - ### dataToTarget

    protected abstract HAServiceTarget dataToTarget(byte[] data)

  - ### loginAsFCUser

    protected abstract void loginAsFCUser() throws IOException
    Throws:
      `IOException`

  - ### checkRpcAdminAccess

    protected abstract void checkRpcAdminAccess() throws AccessControlException, IOException
    Throws:
      `AccessControlException`
      `IOException`

  - ### getRpcAddressToBindTo

    protected abstract InetSocketAddress getRpcAddressToBindTo()

  - ### getPolicyProvider

    protected abstract PolicyProvider getPolicyProvider()

  - ### getAllOtherNodes

    protected abstract List<HAServiceTarget> getAllOtherNodes()

  - ### isSSLEnabled

    protected abstract boolean isSSLEnabled()

  - ### getScopeInsideParentNode

    protected abstract String getScopeInsideParentNode()
    Return the name of a znode inside the configured parent znode in which the ZKFC will do all of its work. This is so that multiple federated nameservices can run on the same ZK quorum without having to manually configure them to separate subdirectories.
    Returns:
      ScopeInsideParentNode.

  - ### getLocalTarget

    public HAServiceTarget getLocalTarget()

  - ### getServiceState

    @VisibleForTesting public HAServiceProtocol.HAServiceState getServiceState()

  - ### run

    public int run(String[] args) throws Exception
    Throws:
      `Exception`

  - ### initRPC

    protected void initRPC() throws IOException
    Throws:
      `IOException`

  - ### startRPC

    protected void startRPC() throws IOException
    Throws:
      `IOException`

  - ### getLastHealthState

    protected HealthMonitor.State getLastHealthState()
    Returns:
      the last health state passed to the FC by the HealthMonitor.

  - ### setLastHealthState

    protected void setLastHealthState(HealthMonitor.State newState)

  - ### getElectorForTests

    @VisibleForTesting public ActiveStandbyElector getElectorForTests()