final int primarydatanodeindex = AppendTestUtil.nextInt(datanodes.length);
DataNode.LOG.info("primarydatanodeindex =" + primarydatanodeindex);
DataNode primary = datanodes[primarydatanodeindex];
DataNode.LOG.info("primary.dnRegistration=" + primary.getDNRegistrationForNS(
cluster.getNameNode().getNamespaceID()));
primary.recoverBlocks(namespaceId, new Block[]{lastblock}, new DatanodeInfo[][]{datanodeinfos}).join();
BlockMetaDataInfo[] updatedmetainfo = new BlockMetaDataInfo[REPLICATION_NUM];
int minsize = min(newblocksizes);
long currentGS = cluster.getNameNode().namesystem.getGenerationStamp();
lastblock.setGenerationStamp(currentGS);