merge HDFS-3332. NullPointerException in DN when directoryscanner is trying to report bad blocks. Contributed by Amith D K.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1333589 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uma Maheswara Rao G 2012-05-03 19:15:08 +00:00
parent c9aac0a1d1
commit 75fab46041
2 changed files with 6 additions and 0 deletions

View File

@ -468,6 +468,9 @@ Release 2.0.0 - UNRELEASED
HDFS-3351. NameNode#initializeGenericKeys should always set fs.defaultFS
regardless of whether HA or Federation is enabled. (atm)
HDFS-3332. NullPointerException in DN when directoryscanner is trying to
report bad blocks. (Amith D K via umamahesh)
BREAKDOWN OF HDFS-1623 SUBTASKS
HDFS-2179. Add fencing framework and mechanisms for NameNode HA. (todd)

View File

@ -235,6 +235,9 @@ class BPServiceActor implements Runnable {
}
void reportBadBlocks(ExtendedBlock block) {
if (bpRegistration == null) {
return;
}
DatanodeInfo[] dnArr = { new DatanodeInfo(bpRegistration) };
LocatedBlock[] blocks = { new LocatedBlock(block, dnArr) };