} else {
LOG.info("Using zeros for location " + i);
inputs[i] = new RaidUtils.ZeroInputStream(limit);
continue;
}
LocatedBlockWithFileName lb =
srcFs.getClient().getBlockInfo(blockId);
if (lb == null) {
throw new BlockMissingException(String.valueOf(blockId),
"Location " + i + " can not be found. Block id: " + blockId, 0);
} else {
Path filePath = new Path(lb.getFileName());
FileStatus stat = srcFs.getFileStatus(filePath);
long blockSize = stat.getBlockSize();
if (offsetInBlock > blockSize) {
stm = new RaidUtils.ZeroInputStream(limit);
} else {
if (srcFs.exists(filePath)) {
long startOffset =
getBlockIdInFile(srcFs, filePath, blockId) * blockSize;
long offset = startOffset + offsetInBlock;
LOG.info("Opening " + lb.getFileName() + ":" + offset +
" for location " + i);
FSDataInputStream is = srcFs.open(filePath);
is.seek(offset);
stm = is;
} else {
LOG.info("Location " + i + ", File " + lb.getFileName() +
" does not exist, using zeros");
locationsToNotRead.add(i);
stm = new RaidUtils.ZeroInputStream(limit);
}
}