HDFS-9484. NNThroughputBenchmark$BlockReportStats should not send empty block reports. Contributed by Mingliang Liu.
(cherry picked from commit 33d4588a7c
)
Conflicts:
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
This commit is contained in:
parent
69d3a71f14
commit
0b88a7f259
|
@ -1616,6 +1616,9 @@ Release 2.8.0 - UNRELEASED
|
||||||
HDFS-9347. Invariant assumption in TestQuorumJournalManager.shutdown()
|
HDFS-9347. Invariant assumption in TestQuorumJournalManager.shutdown()
|
||||||
is wrong. (Wei-Chiu Chuang via zhz)
|
is wrong. (Wei-Chiu Chuang via zhz)
|
||||||
|
|
||||||
|
HDFS-9484. NNThroughputBenchmark$BlockReportStats should not send empty
|
||||||
|
block reports. (Mingliang Liu via shv)
|
||||||
|
|
||||||
Release 2.7.3 - UNRELEASED
|
Release 2.7.3 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -925,7 +925,7 @@ public class NNThroughputBenchmark implements Tool {
|
||||||
NamespaceInfo nsInfo;
|
NamespaceInfo nsInfo;
|
||||||
DatanodeRegistration dnRegistration;
|
DatanodeRegistration dnRegistration;
|
||||||
DatanodeStorage storage; //only one storage
|
DatanodeStorage storage; //only one storage
|
||||||
final ArrayList<BlockReportReplica> blocks;
|
final List<BlockReportReplica> blocks;
|
||||||
int nrBlocks; // actual number of blocks
|
int nrBlocks; // actual number of blocks
|
||||||
BlockListAsLongs blockReportList;
|
BlockListAsLongs blockReportList;
|
||||||
final int dnIdx;
|
final int dnIdx;
|
||||||
|
@ -938,7 +938,7 @@ public class NNThroughputBenchmark implements Tool {
|
||||||
|
|
||||||
TinyDatanode(int dnIdx, int blockCapacity) throws IOException {
|
TinyDatanode(int dnIdx, int blockCapacity) throws IOException {
|
||||||
this.dnIdx = dnIdx;
|
this.dnIdx = dnIdx;
|
||||||
this.blocks = new ArrayList<BlockReportReplica>(blockCapacity);
|
this.blocks = Arrays.asList(new BlockReportReplica[blockCapacity]);
|
||||||
this.nrBlocks = 0;
|
this.nrBlocks = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1013,7 +1013,7 @@ public class NNThroughputBenchmark implements Tool {
|
||||||
Block block = new Block(blocks.size() - idx, 0, 0);
|
Block block = new Block(blocks.size() - idx, 0, 0);
|
||||||
blocks.set(idx, new BlockReportReplica(block));
|
blocks.set(idx, new BlockReportReplica(block));
|
||||||
}
|
}
|
||||||
blockReportList = BlockListAsLongs.EMPTY;
|
blockReportList = BlockListAsLongs.encode(blocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockListAsLongs getBlockReportList() {
|
BlockListAsLongs getBlockReportList() {
|
||||||
|
|
Loading…
Reference in New Issue