HDFS-5251. Race between the initialization of NameNode and the http server. Contributed by Haohui Mai.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1525787 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e3088e4aef
commit
b838ac89a6
|
@ -327,6 +327,9 @@ Release 2.2.0 - UNRELEASED
|
||||||
|
|
||||||
HDFS-5139. Remove redundant -R option from setrep.
|
HDFS-5139. Remove redundant -R option from setrep.
|
||||||
|
|
||||||
|
HDFS-5251. Race between the initialization of NameNode and the http
|
||||||
|
server. (Haohui Mai via suresh)
|
||||||
|
|
||||||
Release 2.1.1-beta - 2013-09-23
|
Release 2.1.1-beta - 2013-09-23
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -101,6 +101,10 @@ class NamenodeJspHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
static String getRollingUpgradeText(FSNamesystem fsn) {
|
static String getRollingUpgradeText(FSNamesystem fsn) {
|
||||||
|
if (fsn == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
DatanodeManager dm = fsn.getBlockManager().getDatanodeManager();
|
DatanodeManager dm = fsn.getBlockManager().getDatanodeManager();
|
||||||
Map<String, Integer> list = dm.getDatanodesSoftwareVersions();
|
Map<String, Integer> list = dm.getDatanodesSoftwareVersions();
|
||||||
if(list.size() > 1) {
|
if(list.size() > 1) {
|
||||||
|
|
|
@ -18,8 +18,13 @@
|
||||||
package org.apache.hadoop.hdfs.server.namenode;
|
package org.apache.hadoop.hdfs.server.namenode;
|
||||||
|
|
||||||
|
|
||||||
import static org.apache.hadoop.hdfs.server.namenode.startupprogress.Phase.*;
|
import static org.apache.hadoop.hdfs.server.namenode.startupprogress.Phase.LOADING_EDITS;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.apache.hadoop.hdfs.server.namenode.startupprogress.Phase.LOADING_FSIMAGE;
|
||||||
|
import static org.apache.hadoop.hdfs.server.namenode.startupprogress.Phase.SAFEMODE;
|
||||||
|
import static org.apache.hadoop.hdfs.server.namenode.startupprogress.Phase.SAVING_CHECKPOINT;
|
||||||
|
import static org.mockito.Mockito.atLeastOnce;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -107,6 +112,11 @@ public class TestNameNodeJspHelper {
|
||||||
Assert.assertTrue(containsMatch(contents, SAFEMODE.getDescription()));
|
Assert.assertTrue(containsMatch(contents, SAFEMODE.getDescription()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetRollingUpgradeText() {
|
||||||
|
Assert.assertEquals("", NamenodeJspHelper.getRollingUpgradeText(null));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the list contains any string that partially matches the regex.
|
* Checks if the list contains any string that partially matches the regex.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue