hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weic...@apache.org
Subject hadoop git commit: HDFS-13155. BlockPlacementPolicyDefault.chooseTargetInOrder Not Checking Return Value for NULL. Contributed by Zsolt Venczel.
Date Mon, 04 Jun 2018 14:03:15 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 9efb4b7db -> bccdfeee0


HDFS-13155. BlockPlacementPolicyDefault.chooseTargetInOrder Not Checking Return Value for
NULL. Contributed by Zsolt Venczel.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/bccdfeee
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/bccdfeee
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/bccdfeee

Branch: refs/heads/trunk
Commit: bccdfeee0aaef9cb98d09ee39909b63fdcbeeafc
Parents: 9efb4b7
Author: Wei-Chiu Chuang <weichiu@apache.org>
Authored: Mon Jun 4 07:02:05 2018 -0700
Committer: Wei-Chiu Chuang <weichiu@apache.org>
Committed: Mon Jun 4 07:03:05 2018 -0700

----------------------------------------------------------------------
 .../blockmanagement/BlockPlacementPolicyDefault.java      | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/bccdfeee/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java
index 518e62c..c94232f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java
@@ -485,9 +485,13 @@ public class BlockPlacementPolicyDefault extends BlockPlacementPolicy
{
                                  throws NotEnoughReplicasException {
     final int numOfResults = results.size();
     if (numOfResults == 0) {
-      writer = chooseLocalStorage(writer, excludedNodes, blocksize,
-          maxNodesPerRack, results, avoidStaleNodes, storageTypes, true)
-          .getDatanodeDescriptor();
+      DatanodeStorageInfo storageInfo = chooseLocalStorage(writer,
+          excludedNodes, blocksize, maxNodesPerRack, results, avoidStaleNodes,
+          storageTypes, true);
+
+      writer = (storageInfo != null) ? storageInfo.getDatanodeDescriptor()
+                                     : null;
+
       if (--numOfReplicas == 0) {
         return writer;
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message