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

Hadoop QA commented on HADOOP-16662:
------------------------------------

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 34m 
58s{color} | {color:blue} Docker mode activated. {color} |
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} @author {color} | {color:green}  0m  
0s{color} | {color:green} The patch does not contain any @author tags. {color} |
| {color:red}-1{color} | {color:red} test4tests {color} | {color:red}  0m  
0s{color} | {color:red} The patch doesn't appear to include any new or modified 
tests. Please justify why no new tests are needed for this patch. Also please 
list what manual steps were performed to verify this patch. {color} |
|| || || || {color:brown} trunk Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 19m 
53s{color} | {color:green} trunk passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 16m 
19s{color} | {color:green} trunk passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m 
40s{color} | {color:green} trunk passed {color} |
| {color:green}+1{color} | {color:green} mvnsite {color} | {color:green}  1m 
15s{color} | {color:green} trunk passed {color} |
| {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 
14m 48s{color} | {color:green} branch has no errors when building and testing 
our client artifacts. {color} |
| {color:green}+1{color} | {color:green} findbugs {color} | {color:green}  1m 
43s{color} | {color:green} trunk passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  1m 
19s{color} | {color:green} trunk passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  0m 
48s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 16m 
12s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green} 16m 
12s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m 
40s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} mvnsite {color} | {color:green}  1m  
8s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} whitespace {color} | {color:green}  0m 
 0s{color} | {color:green} The patch has no whitespace issues. {color} |
| {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 
12m 59s{color} | {color:green} patch has no errors when building and testing 
our client artifacts. {color} |
| {color:green}+1{color} | {color:green} findbugs {color} | {color:green}  1m 
59s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  1m 
23s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  9m 
20s{color} | {color:green} hadoop-common in the patch passed. {color} |
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green}  0m 
42s{color} | {color:green} The patch does not generate ASF License warnings. 
{color} |
| {color:black}{color} | {color:black} {color} | {color:black}136m 24s{color} | 
{color:black} {color} |
\\
\\
|| Subsystem || Report/Notes ||
| Docker | Client=19.03.4 Server=19.03.4 Image:yetus/hadoop:104ccca9169 |
| JIRA Issue | HADOOP-16662 |
| JIRA Patch URL | 
https://issues.apache.org/jira/secure/attachment/12983489/HADOOP-16662.001.patch
 |
| Optional Tests |  dupname  asflicense  compile  javac  javadoc  mvninstall  
mvnsite  unit  shadedclient  findbugs  checkstyle  |
| uname | Linux 8e43c9a42dc7 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 
10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | /testptch/patchprocess/precommit/personality/provided.sh |
| git revision | trunk / 155864d |
| maven | version: Apache Maven 3.3.9 |
| Default Java | 1.8.0_222 |
| findbugs | v3.1.0-RC1 |
|  Test Results | 
https://builds.apache.org/job/PreCommit-HADOOP-Build/16604/testReport/ |
| Max. process+thread count | 1345 (vs. ulimit of 5500) |
| modules | C: hadoop-common-project/hadoop-common U: 
hadoop-common-project/hadoop-common |
| Console output | 
https://builds.apache.org/job/PreCommit-HADOOP-Build/16604/console |
| Powered by | Apache Yetus 0.8.0   http://yetus.apache.org |


This message was automatically generated.



> Remove invalid judgment in NetworkTopology#add()
> ------------------------------------------------
>
>                 Key: HADOOP-16662
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16662
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Lisheng Sun
>            Assignee: Lisheng Sun
>            Priority: Minor
>         Attachments: HADOOP-16662.001.patch
>
>
> The method of NetworkTopology#add() as follow:
> {code:java}
> /** Add a leaf node
>  * Update node counter & rack counter if necessary
>  * @param node node to be added; can be null
>  * @exception IllegalArgumentException if add a node to a leave 
>                                        or node to be added is not a leaf
>  */
> public void add(Node node) {
>   if (node==null) return;
>   int newDepth = NodeBase.locationToDepth(node.getNetworkLocation()) + 1;
>   netlock.writeLock().lock();
>   try {
>     if( node instanceof InnerNode ) {
>       throw new IllegalArgumentException(
>         "Not allow to add an inner node: "+NodeBase.getPath(node));
>     }
>     if ((depthOfAllLeaves != -1) && (depthOfAllLeaves != newDepth)) {
>       LOG.error("Error: can't add leaf node {} at depth {} to topology:{}\n",
>           NodeBase.getPath(node), newDepth, this);
>       throw new InvalidTopologyException("Failed to add " + 
> NodeBase.getPath(node) +
>           ": You cannot have a rack and a non-rack node at the same " +
>           "level of the network topology.");
>     }
>     Node rack = getNodeForNetworkLocation(node);
>     if (rack != null && !(rack instanceof InnerNode)) {
>       throw new IllegalArgumentException("Unexpected data node " 
>                                          + node.toString() 
>                                          + " at an illegal network location");
>     }
>     if (clusterMap.add(node)) {
>       LOG.info("Adding a new node: "+NodeBase.getPath(node));
>       if (rack == null) {
>         incrementRacks();
>       }
>       if (!(node instanceof InnerNode)) {
>         if (depthOfAllLeaves == -1) {
>           depthOfAllLeaves = node.getLevel();
>         }
>       }
>     }
>     LOG.debug("NetworkTopology became:\n{}", this);
>   } finally {
>     netlock.writeLock().unlock();
>   }
> }
> {code}
> {code:java}
> if( node instanceof InnerNode ) {
>   throw new IllegalArgumentException(
>     "Not allow to add an inner node: "+NodeBase.getPath(node));
> }
> if (!(node instanceof InnerNode)) is invalid,since there is already a 
> judgement before as follow:
> if (!(node instanceof InnerNode)) {
>   if (depthOfAllLeaves == -1) {
>     depthOfAllLeaves = node.getLevel();
>   }
> }{code}
> so i think if (!(node instanceof InnerNode)) should be removed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to