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

Java UpgradeCommand类代码示例

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

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



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

示例1: doUpgrade

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
public void doUpgrade() throws IOException {
  this.status = (short)100;
  DataNode datanode = getDatanode();
  datanode.getNSNamenode(datanode.getAllNamespaces()[0]).processUpgradeCommand(
      new UpgradeCommand(UpgradeCommand.UC_ACTION_REPORT_STATUS, 
          getVersion(), getUpgradeStatus()));
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:8,代码来源:TestDistributedUpgrade.java


示例2: processUpgradeCommand

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
synchronized public UpgradeCommand processUpgradeCommand(
                                UpgradeCommand command) throws IOException {
  switch(command.getAction()) {
    case UpgradeCommand.UC_ACTION_REPORT_STATUS:
      this.status += command.getCurrentStatus()/8;  // 4 reports needed
      break;
    default:
      this.status++;
  }
  return null;
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:12,代码来源:TestDistributedUpgrade.java


示例3: processUpgradeCommand

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
synchronized UpgradeCommand processUpgradeCommand(UpgradeCommand command
                                                  ) throws IOException {
  NameNode.LOG.debug("\n   Distributed upgrade for NameNode version " 
      + getUpgradeVersion() + " to current LV " 
      + FSConstants.LAYOUT_VERSION + " is processing upgrade command: "
      + command.getAction() + " status = " + getUpgradeStatus() + "%");
  if(currentUpgrades == null) {
    NameNode.LOG.info("Ignoring upgrade command: " 
        + command.getAction() + " version " + command.getVersion()
        + ". No distributed upgrades are currently running on the NameNode");
    return null;
  }
  UpgradeObjectNamenode curUO = (UpgradeObjectNamenode)currentUpgrades.first();
  if(command.getVersion() != curUO.getVersion())
    throw new IncorrectVersionException(command.getVersion(), 
        "UpgradeCommand", curUO.getVersion());
  UpgradeCommand reply = curUO.processUpgradeCommand(command);
  if(curUO.getUpgradeStatus() < 100) {
    return reply;
  }
  // current upgrade is done
  curUO.completeUpgrade();
  NameNode.LOG.info("\n   Distributed upgrade for NameNode version " 
      + curUO.getVersion() + " to current LV " 
      + FSConstants.LAYOUT_VERSION + " is complete.");
  // proceede with the next one
  currentUpgrades.remove(curUO);
  if(currentUpgrades.isEmpty()) { // all upgrades are done
    completeUpgrade();
  } else {  // start next upgrade
    curUO = (UpgradeObjectNamenode)currentUpgrades.first();
    this.broadcastCommand = curUO.startUpgrade();
  }
  return reply;
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:36,代码来源:UpgradeManagerNamenode.java


示例4: processUpgradeCommand

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
synchronized void processUpgradeCommand(UpgradeCommand command
                                        ) throws IOException {
  assert command.getAction() == UpgradeCommand.UC_ACTION_START_UPGRADE :
    "Only start upgrade action can be processed at this time.";
  this.upgradeVersion = command.getVersion();
  // Start distributed upgrade
  if(startUpgrade()) // upgrade started
    return;
  throw new IOException(
      "Distributed upgrade for DataNode " + dataNode.getDatanodeInfo() 
      + " version " + getUpgradeVersion() + " to current LV " 
      + FSConstants.LAYOUT_VERSION + " cannot be started. "
      + "The upgrade object is not defined.");
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:15,代码来源:UpgradeManagerDatanode.java


示例5: processUpgradeCommand

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
synchronized void processUpgradeCommand(UpgradeCommand command
                                        ) throws IOException {
  assert command.getAction() == UpgradeCommand.UC_ACTION_START_UPGRADE :
    "Only start upgrade action can be processed at this time.";
  this.upgradeVersion = command.getVersion();
  // Start distributed upgrade
  if(startUpgrade()) // upgrade started
    return;
  throw new IOException(
      "Distributed upgrade for DataNode " + dataNode.dnRegistration.getName() 
      + " version " + getUpgradeVersion() + " to current LV " 
      + FSConstants.LAYOUT_VERSION + " cannot be started. "
      + "The upgrade object is not defined.");
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:15,代码来源:UpgradeManagerDatanode.java


示例6: processUpgradeCommand

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
synchronized UpgradeCommand processUpgradeCommand(UpgradeCommand command
                                                  ) throws IOException {
  if(NameNode.LOG.isDebugEnabled()) {
    NameNode.LOG.debug("\n   Distributed upgrade for NameNode version " 
        + getUpgradeVersion() + " to current LV " 
        + FSConstants.LAYOUT_VERSION + " is processing upgrade command: "
        + command.getAction() + " status = " + getUpgradeStatus() + "%");
  }
  if(currentUpgrades == null) {
    NameNode.LOG.info("Ignoring upgrade command: " 
        + command.getAction() + " version " + command.getVersion()
        + ". No distributed upgrades are currently running on the NameNode");
    return null;
  }
  UpgradeObjectNamenode curUO = (UpgradeObjectNamenode)currentUpgrades.first();
  if(command.getVersion() != curUO.getVersion())
    throw new IncorrectVersionException(command.getVersion(), 
        "UpgradeCommand", curUO.getVersion());
  UpgradeCommand reply = curUO.processUpgradeCommand(command);
  if(curUO.getUpgradeStatus() < 100) {
    return reply;
  }
  // current upgrade is done
  curUO.completeUpgrade();
  NameNode.LOG.info("\n   Distributed upgrade for NameNode version " 
      + curUO.getVersion() + " to current LV " 
      + FSConstants.LAYOUT_VERSION + " is complete.");
  // proceede with the next one
  currentUpgrades.remove(curUO);
  if(currentUpgrades.isEmpty()) { // all upgrades are done
    completeUpgrade();
  } else {  // start next upgrade
    curUO = (UpgradeObjectNamenode)currentUpgrades.first();
    this.broadcastCommand = curUO.startUpgrade();
  }
  return reply;
}
 
开发者ID:cumulusyebl,项目名称:cumulus,代码行数:38,代码来源:UpgradeManagerNamenode.java


示例7: startUpgrade

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
public UpgradeCommand startUpgrade() throws IOException {
  return null;
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:4,代码来源:TestDistributedUpgrade.java


示例8: completeUpgrade

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
public UpgradeCommand completeUpgrade() throws IOException {
  return null;
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:4,代码来源:TestDistributedUpgrade.java


示例9: processUpgradeCommand

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
public void processUpgradeCommand(UpgradeCommand comm)
throws IOException {
  assert upgradeManager != null : "DataNode.upgradeManager is null.";
  upgradeManager.processUpgradeCommand(comm);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:6,代码来源:AvatarDataNode.java


示例10: processUpgradeCommand

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
public UpgradeCommand processUpgradeCommand(UpgradeCommand comm) throws IOException {
  return namesystem.processDistributedUpgradeCommand(comm);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:4,代码来源:NameNode.java


示例11: startUpgrade

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
/**
 */
public UpgradeCommand startUpgrade() throws IOException {
  // broadcast that data-nodes must start the upgrade
  return new UpgradeCommand(UpgradeCommand.UC_ACTION_START_UPGRADE,
                            getVersion(), (short)0);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:8,代码来源:UpgradeObjectNamenode.java


示例12: processDistributedUpgradeCommand

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
UpgradeCommand processDistributedUpgradeCommand(UpgradeCommand comm)
  throws IOException {
  return upgradeManager.processUpgradeCommand(comm);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:5,代码来源:FSNamesystem.java


示例13: getDistributedUpgradeCommand

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
UpgradeCommand getDistributedUpgradeCommand() throws IOException {
  return upgradeManager.getBroadcastCommand();
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:4,代码来源:FSNamesystem.java


示例14: processCommand

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
/**
 *
 * @param cmd
 * @return true if further processing may be required or false otherwise.
 * @throws IOException
 */
 private boolean processCommand(DatanodeCommand cmd, long processStartTime)
     throws IOException {
  if (cmd == null)
    return true;
  final BlockCommand bcmd = cmd instanceof BlockCommand? (BlockCommand)cmd: null;

  boolean retValue = true;
  long startTime = System.currentTimeMillis();

  switch(cmd.getAction()) {
  case DatanodeProtocol.DNA_TRANSFER:
    // Send a copy of a block to another datanode
    transferBlocks(namespaceId,
        bcmd.getBlocks(), bcmd.getTargets());
    myMetrics.blocksReplicated.inc(bcmd.getBlocks().length);
    break;
  case DatanodeProtocol.DNA_INVALIDATE:
    //
    // Some local block(s) are obsolete and can be 
    // safely garbage-collected.
    //
    Block toDelete[] = bcmd.getBlocks();
    try {
      if (blockScanner != null) {
        blockScanner.deleteBlocks(namespaceId, toDelete);
      }        
      data.invalidate(namespaceId, toDelete);
    } catch(IOException e) {
      checkDiskError();
      throw e;
    }
    myMetrics.blocksRemoved.inc(toDelete.length);
    break;
  case DatanodeProtocol.DNA_SHUTDOWN:
    // shut down the data node
    shouldServiceRun = false;
    retValue = false;
    break;
  case DatanodeProtocol.DNA_REGISTER:
    // namenode requested a registration - at start or if NN lost contact
    LOG.info("DatanodeCommand action: DNA_REGISTER");
    if (shouldRun) {
      register();
      firstBlockReportSent = false;
    }
    break;
  case DatanodeProtocol.DNA_FINALIZE:
     storage.finalizedUpgrade(namespaceId);
    break;
  case UpgradeCommand.UC_ACTION_START_UPGRADE:
    // start distributed upgrade here
    processDistributedUpgradeCommand((UpgradeCommand)cmd);
    break;
  case DatanodeProtocol.DNA_RECOVERBLOCK:
     recoverBlocks(namespaceId, bcmd.getBlocks(), bcmd.getTargets(),
         processStartTime);
    break;
  case DatanodeProtocol.DNA_RAIDTASK:
    processRaidTaskCommand((RaidTaskCommand) cmd);
    break;
  default:
    LOG.warn("Unknown DatanodeCommand action: " + cmd.getAction());
  }
  long endTime = System.currentTimeMillis();
  if (endTime - startTime > 1000) {
    LOG.info("processCommand() took " + (endTime - startTime)
        + " msec to process command " + cmd.getAction() + " from " + nnAddr);
  } else if (LOG.isDebugEnabled()) {
    LOG.debug("processCommand() took " + (endTime - startTime)
        + " msec to process command " + cmd.getAction() + " from " + nnAddr);
  }
  return retValue;
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:80,代码来源:DataNode.java


示例15: processDistributedUpgradeCommand

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
private void processDistributedUpgradeCommand(UpgradeCommand comm
                                             ) throws IOException {
  assert upgradeManager != null : "DataNode.upgradeManager is null.";
  upgradeManager.processUpgradeCommand(comm);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:6,代码来源:DataNode.java


示例16: getBroadcastCommand

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
public synchronized UpgradeCommand getBroadcastCommand() {
  return this.broadcastCommand;
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:4,代码来源:UpgradeManager.java


示例17: doUpgrade

import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand; //导入依赖的package包/类
public void doUpgrade() throws IOException {
  this.status = (short)100;
  getDatanode().namenode.processUpgradeCommand(
      new UpgradeCommand(UpgradeCommand.UC_ACTION_REPORT_STATUS, 
          getVersion(), getUpgradeStatus()));
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:7,代码来源:TestDistributedUpgrade.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java DisplayLeakService类代码示例发布时间:2022-05-23
下一篇:
Java DiagnosticSeverity类代码示例发布时间: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