code: public int upgradeProgress(String[] argv, int idx) throws IOException {
      DistributedFileSystem dfs = getDFS();
      if (dfs == null) {
        System.out.println("FileSystem is " + getFS().getUri());
        return -1;
      }
      if (idx != argv.length - 1) {
        printUsage("-upgradeProgress");
        return -1;
      }
  
      UpgradeAction action;
      if ("status".equalsIgnoreCase(argv[idx])) {
        action = UpgradeAction.GET_STATUS;
      } else if ("details".equalsIgnoreCase(argv[idx])) {
        action = UpgradeAction.DETAILED_STATUS;
      } else if ("force".equalsIgnoreCase(argv[idx])) {
        action = UpgradeAction.FORCE_PROCEED;
      } else {
        printUsage("-upgradeProgress");
        return -1;
      }
  
      UpgradeStatusReport status = dfs.distributedUpgradeProgress(action);
      String statusText = (status == null ? 
          "There are no upgrades in progress." :
            status.getStatusText(action == UpgradeAction.DETAILED_STATUS));
      System.out.println(statusText);
      return 0;
    }
docs: Command to request current distributed upgrade status,
  a detailed status, or to force the upgrade to proceed.
  
  Usage: java DFSAdmin -upgradeProgress [status | details | force]
  @exception IOException