Class DFSHAAdmin

java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.ha.HAAdmin
org.apache.hadoop.hdfs.tools.DFSHAAdmin
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool

public class DFSHAAdmin extends org.apache.hadoop.ha.HAAdmin
Class to extend HAAdmin to do a little bit of HDFS-specific configuration.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.hadoop.ha.HAAdmin

    org.apache.hadoop.ha.HAAdmin.UsageInfo
  • Field Summary

    Fields inherited from class org.apache.hadoop.ha.HAAdmin

    errOut, FORCEACTIVE, FORCEMANUAL, out, USAGE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.hadoop.conf.Configuration
    addSecurityConfiguration(org.apache.hadoop.conf.Configuration conf)
    Add the requisite security principal settings to the given Configuration, returning a copy.
    protected boolean
     
    protected Collection<String>
    getTargetIds(String namenodeToActivate)
    returns the list of all namenode ids for the given configuration.
    protected String
     
    static void
    main(String[] argv)
     
    protected org.apache.hadoop.ha.HAServiceTarget
    Try to map the given namenode ID to its service address.
    protected int
    runCmd(String[] argv)
     
    void
    setConf(org.apache.hadoop.conf.Configuration conf)
     
    protected void
     
    protected void
     

    Methods inherited from class org.apache.hadoop.ha.HAAdmin

    checkManualStateManagementOK, checkParameterValidity, confirmForceManual, createReqInfo, getAllServiceState, getRequestSource, getServiceAddr, gracefulFailoverThroughZKFCs, help, help, parseOpts, parseOpts, printUsage, printUsage, printUsage, printUsage, run, setRequestSource

    Methods inherited from class org.apache.hadoop.conf.Configured

    getConf

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.apache.hadoop.conf.Configurable

    getConf
  • Constructor Details

    • DFSHAAdmin

      public DFSHAAdmin()
  • Method Details

    • setErrOut

      protected void setErrOut(PrintStream errOut)
    • setOut

      protected void setOut(PrintStream out)
    • setConf

      public void setConf(org.apache.hadoop.conf.Configuration conf)
      Specified by:
      setConf in interface org.apache.hadoop.conf.Configurable
      Overrides:
      setConf in class org.apache.hadoop.ha.HAAdmin
    • addSecurityConfiguration

      public static org.apache.hadoop.conf.Configuration addSecurityConfiguration(org.apache.hadoop.conf.Configuration conf)
      Add the requisite security principal settings to the given Configuration, returning a copy.
      Parameters:
      conf - the original config
      Returns:
      a copy with the security settings added
    • resolveTarget

      protected org.apache.hadoop.ha.HAServiceTarget resolveTarget(String nnId)
      Try to map the given namenode ID to its service address.
      Specified by:
      resolveTarget in class org.apache.hadoop.ha.HAAdmin
    • getUsageString

      protected String getUsageString()
      Overrides:
      getUsageString in class org.apache.hadoop.ha.HAAdmin
    • checkParameterValidity

      protected boolean checkParameterValidity(String[] argv)
      Overrides:
      checkParameterValidity in class org.apache.hadoop.ha.HAAdmin
    • runCmd

      protected int runCmd(String[] argv) throws Exception
      Overrides:
      runCmd in class org.apache.hadoop.ha.HAAdmin
      Throws:
      Exception
    • getTargetIds

      protected Collection<String> getTargetIds(String namenodeToActivate)
      returns the list of all namenode ids for the given configuration.
      Overrides:
      getTargetIds in class org.apache.hadoop.ha.HAAdmin
    • main

      public static void main(String[] argv) throws Exception
      Throws:
      Exception