org.apache.hadoop.hdfs.protocol.Block.metaToBlockFile()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(172)

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

Block.metaToBlockFile介绍

暂无

代码示例

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

File blockFile = Block.metaToBlockFile(metaFile);
long blockId = Block.filename2id(blockFile.getName());
File targetDir = DatanodeUtil.idToBlockDir(finalizedDir, blockId);

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

File blockFile = Block.metaToBlockFile(metaFile);
long blockId = Block.filename2id(blockFile.getName());
File targetDir = DatanodeUtil.idToBlockDir(finalizedDir, blockId);

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

public static ExtendedBlock getBlock(String bpid, File dataDir) {
 List<File> metadataFiles = MiniDFSCluster.getAllBlockMetadataFiles(dataDir);
 if (metadataFiles == null || metadataFiles.isEmpty()) {
  return null;
 }
 File metadataFile = metadataFiles.get(0);
 File blockFile = Block.metaToBlockFile(metadataFile);
 return new ExtendedBlock(bpid, Block.getBlockId(blockFile.getName()),
   blockFile.length(), Block.getGenerationStamp(metadataFile.getName()));
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

File blockFile = Block.metaToBlockFile(metaFile);
long blockId = Block.filename2id(blockFile.getName());
File targetDir = DatanodeUtil.idToBlockDir(finalizedDir, blockId);

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

File blockFile = Block.metaToBlockFile(metadataFile);
LOG.info("Deliberately removing file " + blockFile.getName());
assertTrue("Cannot remove file.", blockFile.delete());

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

continue;
for (File metadataFile : metadataFiles) {
 File blockFile = Block.metaToBlockFile(metadataFile);
 assertTrue("Cannot remove file.", blockFile.delete());
 assertTrue("Cannot remove file.", metadataFile.delete());

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

File blockFile = Block.metaToBlockFile(metadataFile);
LOG.info("Deliberately removing file " + blockFile.getName());
assertTrue("Cannot remove file.", blockFile.delete());

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

continue;
for (File metadataFile : metadataFiles) {
 File blockFile = Block.metaToBlockFile(metadataFile);
 assertTrue("Cannot remove file.", blockFile.delete());
 assertTrue("Cannot remove file.", metadataFile.delete());

相关文章