Java Code Examples for org.apache.hadoop.hdfs.protocol.ExtendedBlock#getBlockName()

The following examples show how to use org.apache.hadoop.hdfs.protocol.ExtendedBlock#getBlockName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MiniDFSCluster.java    From hadoop with Apache License 2.0 2 votes vote down vote up
/**
 * Get file correpsonding to a block
 * @param storageDir storage directory
 * @param blk the block
 * @return data file corresponding to the block
 */
public static File getBlockFile(File storageDir, ExtendedBlock blk) {
  return new File(DatanodeUtil.idToBlockDir(getFinalizedDir(storageDir,
      blk.getBlockPoolId()), blk.getBlockId()), blk.getBlockName());
}
 
Example 2
Source File: MiniDFSCluster.java    From hadoop with Apache License 2.0 2 votes vote down vote up
/**
 * Get the latest metadata file correpsonding to a block
 * @param storageDir storage directory
 * @param blk the block
 * @return metadata file corresponding to the block
 */
public static File getBlockMetadataFile(File storageDir, ExtendedBlock blk) {
  return new File(DatanodeUtil.idToBlockDir(getFinalizedDir(storageDir,
      blk.getBlockPoolId()), blk.getBlockId()), blk.getBlockName() + "_" +
      blk.getGenerationStamp() + Block.METADATA_EXTENSION);
}
 
Example 3
Source File: MiniDFSCluster.java    From big-c with Apache License 2.0 2 votes vote down vote up
/**
 * Get file correpsonding to a block
 * @param storageDir storage directory
 * @param blk the block
 * @return data file corresponding to the block
 */
public static File getBlockFile(File storageDir, ExtendedBlock blk) {
  return new File(DatanodeUtil.idToBlockDir(getFinalizedDir(storageDir,
      blk.getBlockPoolId()), blk.getBlockId()), blk.getBlockName());
}
 
Example 4
Source File: MiniDFSCluster.java    From big-c with Apache License 2.0 2 votes vote down vote up
/**
 * Get the latest metadata file correpsonding to a block
 * @param storageDir storage directory
 * @param blk the block
 * @return metadata file corresponding to the block
 */
public static File getBlockMetadataFile(File storageDir, ExtendedBlock blk) {
  return new File(DatanodeUtil.idToBlockDir(getFinalizedDir(storageDir,
      blk.getBlockPoolId()), blk.getBlockId()), blk.getBlockName() + "_" +
      blk.getGenerationStamp() + Block.METADATA_EXTENSION);
}