NNHAServiceTarget (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.tools, class: NNHAServiceTarget

Package org.apache.hadoop.hdfs.tools

# Class NNHAServiceTarget

java.lang.Object
org.apache.hadoop.ha.HAServiceTarget
org.apache.hadoop.hdfs.tools.NNHAServiceTarget

@Private public class NNHAServiceTarget extends org.apache.hadoop.ha.HAServiceTarget
One of the NN NameNodes acting as the target of an administrative command (e.g. failover).

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NNHAServiceTarget(org.apache.hadoop.conf.Configuration conf, String nsId, String nnId)`
  Create a NNHAServiceTarget for a namenode.
  `NNHAServiceTarget(org.apache.hadoop.conf.Configuration conf, String nsId, String nnId, String addr, String lifelineAddr)`
  Create a NNHAServiceTarget for a namenode.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `addFencingParameters(Map<String,String> ret)`
  `void`
  `checkFencingConfigured()`
  `InetSocketAddress`
  `getAddress()`
  `org.apache.hadoop.ha.NodeFencer`
  `getFencer()`
  `InetSocketAddress`
  `getHealthMonitorAddress()`
  `String`
  `getNameNodeId()`
  `String`
  `getNameServiceId()`
  `InetSocketAddress`
  `getZKFCAddress()`
  `boolean`
  `isAutoFailoverEnabled()`
  `boolean`
  `supportObserver()`
  `String`
  `toString()`

  ### Methods inherited from class org.apache.hadoop.ha.HAServiceTarget

  `getFencingParameters, getHealthMonitorProxy, getHealthMonitorProxy, getProxy, getTransitionTargetHAStatus, getZKFCProxy, setTransitionTargetHAStatus`

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

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

- ## Constructor Details

  - ### NNHAServiceTarget

    public NNHAServiceTarget(org.apache.hadoop.conf.Configuration conf, String nsId, String nnId)
    Create a NNHAServiceTarget for a namenode. Look up addresses from configuration.
    Parameters:
      `conf` - HDFS configuration.
      `nsId` - nsId of this nn.
      `nnId` - nnId of this nn.

  - ### NNHAServiceTarget

    public NNHAServiceTarget(org.apache.hadoop.conf.Configuration conf, String nsId, String nnId, String addr, String lifelineAddr)
    Create a NNHAServiceTarget for a namenode. Addresses are provided so we don't need to lookup the config.
    Parameters:
      `conf` - HDFS configuration.
      `nsId` - nsId of this nn.
      `nnId` - nnId of this nn.
      `addr` - Provided service address.
      `lifelineAddr` - Provided lifeline address.

- ## Method Details

  - ### getAddress

    public InetSocketAddress getAddress()
    Specified by:
      `getAddress` in class `org.apache.hadoop.ha.HAServiceTarget`
    Returns:
      the NN's IPC address.

  - ### getHealthMonitorAddress

    public InetSocketAddress getHealthMonitorAddress()
    Overrides:
      `getHealthMonitorAddress` in class `org.apache.hadoop.ha.HAServiceTarget`

  - ### getZKFCAddress

    public InetSocketAddress getZKFCAddress()
    Specified by:
      `getZKFCAddress` in class `org.apache.hadoop.ha.HAServiceTarget`

  - ### checkFencingConfigured

    public void checkFencingConfigured() throws org.apache.hadoop.ha.BadFencingConfigurationException
    Specified by:
      `checkFencingConfigured` in class `org.apache.hadoop.ha.HAServiceTarget`
    Throws:
      `org.apache.hadoop.ha.BadFencingConfigurationException`

  - ### getFencer

    public org.apache.hadoop.ha.NodeFencer getFencer()
    Specified by:
      `getFencer` in class `org.apache.hadoop.ha.HAServiceTarget`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getNameServiceId

    public String getNameServiceId()

  - ### getNameNodeId

    public String getNameNodeId()

  - ### addFencingParameters

    protected void addFencingParameters(Map<String,String> ret)
    Overrides:
      `addFencingParameters` in class `org.apache.hadoop.ha.HAServiceTarget`

  - ### isAutoFailoverEnabled

    public boolean isAutoFailoverEnabled()
    Overrides:
      `isAutoFailoverEnabled` in class `org.apache.hadoop.ha.HAServiceTarget`

  - ### supportObserver

    public boolean supportObserver()
    Overrides:
      `supportObserver` in class `org.apache.hadoop.ha.HAServiceTarget`