hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestNodeManager.java
@Test
  public void testScmNotEnoughHeartbeats() throws IOException,
      InterruptedException, TimeoutException {
    try (SCMNodeManager nodeManager = createNodeManager(getConf())) {

      // Need 100 nodes to come out of chill mode, only one node is sending HB.
      nodeManager.setMinimumChillModeNodes(100);
      nodeManager.sendHeartbeat(TestUtils.getDatanodeDetails(nodeManager)
          .getProtoBufMessage(),
          null, reportState);
      GenericTestUtils.waitFor(() -> nodeManager.waitForHeartbeatProcessed(),
          100, 4 * 1000);
      assertFalse("Not enough heartbeat, Node manager should have" +
          "been in chillmode.", nodeManager.isOutOfChillMode());
    }
  }
/**
   * Asserts that if we don't get enough unique nodes we stay in chillmode.
   *
   * @throws IOException
   * @throws InterruptedException
   * @throws TimeoutException
   */
Asserts that if we don't get enough unique nodes we stay in chillmode.
Asserts that if we don ' t get enough unique nodes we stay in chillmode .
@Test
  public void testScmNotEnoughHeartbeats() throws IOException,
      InterruptedException, TimeoutException {
    try (SCMNodeManager nodeManager = createNodeManager(getConf())) {
      nodeManager.setMinimumChillModeNodes(100);
      nodeManager.sendHeartbeat(TestUtils.getDatanodeDetails(nodeManager)
          .getProtoBufMessage(),
          null, reportState);
      GenericTestUtils.waitFor(() -> nodeManager.waitForHeartbeatProcessed(),
          100, 4 * 1000);
      assertFalse("Not enough heartbeat, Node manager should have" +
          "been in chillmode.", nodeManager.isOutOfChillMode());
    }
  }
@ Test public void testScmNotEnoughHeartbeats ( ) throws IOException , InterruptedException , TimeoutException { try ( SCMNodeManager nodeManager = createNodeManager ( getConf ( ) ) ) { nodeManager . setMinimumChillModeNodes ( 100 ) ; nodeManager . sendHeartbeat ( TestUtils . getDatanodeDetails ( nodeManager ) . getProtoBufMessage ( ) , null , reportState ) ; GenericTestUtils . waitFor ( ( ) -> nodeManager . waitForHeartbeatProcessed ( ) , 100 , 4 * 1000 ) ; assertFalse ( "Not enough heartbeat, Node manager should have" + "been in chillmode." , nodeManager . isOutOfChillMode ( ) ) ; } }
Asserts that if we don't get enough unique nodes we stay in chillmode.
Asserts that if we don ' t get enough unique nodes we stay in chillmode .
// Need 100 nodes to come out of chill mode, only one node is sending HB.