HADOOP-12173. NetworkTopology::add calls toString always. Contributed by Inigo Goiri

(cherry picked from commit e59f6fad6a)
This commit is contained in:
Chris Douglas 2015-07-02 21:39:48 -07:00
parent efe9ae9fc6
commit f2c0539d38
2 changed files with 4 additions and 2 deletions

View File

@ -430,6 +430,9 @@ Release 2.8.0 - UNRELEASED
HADOOP-12164. Fix TestMove and TestFsShellReturnCode failed to get command
name using reflection. (lei)
HADOOP-12173. NetworkTopology::add calls toString always.
(Inigo Goiri via cdouglas)
Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -397,14 +397,13 @@ public class NetworkTopology {
int newDepth = NodeBase.locationToDepth(node.getNetworkLocation()) + 1;
netlock.writeLock().lock();
try {
String oldTopoStr = this.toString();
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 " + NodeBase.getPath(node) +
" at depth " + newDepth + " to topology:\n" + oldTopoStr);
" at depth " + newDepth + " to topology:\n" + this.toString());
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.");