File getValidateBlockFile(int namespaceId, Block b, boolean checkSize)
      throws IOException {
    //Should we check for metadata file too?
    DatanodeBlockInfo blockInfo = this.getDatanodeBlockInfo(namespaceId, b);
    File f = null;
    if (blockInfo != null) {
      if (checkSize) {
        blockInfo.verifyFinalizedSize();
      }
      f = blockInfo.getBlockDataFile().getFile();
      assert f != null;

      if(f.exists()) {
        return f;
      }
   
      // if file is not null, but doesn't exist - possibly disk failed
      datanode.checkDiskError();
    }
    
    if (InterDatanodeProtocol.LOG.isDebugEnabled()) {
      InterDatanodeProtocol.LOG.debug("b=" + b + ", f=" + ((f == null) ? "null"
          : f));
    }
    return null;
  }
File getValidateBlockFile ( int namespaceId , Block b , boolean checkSize ) throws IOException { DatanodeBlockInfo blockInfo = this . getDatanodeBlockInfo ( namespaceId , b ) ; File f = null ; if ( blockInfo != null ) { if ( checkSize ) { blockInfo . verifyFinalizedSize ( ) ; } f = blockInfo . getBlockDataFile ( ) . getFile ( ) ; assert f != null ; if ( f . exists ( ) ) { return f ; } datanode . checkDiskError ( ) ; } if ( InterDatanodeProtocol . LOG . isDebugEnabled ( ) ) { InterDatanodeProtocol . LOG . debug ( "b=" + b + ", f=" + ( ( f == null ) ? "null" : f ) ) ; } return null ; }
Find the file corresponding to the block and return it if it exists.