HADOOP-9673. NetworkTopology: When a node cannot be added, print out its location for diagnostic purposes
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1497180 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b7e4aae320
commit
7edc5f5456
|
@ -31,6 +31,9 @@ Release 2.2.0 - UNRELEASED
|
||||||
HADOOP-9355. Abstract symlink tests to use either FileContext or
|
HADOOP-9355. Abstract symlink tests to use either FileContext or
|
||||||
FileSystem. (Andrew Wang via Colin Patrick McCabe)
|
FileSystem. (Andrew Wang via Colin Patrick McCabe)
|
||||||
|
|
||||||
|
HADOOP-9673. NetworkTopology: when a node can't be added, print out its
|
||||||
|
location for diagnostic purposes. (Colin Patrick McCabe)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
|
@ -397,10 +397,10 @@ public class NetworkTopology {
|
||||||
netlock.writeLock().lock();
|
netlock.writeLock().lock();
|
||||||
try {
|
try {
|
||||||
if ((depthOfAllLeaves != -1) && (depthOfAllLeaves != newDepth)) {
|
if ((depthOfAllLeaves != -1) && (depthOfAllLeaves != newDepth)) {
|
||||||
LOG.error("Error: can't add leaf node at depth " +
|
LOG.error("Error: can't add leaf node " + NodeBase.getPath(node) +
|
||||||
newDepth + " to topology:\n" + oldTopoStr);
|
" at depth " + newDepth + " to topology:\n" + oldTopoStr);
|
||||||
throw new InvalidTopologyException("Invalid network topology. " +
|
throw new InvalidTopologyException("Failed to add " + NodeBase.getPath(node) +
|
||||||
"You cannot have a rack and a non-rack node at the same " +
|
": You cannot have a rack and a non-rack node at the same " +
|
||||||
"level of the network topology.");
|
"level of the network topology.");
|
||||||
}
|
}
|
||||||
Node rack = getNodeForNetworkLocation(node);
|
Node rack = getNodeForNetworkLocation(node);
|
||||||
|
|
|
@ -91,9 +91,10 @@ public class TestNetworkTopology {
|
||||||
invalCluster.add(invalDataNodes[2]);
|
invalCluster.add(invalDataNodes[2]);
|
||||||
fail("expected InvalidTopologyException");
|
fail("expected InvalidTopologyException");
|
||||||
} catch (NetworkTopology.InvalidTopologyException e) {
|
} catch (NetworkTopology.InvalidTopologyException e) {
|
||||||
assertEquals(e.getMessage(), "Invalid network topology. " +
|
assertTrue(e.getMessage().startsWith("Failed to add "));
|
||||||
|
assertTrue(e.getMessage().contains(
|
||||||
"You cannot have a rack and a non-rack node at the same " +
|
"You cannot have a rack and a non-rack node at the same " +
|
||||||
"level of the network topology.");
|
"level of the network topology."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue