Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 01404DDA2 for ; Tue, 13 Nov 2012 01:36:13 +0000 (UTC) Received: (qmail 78385 invoked by uid 500); 13 Nov 2012 01:36:12 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 78319 invoked by uid 500); 13 Nov 2012 01:36:12 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 78310 invoked by uid 99); 13 Nov 2012 01:36:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2012 01:36:12 +0000 Date: Tue, 13 Nov 2012 01:36:12 +0000 (UTC) From: "Jing Zhao (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <421074995.104524.1352770572609.JavaMail.jiratomcat@arcas> In-Reply-To: <79078274.85721.1347821047421.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (HADOOP-8820) Backport HADOOP-8469 and HADOOP-8470: add "NodeGroup" layer in new NetworkTopology (also known as NetworkTopologyWithNodeGroup) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-8820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495829#comment-13495829 ] Jing Zhao commented on HADOOP-8820: ----------------------------------- Besides, some other small issues: 1. {noformat} + @Override + boolean isRack() { + // it is node group + if (getChildren().isEmpty()) { + return false; + } + + Node firstChild = children.get(0); + + if (firstChild instanceof InnerNode) { + Node firstGrandChild = (((InnerNode) firstChild).children).get(0); + if (firstGrandChild instanceof InnerNode) { {noformat} I think here maybe firstChild.children can be empty thus the get(0) may cause an IndexOutofBoundsException. So maybe we need to check if children is empty first (and if it is, we can return true)? 2. {noformat} + public String getNodeGroup(String loc) { + try { + netlock.readLock().lock(); + loc = InnerNode.normalize(loc); + Node locNode = getNode(loc); + if (locNode instanceof InnerNodeWithNodeGroup) { + InnerNodeWithNodeGroup node = (InnerNodeWithNodeGroup) locNode; + if (node.isNodeGroup()) { + return loc; + } else if (node.isRack()) { + // not sure the node group for a rack + return null; + } else { + // may be a leaf node + return getNodeGroup(node.getNetworkLocation()); + } {noformat} Since the "locNode" is already an instance of InnerNodeWithNodeGroup, I think it cannot be a leaf node anymore, thus the code may never run into the "else" part? I can create a separate jira to fix if you think the two issues stand. > Backport HADOOP-8469 and HADOOP-8470: add "NodeGroup" layer in new NetworkTopology (also known as NetworkTopologyWithNodeGroup) > ------------------------------------------------------------------------------------------------------------------------------- > > Key: HADOOP-8820 > URL: https://issues.apache.org/jira/browse/HADOOP-8820 > Project: Hadoop Common > Issue Type: New Feature > Components: net > Affects Versions: 1.0.0 > Reporter: Junping Du > Assignee: Junping Du > Attachments: HADOOP-8820.b1.002.patch, HADOOP-8820.patch > > > This patch backport HADOOP-8469 and HADOOP-8470 to branch-1 and includes: > 1. Make NetworkTopology class pluggable for extension. > 2. Implement a 4-layer NetworkTopology class (named as NetworkTopologyWithNodeGroup) to use in virtualized environment (or other situation with additional layer between host and rack). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira