HDFS-9379. Make NNThroughputBenchmark support more than 10 datanodes. (Contributed by Mingliang Liu)
This commit is contained in:
parent
bf6aa30a15
commit
2801b42a7e
@ -1632,6 +1632,9 @@ Release 2.8.0 - UNRELEASED
|
||||
HDFS-9236. Missing sanity check for block size during block recovery.
|
||||
(Tony Wu via Yongjun Zhang)
|
||||
|
||||
HDFS-9379. Make NNThroughputBenchmark$BlockReportStats support more than 10
|
||||
datanodes. (Mingliang Liu via Arpit Agarwal)
|
||||
|
||||
OPTIMIZATIONS
|
||||
|
||||
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than
|
||||
|
@ -1145,14 +1145,10 @@ void generateInputs(int[] ignore) throws IOException {
|
||||
int nrFiles = (int)Math.ceil((double)nrBlocks / blocksPerFile);
|
||||
datanodes = new TinyDatanode[nrDatanodes];
|
||||
// create data-nodes
|
||||
String prevDNName = "";
|
||||
for(int idx=0; idx < nrDatanodes; idx++) {
|
||||
datanodes[idx] = new TinyDatanode(idx, blocksPerReport);
|
||||
datanodes[idx].register();
|
||||
assert datanodes[idx].getXferAddr().compareTo(prevDNName) > 0
|
||||
: "Data-nodes must be sorted lexicographically.";
|
||||
datanodes[idx].sendHeartbeat();
|
||||
prevDNName = datanodes[idx].getXferAddr();
|
||||
}
|
||||
|
||||
// create files
|
||||
@ -1184,7 +1180,7 @@ private ExtendedBlock addBlocks(String fileName, String clientName)
|
||||
prevBlock, null, HdfsConstants.GRANDFATHER_INODE_ID, null);
|
||||
prevBlock = loc.getBlock();
|
||||
for(DatanodeInfo dnInfo : loc.getLocations()) {
|
||||
int dnIdx = Arrays.binarySearch(datanodes, dnInfo.getXferAddr());
|
||||
int dnIdx = dnInfo.getXferPort() - 1;
|
||||
datanodes[dnIdx].addBlock(loc.getBlock().getLocalBlock());
|
||||
ReceivedDeletedBlockInfo[] rdBlocks = { new ReceivedDeletedBlockInfo(
|
||||
loc.getBlock().getLocalBlock(),
|
||||
|
Loading…
Reference in New Issue
Block a user