HDFS中的addBlock函数

public LocatedBlock addBlock(String src, String clientMachine) throws IOException { int retries = 5;//设定重试次数为5 Object results[] = namesystem.getAdditionalBlock(new UTF8(src), new UTF8(clientMachine)); //获取新的一个Block和DataNode节点信息 while (results != null && results[0] == null && re…