This is an automated email from the ASF dual-hosted git repository.
aengineer pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 041e7a7 HDFS-14598. Findbugs warning caused by HDFS-12487.
Contributed by He Xiaoqiao.
041e7a7 is described below
commit 041e7a7dee4a17714f31952dc6364c77a65b1b73
Author: Anu Engineer <[email protected]>
AuthorDate: Mon Jun 24 15:34:11 2019 -0700
HDFS-14598. Findbugs warning caused by HDFS-12487.
Contributed by He Xiaoqiao.
---
.../hadoop/hdfs/server/datanode/DiskBalancer.java | 25 ++++++++--------------
1 file changed, 9 insertions(+), 16 deletions(-)
diff --git
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java
index f8d4ea4..9183344 100644
---
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java
+++
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java
@@ -908,24 +908,17 @@ public class DiskBalancer {
if(null == block){
LOG.info("NextBlock call returned null.No valid block to copy. {}",
item.toJson());
- return block;
+ return null;
}
-
- if (block != null) {
- // A valid block is a finalized block, we iterate until we get
- // finalized blocks
- if (!this.dataset.isValidBlock(block)) {
- continue;
- }
-
- // We don't look for the best, we just do first fit
- if (isLessThanNeeded(block.getNumBytes(), item)) {
- return block;
- }
- } else {
- LOG.info("There are no blocks in the blockPool {}",
iter.getBlockPoolId());
+ // A valid block is a finalized block, we iterate until we get
+ // finalized blocks
+ if (!this.dataset.isValidBlock(block)) {
+ continue;
+ }
+ // We don't look for the best, we just do first fit
+ if (isLessThanNeeded(block.getNumBytes(), item)) {
+ return block;
}
-
} catch (IOException e) {
item.incErrorCount();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]