FileStatus stat)
throws IOException {
List<LocatedBlockWithMetaInfo> corrupt =
new LinkedList<LocatedBlockWithMetaInfo>();
VersionedLocatedBlocks locatedBlocks;
int namespaceId = 0;
int methodFingerprint = 0;
if (DFSClient.isMetaInfoSuppoted(fs.getClient().namenodeProtocolProxy)) {
LocatedBlocksWithMetaInfo lbksm = fs.getClient().namenode.
openAndFetchMetaInfo(uriPath, 0, stat.getLen());
namespaceId = lbksm.getNamespaceID();
locatedBlocks = lbksm;
methodFingerprint = lbksm.getMethodFingerPrint();
fs.getClient().getNewNameNodeIfNeeded(methodFingerprint);
} else {
locatedBlocks = fs.getClient().namenode.open(uriPath, 0, stat.getLen());
}
final int dataTransferVersion = locatedBlocks.getDataProtocolVersion();
for (LocatedBlock b: locatedBlocks.getLocatedBlocks()) {
if (b.isCorrupt() ||
(b.getLocations().length == 0 && b.getBlockSize() > 0)) {
corrupt.add(new LocatedBlockWithMetaInfo(b.getBlock(),
b.getLocations(), b.getStartOffset(),
dataTransferVersion, namespaceId, methodFingerprint));