HDFS-5747. Merging r1557289 from trunk to branch-2.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1557291 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arpit Agarwal 2014-01-11 00:14:19 +00:00
parent a7632fa9e2
commit a96ff86044
3 changed files with 9 additions and 5 deletions

View File

@ -260,7 +260,9 @@ Release 2.4.0 - UNRELEASED
HDFS-5756. hadoopRzOptionsSetByteBufferPool does not accept NULL argument, HDFS-5756. hadoopRzOptionsSetByteBufferPool does not accept NULL argument,
contrary to docs. (cmccabe via wang) contrary to docs. (cmccabe via wang)
BREAKDOWN OF HDFS-2832 SUBTASKS AND RELATED JIRAS HDFS-5747. Fix NPEs in BlockManager. (Arpit Agarwal)
BREAKDOWN OF HDFS-2832 SUBTASKS AND RELATED JIRAS
HDFS-4985. Add storage type to the protocol and expose it in block report HDFS-4985. Add storage type to the protocol and expose it in block report
and block locations. (Arpit Agarwal) and block locations. (Arpit Agarwal)

View File

@ -324,12 +324,14 @@ public class BlockInfoUnderConstruction extends BlockInfo {
Iterator<ReplicaUnderConstruction> it = replicas.iterator(); Iterator<ReplicaUnderConstruction> it = replicas.iterator();
while (it.hasNext()) { while (it.hasNext()) {
ReplicaUnderConstruction r = it.next(); ReplicaUnderConstruction r = it.next();
if(r.getExpectedStorageLocation() == storage) { DatanodeStorageInfo expectedLocation = r.getExpectedStorageLocation();
if(expectedLocation == storage) {
// Record the gen stamp from the report // Record the gen stamp from the report
r.setGenerationStamp(block.getGenerationStamp()); r.setGenerationStamp(block.getGenerationStamp());
return; return;
} else if (r.getExpectedStorageLocation().getDatanodeDescriptor() == } else if (expectedLocation != null &&
storage.getDatanodeDescriptor()) { expectedLocation.getDatanodeDescriptor() ==
storage.getDatanodeDescriptor()) {
// The Datanode reported that the block is on a different storage // The Datanode reported that the block is on a different storage
// than the one chosen by BlockPlacementPolicy. This can occur as // than the one chosen by BlockPlacementPolicy. This can occur as

View File

@ -549,8 +549,8 @@ public class NameNode implements NameNodeStatusMXBean {
} }
private void stopCommonServices() { private void stopCommonServices() {
if(namesystem != null) namesystem.close();
if(rpcServer != null) rpcServer.stop(); if(rpcServer != null) rpcServer.stop();
if(namesystem != null) namesystem.close();
if (pauseMonitor != null) pauseMonitor.stop(); if (pauseMonitor != null) pauseMonitor.stop();
if (plugins != null) { if (plugins != null) {
for (ServicePlugin p : plugins) { for (ServicePlugin p : plugins) {