DatanodeInfo[] excludes = null;
if (excludedNodes != null) {
excludes = new DatanodeInfo[excludedNodes.size()];
for (int i = 0; i < excludes.length; i++) {
String name = excludedNodes.get(i).name;
excludes[i] = new DatanodeInfo(
new DatanodeID(name, "", -1, getPort(name)));
}
}
// initialize favoured nodes
DatanodeInfo[] favoured = null;
if (favouredNodes != null) {
favoured = new DatanodeInfo[favouredNodes.size()];
for (int i = 0; i < favoured.length; i++) {
String name = favouredNodes.get(i).name;
favoured[i] = new DatanodeInfo(
new DatanodeID(name, "", -1, getPort(name)));
}
}
LocatedBlockWithMetaInfo val = namenode.addBlockAndFetchMetaInfo(