当前位置: 首页>>代码示例>>Java>>正文


Java UpgradeAction.FORCE_PROCEED属性代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction.FORCE_PROCEED属性的典型用法代码示例。如果您正苦于以下问题:Java UpgradeAction.FORCE_PROCEED属性的具体用法?Java UpgradeAction.FORCE_PROCEED怎么用?Java UpgradeAction.FORCE_PROCEED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction的用法示例。


在下文中一共展示了UpgradeAction.FORCE_PROCEED属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: upgradeProgress

/**
 * 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 
 */
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;
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:37,代码来源:DFSAdmin.java

示例2: upgradeProgress

/**
 * 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 
 */
public int upgradeProgress(String[] argv, int idx) throws IOException {
  if (!(fs instanceof DistributedFileSystem)) {
    System.out.println("FileSystem is " + fs.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;
  }

  DistributedFileSystem dfs = (DistributedFileSystem) fs;
  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;
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:37,代码来源:DFSAdmin.java


注:本文中的org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction.FORCE_PROCEED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。