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

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

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

DataNode.updateReplicaUnderRecovery介绍

[英]Update replica with the new generation stamp and length.
[中]使用新一代戳记和长度更新复制副本。

代码示例

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

/**
 * BlockRecoveryFI_09. some/all DNs failed to update replicas.
 *
 * @throws IOException in case of an error
 */
@Test
public void testFailedReplicaUpdate() throws IOException {
 if(LOG.isDebugEnabled()) {
  LOG.debug("Running " + GenericTestUtils.getMethodName());
 }
 DataNode spyDN = spy(dn);
 doThrow(new IOException()).when(spyDN).updateReplicaUnderRecovery(
   block, RECOVERY_ID, block.getNumBytes());
 try {
  spyDN.syncBlock(rBlock, initBlockRecords(spyDN));
  fail("Sync should fail");
 } catch (IOException e) {
  e.getMessage().startsWith("Cannot recover ");
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs

/**
 * BlockRecoveryFI_09. some/all DNs failed to update replicas.
 *
 * @throws IOException in case of an error
 */
@Test
public void testFailedReplicaUpdate() throws IOException {
 if(LOG.isDebugEnabled()) {
  LOG.debug("Running " + GenericTestUtils.getMethodName());
 }
 DataNode spyDN = spy(dn);
 doThrow(new IOException()).when(spyDN).updateReplicaUnderRecovery(
   block, RECOVERY_ID, BLOCK_ID, block.getNumBytes());
 try {
  spyDN.syncBlock(rBlock, initBlockRecords(spyDN));
  fail("Sync should fail");
 } catch (IOException e) {
  e.getMessage().startsWith("Cannot recover ");
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs

recoveryInitResult.get());
dataNode.updateReplicaUnderRecovery(block.getBlock(), block.getBlock()
  .getGenerationStamp() + 1, block.getBlock().getBlockId(),
  block.getBlockSize());

相关文章

DataNode类方法