org.apache.hadoop.hdfs.server.datanode.DataNode.scheduleBlockReport()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.apache.hadoop.hdfs.server.datanode.DataNode.scheduleBlockReport()方法的一些代码示例,展示了DataNode.scheduleBlockReport()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataNode.scheduleBlockReport()方法的具体详情如下:
包路径:org.apache.hadoop.hdfs.server.datanode.DataNode
类名称:DataNode
方法名:scheduleBlockReport

DataNode.scheduleBlockReport介绍

[英]This methods arranges for the data node to send the block report at the next heartbeat.
[中]此方法安排数据节点在下一次心跳时发送块报告。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs-test

/**
 * This method is valid only if the data nodes have simulated data
 * @param dataNodeIndex - data node i which to inject - the index is same as for getDataNodes()
 * @param blocksToInject - the blocks
 * @throws IOException
 *              if not simulatedFSDataset
 *             if any of blocks already exist in the data node
 *   
 */
public void injectBlocks(int dataNodeIndex, Iterable<Block> blocksToInject) throws IOException {
 if (dataNodeIndex < 0 || dataNodeIndex > dataNodes.size()) {
  throw new IndexOutOfBoundsException();
 }
 FSDatasetInterface dataSet = dataNodes.get(dataNodeIndex).datanode.getFSDataset();
 if (!(dataSet instanceof SimulatedFSDataset)) {
  throw new IOException("injectBlocks is valid only for SimilatedFSDataset");
 }
 SimulatedFSDataset sdataset = (SimulatedFSDataset) dataSet;
 sdataset.injectBlocks(blocksToInject);
 dataNodes.get(dataNodeIndex).datanode.scheduleBlockReport(0);
}

代码示例来源:origin: io.fabric8/fabric-hadoop

private void handleDiskError(String errMsgr) {
 boolean hasEnoughResource = data.hasEnoughResource();
 LOG.warn("DataNode.handleDiskError: Keep Running: " + hasEnoughResource);
 
 //if hasEnoughtResource = true - more volumes are available, so we don't want 
 // to shutdown DN completely and don't want NN to remove it.
 int dp_error = DatanodeProtocol.DISK_ERROR;
 if(hasEnoughResource == false) {
  // DN will be shutdown and NN should remove it
  dp_error = DatanodeProtocol.FATAL_DISK_ERROR;
 }
 //inform NameNode
 notifyNamenode(dp_error, errMsgr);
 
 if(hasEnoughResource) {
  scheduleBlockReport(0);
  return; // do not shutdown
 }
 
 LOG.warn("DataNode is shutting down.\n" + errMsgr);
 shouldRun = false; 
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

scheduleBlockReport(initialBlockReportDelay);

代码示例来源:origin: io.fabric8/fabric-hadoop

scheduleBlockReport(initialBlockReportDelay);

相关文章

DataNode类方法