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


Java UpgradeAction类代码示例

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


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

示例1: distributedUpgradeProgress

import org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction; //导入依赖的package包/类
UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action 
                                              ) throws IOException {
  boolean isFinalized = false;
  if(currentUpgrades == null) { // no upgrades are in progress
    FSImage fsimage = namesystem.getFSImage();
    isFinalized = fsimage.isUpgradeFinalized();
    if(isFinalized) // upgrade is finalized
      return null;  // nothing to report
    return new UpgradeStatusReport(fsimage.getLayoutVersion(), 
                                   (short)101, isFinalized);
  }
  UpgradeObjectNamenode curUO = (UpgradeObjectNamenode)currentUpgrades.first();
  boolean details = false;
  switch(action) {
  case GET_STATUS:
    break;
  case DETAILED_STATUS:
    details = true;
    break;
  case FORCE_PROCEED:
    curUO.forceProceed();
  }
  return curUO.getUpgradeStatusReport(details);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:25,代码来源:UpgradeManagerNamenode.java

示例2: distributedUpgradeProgress

import org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction; //导入依赖的package包/类
UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action 
                                              ) throws IOException {
  boolean isFinalized = false;
  if(currentUpgrades == null) { // no upgrades are in progress
    FSImage fsimage = FSNamesystem.getFSNamesystem().getFSImage();
    isFinalized = fsimage.isUpgradeFinalized();
    if(isFinalized) // upgrade is finalized
      return null;  // nothing to report
    return new UpgradeStatusReport(fsimage.getLayoutVersion(), 
                                   (short)101, isFinalized);
  }
  UpgradeObjectNamenode curUO = (UpgradeObjectNamenode)currentUpgrades.first();
  boolean details = false;
  switch(action) {
  case GET_STATUS:
    break;
  case DETAILED_STATUS:
    details = true;
    break;
  case FORCE_PROCEED:
    curUO.forceProceed();
  }
  return curUO.getUpgradeStatusReport(details);
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:25,代码来源:UpgradeManagerNamenode.java

示例3: if

import org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction; //导入依赖的package包/类
synchronized UpgradeStatusReport distributedUpgradeProgress
                                (UpgradeAction action) throws IOException {
  boolean isFinalized = false;
  if(currentUpgrades == null) { // no upgrades are in progress
    FSImage fsimage = namesystem.getFSImage();
    isFinalized = fsimage.isUpgradeFinalized();
    if(isFinalized) // upgrade is finalized
      return null;  // nothing to report
    return new UpgradeStatusReport(fsimage.getLayoutVersion(), 
                                   (short)101, isFinalized);
  }
  UpgradeObjectNamenode curUO = (UpgradeObjectNamenode)currentUpgrades.first();
  boolean details = false;
  switch(action) {
  case GET_STATUS:
    break;
  case DETAILED_STATUS:
    details = true;
    break;
  case FORCE_PROCEED:
    curUO.forceProceed();
  }
  return curUO.getUpgradeStatusReport(details);
}
 
开发者ID:cumulusyebl,项目名称:cumulus,代码行数:25,代码来源:UpgradeManagerNamenode.java

示例4: distributedUpgradeProgress

import org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction; //导入依赖的package包/类
@Override
public UpgradeStatusReport distributedUpgradeProgress(
    final UpgradeAction action) throws IOException {
  return (failoverHandler.new MutableFSCaller<UpgradeStatusReport>() {
    public UpgradeStatusReport call(int r) throws IOException {
      return namenode.distributedUpgradeProgress(action);
    }
  }).callFS();
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:10,代码来源:FailoverClientProtocol.java

示例5: getUpgradeStatusText

import org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction; //导入依赖的package包/类
public String getUpgradeStatusText() {
  String statusText = "";
  try {
    UpgradeStatusReport status = 
      fsn.distributedUpgradeProgress(UpgradeAction.GET_STATUS);
    statusText = (status == null ? 
        "There are no upgrades in progress." :
          status.getStatusText(false));
  } catch(IOException e) {
    statusText = "Upgrade status unknown.";
  }
  return statusText;
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:14,代码来源:JspHelper.java

示例6: upgradeProgress

import org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction; //导入依赖的package包/类
/**
 * 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,代码行数:38,代码来源:DFSAdmin.java

示例7: upgradeProgress

import org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction; //导入依赖的package包/类
/**
 * 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,代码行数:38,代码来源:DFSAdmin.java

示例8: getUpgradeStatusText

import org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction; //导入依赖的package包/类
static String getUpgradeStatusText(FSNamesystem fsn) {
  String statusText = "";
  try {
    UpgradeStatusReport status = fsn
        .distributedUpgradeProgress(UpgradeAction.GET_STATUS);
    statusText = (status == null ? "There are no upgrades in progress."
        : status.getStatusText(false));
  } catch (IOException e) {
    statusText = "Upgrade status unknown.";
  }
  return statusText;
}
 
开发者ID:cumulusyebl,项目名称:cumulus,代码行数:13,代码来源:NamenodeJspHelper.java

示例9: distributedUpgradeProgress

import org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction; //导入依赖的package包/类
@Override
public UpgradeStatusReport distributedUpgradeProgress(
    final UpgradeAction action) throws IOException {
  return (new MutableFSCaller<UpgradeStatusReport>() {
    UpgradeStatusReport call(int r) throws IOException {
      return namenode.distributedUpgradeProgress(action);
    }
  }).callFS();
}
 
开发者ID:iVCE,项目名称:RDFS,代码行数:10,代码来源:DistributedAvatarFileSystem.java

示例10: distributedUpgradeProgress

import org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction; //导入依赖的package包/类
public UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action
) throws IOException {
  return dfs.distributedUpgradeProgress(action);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:5,代码来源:DistributedFileSystem.java

示例11: distributedUpgradeProgress

import org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction; //导入依赖的package包/类
public UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action
                                                      ) throws IOException {
  return getDFS().distributedUpgradeProgress(action);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:5,代码来源:ChecksumDistributedFileSystem.java


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