Java Code Examples for org.apache.hadoop.hdfs.server.datanode.DatanodeUtil#getMetaName()

The following examples show how to use org.apache.hadoop.hdfs.server.datanode.DatanodeUtil#getMetaName() . These examples are extracted from open source projects. 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 Project: hadoop   File: LazyPersistTestCase.java    License: Apache License 2.0 6 votes vote down vote up
protected final boolean verifyBlockDeletedFromDir(File dir,
    LocatedBlocks locatedBlocks) {

  for (LocatedBlock lb : locatedBlocks.getLocatedBlocks()) {
    File targetDir =
      DatanodeUtil.idToBlockDir(dir, lb.getBlock().getBlockId());

    File blockFile = new File(targetDir, lb.getBlock().getBlockName());
    if (blockFile.exists()) {
      LOG.warn("blockFile: " + blockFile.getAbsolutePath() +
        " exists after deletion.");
      return false;
    }
    File metaFile = new File(targetDir,
      DatanodeUtil.getMetaName(lb.getBlock().getBlockName(),
        lb.getBlock().getGenerationStamp()));
    if (metaFile.exists()) {
      LOG.warn("metaFile: " + metaFile.getAbsolutePath() +
        " exists after deletion.");
      return false;
    }
  }
  return true;
}
 
Example 2
Source Project: big-c   File: LazyPersistTestCase.java    License: Apache License 2.0 6 votes vote down vote up
protected final boolean verifyBlockDeletedFromDir(File dir,
    LocatedBlocks locatedBlocks) {

  for (LocatedBlock lb : locatedBlocks.getLocatedBlocks()) {
    File targetDir =
      DatanodeUtil.idToBlockDir(dir, lb.getBlock().getBlockId());

    File blockFile = new File(targetDir, lb.getBlock().getBlockName());
    if (blockFile.exists()) {
      LOG.warn("blockFile: " + blockFile.getAbsolutePath() +
        " exists after deletion.");
      return false;
    }
    File metaFile = new File(targetDir,
      DatanodeUtil.getMetaName(lb.getBlock().getBlockName(),
        lb.getBlock().getGenerationStamp()));
    if (metaFile.exists()) {
      LOG.warn("metaFile: " + metaFile.getAbsolutePath() +
        " exists after deletion.");
      return false;
    }
  }
  return true;
}
 
Example 3
Source Project: hadoop   File: FsDatasetUtil.java    License: Apache License 2.0 4 votes vote down vote up
static File getMetaFile(File f, long gs) {
  return new File(f.getParent(),
      DatanodeUtil.getMetaName(f.getName(), gs));
}
 
Example 4
Source Project: big-c   File: FsDatasetUtil.java    License: Apache License 2.0 4 votes vote down vote up
static File getMetaFile(File f, long gs) {
  return new File(f.getParent(),
      DatanodeUtil.getMetaName(f.getName(), gs));
}