[ 
https://issues.apache.org/jira/browse/HADOOP-8472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13405659#comment-13405659
 ] 

Tsz Wo (Nicholas), SZE commented on HADOOP-8472:
------------------------------------------------

> ... TopologyResolver is called in BlockPlacementPolicyWithNodeGroup ...

But all calls have withNodeGroupLayer == true so they can use the then-clause 
directly, e.g. in the getRack method below, use 
getFirstHalf(host.getNetworkLocation()) instead of getRack(host, true).

{code}
+  public static String getRack(Node host, boolean withNodeGroupLayer) {
+    return withNodeGroupLayer ? getFirstHalf(host.getNetworkLocation()) 
+        : host.getNetworkLocation();
+  }
{code}

The NodeGroup concept should only be visible in the pluggin.  The original code 
should know nothing about it.
                
> Implementation of ReplicaPlacementPolicyNodeGroup to support 4-layer network 
> topology
> -------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8472
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8472
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: ha, io
>    Affects Versions: 1.0.0, 2.0.0-alpha
>            Reporter: Junping Du
>            Assignee: Junping Du
>         Attachments: 
> HADOOP-8472-BlockPlacementPolicyWithNodeGroup-impl-v2.patch, 
> HADOOP-8472-BlockPlacementPolicyWithNodeGroup-impl-v3.patch, 
> HADOOP-8472-BlockPlacementPolicyWithNodeGroup-impl-v4.patch, 
> HADOOP-8472-BlockPlacementPolicyWithNodeGroup-impl.patch
>
>
> A subclass of ReplicaPlacementPolicyDefault, ReplicaPlacementPolicyNodeGroup 
> was developed along with unit tests to support the four-layer hierarchical 
> topology.
> The replica placement strategy used in ReplicaPlacementPolicyNodeGroup 
> virtualization is almost the same as the original one. The differences are:
> 1. The 3rd replica will be off node group of the 2nd replica
> 2. If there is no local node available, the 1st replica will be placed on a 
> node in the local node group.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to