• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java UpgradeAction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BindingQueryPlan类代码示例发布时间:2022-05-23
下一篇:
Java GeometryTransformer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap