HDFS-3321. Fix safe mode turn off tip message. Contributed by Ravi Prakash

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1330506 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Tsz-wo Sze 2012-04-25 19:34:36 +00:00
parent f86352c2df
commit 2584779166
3 changed files with 4 additions and 2 deletions

View File

@ -901,6 +901,8 @@ Release 0.23.3 - UNRELEASED
HDFS-3318. Use BoundedInputStream in ByteRangeInputStream, otherwise, it HDFS-3318. Use BoundedInputStream in ByteRangeInputStream, otherwise, it
hangs on transfers >2 GB. (Daryn Sharp via szetszwo) hangs on transfers >2 GB. (Daryn Sharp via szetszwo)
HDFS-3321. Fix safe mode turn off tip message. (Ravi Prakash via szetszwo)
Release 0.23.2 - UNRELEASED Release 0.23.2 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -3723,7 +3723,7 @@ String getTurnOffTip() {
msg += String.format( msg += String.format(
"The number of live datanodes %d needs an additional %d live " "The number of live datanodes %d needs an additional %d live "
+ "datanodes to reach the minimum number %d.", + "datanodes to reach the minimum number %d.",
numLive, (datanodeThreshold - numLive) + 1 , datanodeThreshold); numLive, (datanodeThreshold - numLive), datanodeThreshold);
} }
msg += " " + leaveMsg; msg += " " + leaveMsg;
} else { } else {

View File

@ -342,7 +342,7 @@ public void testDatanodeThreshold() throws IOException {
String tipMsg = cluster.getNamesystem().getSafemode(); String tipMsg = cluster.getNamesystem().getSafemode();
assertTrue("Safemode tip message looks right: " + tipMsg, assertTrue("Safemode tip message looks right: " + tipMsg,
tipMsg.contains("The number of live datanodes 0 needs an additional " + tipMsg.contains("The number of live datanodes 0 needs an additional " +
"2 live datanodes to reach the minimum number 1. " + "1 live datanodes to reach the minimum number 1. " +
"Safe mode will be turned off automatically.")); "Safe mode will be turned off automatically."));
// Start a datanode // Start a datanode