From 2ae4b33d48db40bb0c222ac88df49e4b7c8e1493 Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Sat, 19 Oct 2019 11:05:54 +0530 Subject: [PATCH] HADOOP-16662. Remove unnecessary InnerNode check in NetworkTopology#add(). Contributed by Lisheng Sun. --- .../main/java/org/apache/hadoop/net/NetworkTopology.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java index 9f608de515..724cec37ba 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java @@ -146,10 +146,8 @@ public void add(Node node) { if (rack == null) { incrementRacks(); } - if (!(node instanceof InnerNode)) { - if (depthOfAllLeaves == -1) { - depthOfAllLeaves = node.getLevel(); - } + if (depthOfAllLeaves == -1) { + depthOfAllLeaves = node.getLevel(); } } LOG.debug("NetworkTopology became:\n{}", this);