HDFS-9401. Fix findbugs warnings in BlockRecoveryWorker. Contributed by Brahma Reddy Battula.

This commit is contained in:
Walter Su 2015-11-10 14:48:08 +08:00
parent 94a1833638
commit 2fda45b9dc
3 changed files with 5 additions and 8 deletions

View File

@ -2282,6 +2282,9 @@ Release 2.8.0 - UNRELEASED
HDFS-9249. NPE is thrown if an IOException is thrown in NameNode constructor. HDFS-9249. NPE is thrown if an IOException is thrown in NameNode constructor.
(Wei-Chiu Chuang via Yongjun Zhang) (Wei-Chiu Chuang via Yongjun Zhang)
HDFS-9401. Fix findbugs warnings in BlockRecoveryWorker.
(Brahma Reddy Battula via waltersu4549)
Release 2.7.3 - UNRELEASED Release 2.7.3 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -124,13 +124,6 @@
<Bug pattern="DM_EXIT" /> <Bug pattern="DM_EXIT" />
</Match> </Match>
<!-- Don't complain about recoverBlock equality check -->
<Match>
<Class name="org.apache.hadoop.hdfs.server.datanode.DataNode" />
<Method name="recoverBlock" />
<Bug pattern="EC_UNRELATED_TYPES" />
</Match>
<!-- More complex cleanup logic confuses findbugs --> <!-- More complex cleanup logic confuses findbugs -->
<Match> <Match>
<Class name="org.apache.hadoop.hdfs.qjournal.server.Journal" /> <Class name="org.apache.hadoop.hdfs.qjournal.server.Journal" />

View File

@ -112,7 +112,8 @@ public class BlockRecoveryWorker {
// - Original state is RWR or better // - Original state is RWR or better
for(DatanodeID id : locs) { for(DatanodeID id : locs) {
try { try {
DatanodeID bpReg =datanode.getBPOfferService(bpid).bpRegistration; DatanodeID bpReg = new DatanodeID(
datanode.getBPOfferService(bpid).bpRegistration);
InterDatanodeProtocol proxyDN = bpReg.equals(id)? InterDatanodeProtocol proxyDN = bpReg.equals(id)?
datanode: DataNode.createInterDataNodeProtocolProxy(id, conf, datanode: DataNode.createInterDataNodeProtocolProxy(id, conf,
dnConf.socketTimeout, dnConf.connectToDnViaHostname); dnConf.socketTimeout, dnConf.connectToDnViaHostname);