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

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

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

Block.getBlockName介绍

暂无

代码示例

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

@Override
 public String toString() {
  return block.getBlockName() + "\t" + path;
 }
}

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

/**
 * Temporary files. They get moved to the finalized block directory when
 * the block is finalized.
 */
File createTmpFile(Block b) throws IOException {
 File f = new File(tmpDir, b.getBlockName());
 File tmpFile = DatanodeUtil.createFileWithExistsCheck(
   volume, b, f, fileIoProvider);
 // If any exception during creation, its expected that counter will not be
 // incremented, So no need to decrement
 incrNumBlocks();
 return tmpFile;
}

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

/**
 * RBW files. They get moved to the finalized block directory when
 * the block is finalized.
 */
File createRbwFile(Block b) throws IOException {
 File f = new File(rbwDir, b.getBlockName());
 File rbwFile = DatanodeUtil.createFileWithExistsCheck(
   volume, b, f, fileIoProvider);
 // If any exception during creation, its expected that counter will not be
 // incremented, So no need to decrement
 incrNumBlocks();
 return rbwFile;
}

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

static File moveBlockFiles(Block b, ReplicaInfo replicaInfo, File destdir)
  throws IOException {
 final File dstfile = new File(destdir, b.getBlockName());
 final File dstmeta = FsDatasetUtil.getMetaFile(dstfile, b.getGenerationStamp());
 try {
  replicaInfo.renameMeta(dstmeta.toURI());
 } catch (IOException e) {
  throw new IOException("Failed to move meta file for " + b
    + " from " + replicaInfo.getMetadataURI() + " to " + dstmeta, e);
 }
 try {
  replicaInfo.renameData(dstfile.toURI());
 } catch (IOException e) {
  throw new IOException("Failed to move block file for " + b
    + " from " + replicaInfo.getBlockURI() + " to "
    + dstfile.getAbsolutePath(), e);
 }
 if (LOG.isDebugEnabled()) {
  LOG.debug("addFinalizedBlock: Moved " + replicaInfo.getMetadataURI()
    + " to " + dstmeta + " and " + replicaInfo.getBlockURI()
    + " to " + dstfile);
 }
 return dstfile;
}

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

for (String snap : snaps) {
 list.add(c.block.getBlockName() + "\t" + snap);

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

/** Returns the block file name for the block */
public String getBlockName() {
 return block.getBlockName();
}

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

@Override
 public String toString() {
  return block.getBlockName() + "\t" + path;
 }
}

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

@Override
 public String toString() {
  return block.getBlockName() + "\t" + path;
 }
}

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

.build();
} else {
 File file = new File(rbwDir, block.getBlockName());
 boolean loadRwr = true;
 File restartMeta = new File(file.getParent()  +

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

/**
 */
@Override
public String toString() {
 return getBlockName() + "_" + getGenerationStamp();
}

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

/**
 */
@Override
public String toString() {
 return getBlockName() + "_" + getGenerationStamp();
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/**
 */
public String toString() {
 return getBlockName() + "_" + getGenerationStamp();
}

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

/**
 * RBW files. They get moved to the finalized block directory when
 * the block is finalized.
 */
File createRbwFile(Block b) throws IOException {
 File f = new File(rbwDir, b.getBlockName());
 return DatanodeUtil.createTmpFile(b, f);
}

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

/**
 * Temporary files. They get moved to the real block directory either when
 * the block is finalized or the datanode restarts.
 */
File createTmpFile(Block b) throws IOException {
 File f = new File(tmpDir, b.getBlockName());
 return createTmpFile(b, f);
}

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

/**
 * Temporary files. They get moved to the finalized block directory when
 * the block is finalized.
 */
File createTmpFile(Block b) throws IOException {
 File f = new File(tmpDir, b.getBlockName());
 return DatanodeUtil.createTmpFile(b, f);
}

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

/**
 * RBW files. They get moved to the finalized block directory when
 * the block is finalized.
 */
File createRbwFile(Block b) throws IOException {
 File f = new File(rbwDir, b.getBlockName());
 return DatanodeUtil.createTmpFile(b, f);
}

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

/**
 * Temporary files. They get moved to the finalized block directory when
 * the block is finalized.
 */
File createTmpFile(Block b) throws IOException {
 File f = new File(tmpDir, b.getBlockName());
 return DatanodeUtil.createTmpFile(b, f);
}

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

/**
 * Adds block to list of blocks which will be invalidated on 
 * specified datanode and log the move
 * @param b block
 * @param n datanode
 */
private void addToInvalidates(Block b, DatanodeInfo n) {
 addToInvalidatesNoLog(b, n);
 NameNode.stateChangeLog.info("BLOCK* NameSystem.addToInvalidates: "
   + b.getBlockName() + " is added to invalidSet of " + n.getName());
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/**
 * Adds block to list of blocks which will be invalidated on
 * specified datanode and log the move
 *
 * @param b block
 * @param n datanode
 */
void addToInvalidates(Block b, DatanodeInfo n, boolean ackRequired) {
 addToInvalidatesNoLog(b, n, ackRequired);
 NameNode.stateChangeLog.info("BLOCK* NameSystem.addToInvalidates: "
  + b.getBlockName() + " is added to invalidSet of " + n.getName());
}

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

public static int firstDnWithBlock(MiniDFSCluster cluster, Block b)
  throws IOException {
 int numDatanodes = cluster.getDataNodes().size();
 for (int i = 0; i < numDatanodes; i++) {
  String blockContent = cluster.readBlockOnDataNode(i, b.getBlockName());
  if (blockContent != null) {
   return i;
  }
 }
 return -1;
}

相关文章