Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-15701

The constant used in "getProxy()" in HAAdmin.java should be configurable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • conf, ha
    • None

    Description

      The constant value used in getProxy() in HAAdmin.java should be configurable

      In HAAdmin.java, the "HAServiceTarget.getProxy()" is used 6 times. In 3 times of usage in method "getAllServiceState()", "getServiceState()" and "checkHealth()", the timeout as the second parameter is configurable (with configuration option "ha.failover-controller.cli-check.rpc-timeout.ms").

      HAAdmin.java
        ...
        rpcTimeoutForChecks = conf.getInt(
                CommonConfigurationKeys.HA_FC_CLI_CHECK_TIMEOUT_KEY,
                CommonConfigurationKeys.HA_FC_CLI_CHECK_TIMEOUT_DEFAULT);
      
      HAAdmin.java
        protected int getAllServiceState() {
            ...
            HAServiceProtocol proto = target.getProxy(getConf(),
                  rpcTimeoutForChecks);
            ...
        }  
      
      HAAdmin.java
        private int checkHealth(final CommandLine cmd)
            throws IOException, ServiceFailedException {
          ...
          HAServiceProtocol proto = resolveTarget(argv[0]).getProxy(
              getConf(), rpcTimeoutForChecks);
          ...
        }
      
        private int getServiceState(final CommandLine cmd)
            throws IOException, ServiceFailedException {
          ...
          HAServiceProtocol proto = resolveTarget(argv[0]).getProxy(
              getConf(), rpcTimeoutForChecks);
          ...
        }
      

      However, the other 3 times of usage is not configurable in method "transitionToActive()", "isOtherTargetNodeActive()", and "transitionToStandby()". The constants used in "HAServiceTarget.getProxy()" in these three method are 0, 5000, and 0. 

      HAAdmin.java
      private int transitionToActive(final CommandLine cmd)
            throws IOException, ServiceFailedException {
          ...
          HAServiceProtocol proto = target.getProxy(
              getConf(), 0);
          ...
      }
      
      HAAdmin.java
      private boolean isOtherTargetNodeActive(String targetNodeToActivate, boolean forceActive)
            throws IOException  {
          ...
          HAServiceProtocol proto = target.getProxy(getConf(), 5000);
          ...
      }
      
      HAAdmin.java
      private int transitionToStandby(final CommandLine cmd)
            throws IOException, ServiceFailedException {
          ...
          HAServiceProtocol proto = target.getProxy(
              getConf(), 0);
          ...
      }
      

      I think this three constant should also be configurable, since there are no difference from the former ones.

       

       

       

      Attachments

        1. HADOOP-15701.000.patch
          1 kB
          zhoushulin

        Activity

          People

            Unassigned Unassigned
            freebigshow zhoushulin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: