// bring up the datanode
cluster.restartDataNode(dnprop);
// Wait for block report
LOG.info("wait for its block report to come in");
NumberReplicas num;
FileStatus stat = dfs.getFileStatus(new Path(filePath));
LocatedBlocks blocks = dfs.getClient().
getLocatedBlocks(filePath, 0, stat.getLen());
long startTime = System.currentTimeMillis();
do {
Thread.sleep(1000);
int totalCount = 0;
namesystem.readLock();
try {
for (LocatedBlock block : blocks.getLocatedBlocks()) {
num = namesystem.countNodes(block.getBlock());
totalCount += num.liveReplicas();
}
if (totalCount == rsCodec.numDataBlocks) {
break;
} else {
LOG.info("wait for block report, received total replicas: " + totalCount);