You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "JiangHua Zhu (Jira)" <ji...@apache.org> on 2022/01/26 10:01:00 UTC
[jira] [Assigned] (HDFS-16439) Makes calculating maxNodesPerRack simpler
[ https://issues.apache.org/jira/browse/HDFS-16439?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
JiangHua Zhu reassigned HDFS-16439:
-----------------------------------
Assignee: JiangHua Zhu
> Makes calculating maxNodesPerRack simpler
> -----------------------------------------
>
> Key: HDFS-16439
> URL: https://issues.apache.org/jira/browse/HDFS-16439
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: namenode
> Affects Versions: 3.4.0
> Reporter: JiangHua Zhu
> Assignee: JiangHua Zhu
> Priority: Major
>
> When creating a new file, it is usually necessary to communicate with the namenode first to obtain the location of some DataNodes as the target location of Blockd. At this time, when BlockPlacementPolicyDefault#getMaxNodesPerRack() is executed, if the number of replicas is very large, once it exceeds the number of all nodes in the cluster. The following piece of code will be executed:
> int clusterSize = clusterMap.getNumOfLeaves();
> int totalNumOfReplicas = numOfChosen + numOfReplicas;
> if (totalNumOfReplicas > clusterSize) {
> numOfReplicas -= (totalNumOfReplicas-clusterSize);
> totalNumOfReplicas = clusterSize;
> }
> Here, the calculation for numOfReplicas gets a little more complicated. It can be simplified like:
> numOfReplicas = clusterSize - numOfChosen
> It would be more helpful to understand it this way, while also freeing up a little cpu (though not a lot).
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org