You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by yu...@apache.org on 2017/10/09 12:44:56 UTC
hadoop git commit: HDFS-12609. Ozone: SCM: Refactoring of chill mode
logic in NodeManager. Contributed by Nandakumar.
Repository: hadoop
Updated Branches:
refs/heads/HDFS-7240 918715ca4 -> d7281023a
HDFS-12609. Ozone: SCM: Refactoring of chill mode logic in NodeManager. Contributed by Nandakumar.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/d7281023
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/d7281023
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/d7281023
Branch: refs/heads/HDFS-7240
Commit: d7281023ad3dd159b33d390adf59e8a92a52355b
Parents: 918715c
Author: yuanbo <yu...@apache.org>
Authored: Mon Oct 9 20:43:17 2017 +0800
Committer: yuanbo <yu...@apache.org>
Committed: Mon Oct 9 20:43:17 2017 +0800
----------------------------------------------------------------------
.../ozone/scm/block/BlockManagerImpl.java | 4 +-
.../ozone/scm/container/ContainerMapping.java | 2 +-
.../hadoop/ozone/scm/node/NodeManager.java | 8 +-
.../ozone/scm/node/NodeManagerMXBean.java | 14 +---
.../hadoop/ozone/scm/node/SCMNodeManager.java | 79 +++++++-------------
.../apache/hadoop/ozone/MiniOzoneCluster.java | 2 +-
.../TestUtils/ReplicationNodeManagerMock.java | 38 ++++------
.../apache/hadoop/ozone/scm/TestSCMMXBean.java | 8 +-
.../ozone/scm/container/MockNodeManager.java | 36 +++------
.../ozone/scm/node/TestContainerPlacement.java | 4 +-
.../hadoop/ozone/scm/node/TestNodeManager.java | 31 ++++----
11 files changed, 82 insertions(+), 144 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7281023/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
index 95d5cbc..3d36bf1 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
@@ -226,7 +226,7 @@ public class BlockManagerImpl implements BlockManager, BlockmanagerMXBean {
INVALID_BLOCK_SIZE);
}
- if (!nodeManager.isOutOfNodeChillMode()) {
+ if (!nodeManager.isOutOfChillMode()) {
LOG.warn("Not out of Chill mode.");
throw new SCMException("Unable to create block while in chill mode",
CHILL_MODE_EXCEPTION);
@@ -403,7 +403,7 @@ public class BlockManagerImpl implements BlockManager, BlockmanagerMXBean {
*/
@Override
public void deleteBlocks(List<String> blockIDs) throws IOException {
- if (!nodeManager.isOutOfNodeChillMode()) {
+ if (!nodeManager.isOutOfChillMode()) {
throw new SCMException("Unable to delete block while in chill mode",
CHILL_MODE_EXCEPTION);
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7281023/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
index 8c4782e..ad1d3c9 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
@@ -183,7 +183,7 @@ public class ContainerMapping implements Mapping {
Preconditions.checkNotNull(containerName);
Preconditions.checkState(!containerName.isEmpty());
ContainerInfo containerInfo = null;
- if (!nodeManager.isOutOfNodeChillMode()) {
+ if (!nodeManager.isOutOfChillMode()) {
throw new SCMException(
"Unable to create container while in chill mode",
SCMException.ResultCodes.CHILL_MODE_EXCEPTION);
http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7281023/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/NodeManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/NodeManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/NodeManager.java
index dec3776..266428b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/NodeManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/NodeManager.java
@@ -94,14 +94,14 @@ public interface NodeManager extends StorageContainerNodeProtocol,
void forceExitChillMode();
/**
- * Forcefully enters chill mode, even if all minimum node conditions are met.
+ * Puts the node manager into manual chill mode.
*/
- void forceEnterChillMode();
+ void enterChillMode();
/**
- * Clears the manual chill mode flag.
+ * Brings node manager out of manual chill mode.
*/
- void clearChillModeFlag();
+ void exitChillMode();
/**
* Returns the aggregated node stats.
http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7281023/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/NodeManagerMXBean.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/NodeManagerMXBean.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/NodeManagerMXBean.java
index 6a6c1f9..46881c9 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/NodeManagerMXBean.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/NodeManagerMXBean.java
@@ -36,13 +36,6 @@ public interface NodeManagerMXBean {
int getMinimumChillModeNodes();
/**
- * Reports if we have exited out of chill mode by discovering enough nodes.
- *
- * @return True if we are out of Node layer chill mode, false otherwise.
- */
- boolean isOutOfNodeChillMode();
-
- /**
* Returns a chill mode status string.
* @return String
*/
@@ -50,11 +43,10 @@ public interface NodeManagerMXBean {
/**
- * Returns the status of manual chill mode flag.
- * @return true if forceEnterChillMode has been called,
- * false if forceExitChillMode or status is not set. eg. clearChillModeFlag.
+ * Returns true if node manager is out of chill mode, else false.
+ * @return true if out of chill mode, else false
*/
- boolean isInManualChillMode();
+ boolean isOutOfChillMode();
/**
* Get the number of data nodes that in all states.
http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7281023/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodeManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodeManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodeManager.java
index c181a85..f818e75 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodeManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodeManager.java
@@ -293,61 +293,22 @@ public class SCMNodeManager
}
/**
- * Reports if we have exited out of chill mode.
- *
- * @return true if we are out of chill mode.
- */
- @Override
- public boolean isOutOfNodeChillMode() {
- return !inStartupChillMode.get() && !inManualChillMode.get();
- }
-
- /**
- * Clears the manual chill mode.
- */
- @Override
- public void clearChillModeFlag() {
- LOG.info("Clearing manual chill mode flag.");
- this.inManualChillMode.getAndSet(false);
- }
-
- /**
* Returns chill mode Status string.
* @return String
*/
@Override
public String getChillModeStatus() {
if (inStartupChillMode.get()) {
- return "Still in chill mode, waiting on nodes to report in."
- + getNodeStatus();
+ return "Still in chill mode, waiting on nodes to report in." +
+ String.format(" %d nodes reported, minimal %d nodes required.",
+ totalNodes.get(), getMinimumChillModeNodes());
}
if (inManualChillMode.get()) {
return "Out of startup chill mode, but in manual chill mode." +
- getNodeStatus();
+ String.format(" %d nodes have reported in.", totalNodes.get());
}
- return "Out of chill mode." + getNodeStatus();
- }
-
- /**
- * Returns a node status string.
- * @return - String
- */
- private String getNodeStatus() {
- return isOutOfNodeChillMode() ?
- String.format(" %d nodes have reported in.", totalNodes.get()) :
- String.format(" %d nodes reported, minimal %d nodes required.",
- totalNodes.get(), getMinimumChillModeNodes());
- }
-
- /**
- * Returns the status of Manual chill Mode flag.
- *
- * @return true if forceEnterChillMode has been called, false if
- * forceExitChillMode or status is not set. eg. clearChillModeFlag.
- */
- @Override
- public boolean isInManualChillMode() {
- return inManualChillMode.get();
+ return "Out of chill mode." +
+ String.format(" %d nodes have reported in.", totalNodes.get());
}
/**
@@ -359,21 +320,39 @@ public class SCMNodeManager
public void forceExitChillMode() {
if(inStartupChillMode.get()) {
LOG.info("Leaving startup chill mode.");
- inStartupChillMode.getAndSet(false);
+ inStartupChillMode.set(false);
}
if(inManualChillMode.get()) {
LOG.info("Leaving manual chill mode.");
- inManualChillMode.getAndSet(false);
+ inManualChillMode.set(false);
}
}
/**
- * Forcefully enters chill mode, even if all chill mode conditions are met.
+ * Puts the node manager into manual chill mode.
*/
@Override
- public void forceEnterChillMode() {
+ public void enterChillMode() {
LOG.info("Entering manual chill mode.");
- inManualChillMode.getAndSet(true);
+ inManualChillMode.set(true);
+ }
+
+ /**
+ * Brings node manager out of manual chill mode.
+ */
+ @Override
+ public void exitChillMode() {
+ LOG.info("Leaving manual chill mode.");
+ inManualChillMode.set(false);
+ }
+
+ /**
+ * Returns true if node manager is out of chill mode, else false.
+ * @return true if out of chill mode, else false
+ */
+ @Override
+ public boolean isOutOfChillMode() {
+ return !(inStartupChillMode.get() || inManualChillMode.get());
}
/**
http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7281023/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java
index 1d8e730..628d0eb 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java
@@ -291,7 +291,7 @@ public final class MiniOzoneCluster extends MiniDFSCluster
public void waitTobeOutOfChillMode() throws TimeoutException,
InterruptedException {
GenericTestUtils.waitFor(() -> {
- if (scm.getScmNodeManager().isOutOfNodeChillMode()) {
+ if (scm.getScmNodeManager().isOutOfChillMode()) {
return true;
}
LOG.info("Waiting for cluster to be ready. No datanodes found");
http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7281023/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/TestUtils/ReplicationNodeManagerMock.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/TestUtils/ReplicationNodeManagerMock.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/TestUtils/ReplicationNodeManagerMock.java
index 8d3da99..93cbffa 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/TestUtils/ReplicationNodeManagerMock.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/TestUtils/ReplicationNodeManagerMock.java
@@ -60,16 +60,6 @@ public class ReplicationNodeManagerMock implements NodeManager {
}
/**
- * Reports if we have exited out of chill mode by discovering enough nodes.
- *
- * @return True if we are out of Node layer chill mode, false otherwise.
- */
- @Override
- public boolean isOutOfNodeChillMode() {
- return !nodeStateMap.isEmpty();
- }
-
- /**
* Returns a chill mode status string.
*
* @return String
@@ -80,17 +70,6 @@ public class ReplicationNodeManagerMock implements NodeManager {
}
/**
- * Returns the status of manual chill mode flag.
- *
- * @return true if forceEnterChillMode has been called, false if
- * forceExitChillMode or status is not set. eg. clearChillModeFlag.
- */
- @Override
- public boolean isInManualChillMode() {
- return false;
- }
-
- /**
* Get the number of data nodes that in all states.
*
* @return A state to number of nodes that in this state mapping
@@ -158,19 +137,28 @@ public class ReplicationNodeManagerMock implements NodeManager {
}
/**
- * Forcefully enters chill mode, even if all minimum node conditions are met.
+ * Puts the node manager into manual chill mode.
*/
@Override
- public void forceEnterChillMode() {
+ public void enterChillMode() {
}
/**
- * Clears the manual chill mode flag.
+ * Brings node manager out of manual chill mode.
*/
@Override
- public void clearChillModeFlag() {
+ public void exitChillMode() {
+
+ }
+ /**
+ * Returns true if node manager is out of chill mode, else false.
+ * @return true if out of chill mode, else false
+ */
+ @Override
+ public boolean isOutOfChillMode() {
+ return !nodeStateMap.isEmpty();
}
/**
http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7281023/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestSCMMXBean.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestSCMMXBean.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestSCMMXBean.java
index 8cb6416..db0a459 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestSCMMXBean.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestSCMMXBean.java
@@ -108,17 +108,13 @@ public class TestSCMMXBean {
minChillNodes.intValue());
boolean isOutOfChillMode = (boolean)mbs.getAttribute(bean,
- "OutOfNodeChillMode");
- assertEquals(scmNm.isOutOfNodeChillMode(), isOutOfChillMode);
+ "OutOfChillMode");
+ assertEquals(scmNm.isOutOfChillMode(), isOutOfChillMode);
String chillStatus = (String)mbs.getAttribute(bean,
"ChillModeStatus");
assertEquals(scmNm.getChillModeStatus(), chillStatus);
- boolean inManualChillMode = (boolean)mbs.getAttribute(bean,
- "InManualChillMode");
- assertEquals(scmNm.isInManualChillMode(), inManualChillMode);
-
TabularData nodeCountObj = (TabularData)mbs.getAttribute(bean,
"NodeCount");
verifyEquals(nodeCountObj, scm.getScmNodeManager().getNodeCount());
http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7281023/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/container/MockNodeManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/container/MockNodeManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/container/MockNodeManager.java
index e1d20a4..cb532fc 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/container/MockNodeManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/container/MockNodeManager.java
@@ -189,16 +189,6 @@ public class MockNodeManager implements NodeManager {
}
/**
- * Reports if we have exited out of chill mode by discovering enough nodes.
- *
- * @return True if we are out of Node layer chill mode, false otherwise.
- */
- @Override
- public boolean isOutOfNodeChillMode() {
- return !chillmode;
- }
-
- /**
* Chill mode is the period when node manager waits for a minimum configured
* number of datanodes to report in. This is called chill mode to indicate the
* period before node manager gets into action.
@@ -212,40 +202,38 @@ public class MockNodeManager implements NodeManager {
}
/**
- * Forcefully enters chill mode, even if all minimum node conditions are met.
+ * Puts the node manager into manual chill mode.
*/
@Override
- public void forceEnterChillMode() {
+ public void enterChillMode() {
}
/**
- * Clears the manual chill mode flag.
+ * Brings node manager out of manual chill mode.
*/
@Override
- public void clearChillModeFlag() {
+ public void exitChillMode() {
}
/**
- * Returns a chill mode status string.
- *
- * @return String
+ * Returns true if node manager is out of chill mode, else false.
+ * @return true if out of chill mode, else false
*/
@Override
- public String getChillModeStatus() {
- return null;
+ public boolean isOutOfChillMode() {
+ return !chillmode;
}
/**
- * Returns the status of manual chill mode flag.
+ * Returns a chill mode status string.
*
- * @return true if forceEnterChillMode has been called, false if
- * forceExitChillMode or status is not set. eg. clearChillModeFlag.
+ * @return String
*/
@Override
- public boolean isInManualChillMode() {
- return false;
+ public String getChillModeStatus() {
+ return null;
}
/**
http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7281023/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestContainerPlacement.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestContainerPlacement.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestContainerPlacement.java
index eb7087b..e0b2b5b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestContainerPlacement.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestContainerPlacement.java
@@ -86,7 +86,7 @@ public class TestContainerPlacement {
SCMNodeManager nodeManager = new SCMNodeManager(config,
UUID.randomUUID().toString());
assertFalse("Node manager should be in chill mode",
- nodeManager.isOutOfNodeChillMode());
+ nodeManager.isOutOfChillMode());
return nodeManager;
}
@@ -150,7 +150,7 @@ public class TestContainerPlacement {
assertEquals(remaining * nodeCount,
(long) nodeManager.getStats().getRemaining().get());
- assertTrue(nodeManager.isOutOfNodeChillMode());
+ assertTrue(nodeManager.isOutOfChillMode());
String container1 = UUID.randomUUID().toString();
Pipeline pipeline1 = containerManager.allocateContainer(
http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7281023/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestNodeManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestNodeManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestNodeManager.java
index 8814a0a..18279f0 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestNodeManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/node/TestNodeManager.java
@@ -121,7 +121,7 @@ public class TestNodeManager {
SCMNodeManager nodeManager = new SCMNodeManager(config,
UUID.randomUUID().toString());
assertFalse("Node manager should be in chill mode",
- nodeManager.isOutOfNodeChillMode());
+ nodeManager.isOutOfChillMode());
return nodeManager;
}
@@ -150,7 +150,7 @@ public class TestNodeManager {
assertTrue("Heartbeat thread should have picked up the" +
"scheduled heartbeats and transitioned out of chill mode.",
- nodeManager.isOutOfNodeChillMode());
+ nodeManager.isOutOfChillMode());
}
}
@@ -169,7 +169,7 @@ public class TestNodeManager {
GenericTestUtils.waitFor(() -> nodeManager.waitForHeartbeatProcessed(),
100, 4 * 1000);
assertFalse("No heartbeats, Node manager should have been in" +
- " chill mode.", nodeManager.isOutOfNodeChillMode());
+ " chill mode.", nodeManager.isOutOfChillMode());
}
}
@@ -191,7 +191,7 @@ public class TestNodeManager {
GenericTestUtils.waitFor(() -> nodeManager.waitForHeartbeatProcessed(),
100, 4 * 1000);
assertFalse("Not enough heartbeat, Node manager should have" +
- "been in chillmode.", nodeManager.isOutOfNodeChillMode());
+ "been in chillmode.", nodeManager.isOutOfChillMode());
}
}
@@ -219,7 +219,7 @@ public class TestNodeManager {
GenericTestUtils.waitFor(() -> nodeManager.waitForHeartbeatProcessed(),
100, 4 * 1000);
assertFalse("Not enough nodes have send heartbeat to node" +
- "manager.", nodeManager.isOutOfNodeChillMode());
+ "manager.", nodeManager.isOutOfChillMode());
}
}
@@ -899,27 +899,23 @@ public class TestNodeManager {
"mode, waiting on nodes to report in."));
// Should not exit chill mode since 10 nodes have not heartbeat yet.
- assertFalse(nodeManager.isOutOfNodeChillMode());
- assertFalse((nodeManager.isInManualChillMode()));
+ assertFalse(nodeManager.isOutOfChillMode());
// Force exit chill mode.
nodeManager.forceExitChillMode();
- assertTrue(nodeManager.isOutOfNodeChillMode());
+ assertTrue(nodeManager.isOutOfChillMode());
status = nodeManager.getChillModeStatus();
Assert.assertThat(status,
CoreMatchers.containsString("Out of chill mode."));
- assertFalse((nodeManager.isInManualChillMode()));
// Enter back to into chill mode.
- nodeManager.forceEnterChillMode();
- assertFalse(nodeManager.isOutOfNodeChillMode());
+ nodeManager.enterChillMode();
+ assertFalse(nodeManager.isOutOfChillMode());
status = nodeManager.getChillModeStatus();
Assert.assertThat(status,
CoreMatchers.containsString("Out of startup chill mode," +
" but in manual chill mode."));
- assertTrue((nodeManager.isInManualChillMode()));
-
// Assert that node manager force enter cannot be overridden by nodes HBs.
for (int x = 0; x < 20; x++) {
@@ -928,16 +924,15 @@ public class TestNodeManager {
}
Thread.sleep(500);
- assertFalse(nodeManager.isOutOfNodeChillMode());
+ assertFalse(nodeManager.isOutOfChillMode());
- // Make sure that once we clear the manual chill mode flag, we fall back
+ // Make sure that once we exit out of manual chill mode, we fall back
// to the number of nodes to get out chill mode.
- nodeManager.clearChillModeFlag();
- assertTrue(nodeManager.isOutOfNodeChillMode());
+ nodeManager.exitChillMode();
+ assertTrue(nodeManager.isOutOfChillMode());
status = nodeManager.getChillModeStatus();
Assert.assertThat(status,
CoreMatchers.containsString("Out of chill mode."));
- assertFalse(nodeManager.isInManualChillMode());
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org