try {
num = namesystem.countNodes(block);
} finally {
namesystem.readUnlock();
}
} while (num.liveReplicas() != REPLICATION_FACTOR);
LOG.info("Restarting first DN");
// restart the first datanode
cluster.restartDataNode(dnprop);
cluster.waitActive(false);