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 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