HDFS-2486. Remove unnecessary priority level checks in UnderReplicatedBlocks. Contributed by Uma Maheswara Rao G

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1242636 13f79535-47bb-0310-9956-ffa450edef68
(cherry picked from commit dc847b39fd)

Conflicts:
	hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/UnderReplicatedBlocks.java
This commit is contained in:
Tsz-wo Sze 2012-02-10 02:05:38 +00:00 committed by Andrew Wang
parent b3bb4fdc7c
commit 3e2889f3c7
2 changed files with 6 additions and 3 deletions

View File

@ -34,6 +34,9 @@ Release 2.7.0 - UNRELEASED
HDFS-6877. Avoid calling checkDisk when an HDFS volume is removed during a
write. (Lei Xu via Colin P. McCabe)
HDFS-2486. Remove unnecessary priority level checks in
UnderReplicatedBlocks. (Uma Maheswara Rao G via szetszwo)
OPTIMIZATIONS
BUG FIXES

View File

@ -190,7 +190,7 @@ synchronized boolean add(Block block,
assert curReplicas >= 0 : "Negative replicas!";
int priLevel = getPriority(block, curReplicas, decomissionedReplicas,
expectedReplicas);
if(priLevel != LEVEL && priorityQueues.get(priLevel).add(block)) {
if(priorityQueues.get(priLevel).add(block)) {
if(NameNode.blockStateChangeLog.isDebugEnabled()) {
NameNode.blockStateChangeLog.debug(
"BLOCK* NameSystem.UnderReplicationBlock.add:"
@ -293,10 +293,10 @@ synchronized void update(Block block, int curReplicas,
" curPri " + curPri +
" oldPri " + oldPri);
}
if(oldPri != LEVEL && oldPri != curPri) {
if(oldPri != curPri) {
remove(block, oldPri);
}
if(curPri != LEVEL && priorityQueues.get(curPri).add(block)) {
if(priorityQueues.get(curPri).add(block)) {
if(NameNode.blockStateChangeLog.isDebugEnabled()) {
NameNode.blockStateChangeLog.debug(
"BLOCK* NameSystem.UnderReplicationBlock.update:"