[ https://issues.apache.org/jira/browse/HDFS-8884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14707446#comment-14707446 ]
Hudson commented on HDFS-8884: ------------------------------ FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #294 (See [https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/294/]) HDFS-8884. Fail-fast check in BlockPlacementPolicyDefault#chooseTarget. (yliu) (yliu: rev 80a29906bcd718bbba223fa099e523281d9f3369) * hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyWithNodeGroup.java * hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java * hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestDefaultBlockPlacementPolicy.java * hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt > Fail-fast check in BlockPlacementPolicyDefault#chooseTarget > ----------------------------------------------------------- > > Key: HDFS-8884 > URL: https://issues.apache.org/jira/browse/HDFS-8884 > Project: Hadoop HDFS > Issue Type: Improvement > Reporter: Yi Liu > Assignee: Yi Liu > Fix For: 2.8.0 > > Attachments: HDFS-8884.001.patch, HDFS-8884.002.patch > > > In current BlockPlacementPolicyDefault, when choosing datanode storage to > place block, we have following logic: > {code} > final DatanodeStorageInfo[] storages = DFSUtil.shuffle( > chosenNode.getStorageInfos()); > int i = 0; > boolean search = true; > for (Iterator<Map.Entry<StorageType, Integer>> iter = storageTypes > .entrySet().iterator(); search && iter.hasNext(); ) { > Map.Entry<StorageType, Integer> entry = iter.next(); > for (i = 0; i < storages.length; i++) { > StorageType type = entry.getKey(); > final int newExcludedNodes = addIfIsGoodTarget(storages[i], > {code} > We will iterate (actually two {{for}}, although they are usually small value) > all storages of the candidate datanode even the datanode itself is not good > (e.g. decommissioned, stale, too busy..), since currently we do all the check > in {{addIfIsGoodTarget}}. > We can fail-fast: check the datanode related conditions first, if the > datanode is not good, then no need to shuffle and iterate the storages. Then > it's more efficient. -- This message was sent by Atlassian JIRA (v6.3.4#6332)