Search in sources :

Example 11 with NodeHeartbeatRequest

use of org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest in project hadoop by apache.

the class TestResourceTrackerPBClientImpl method testNodeHeartbeat.

/**
   * Test the method nodeHeartbeat. Method should return a not null result.
   * 
   */
@Test
public void testNodeHeartbeat() throws Exception {
    NodeHeartbeatRequest request = recordFactory.newRecordInstance(NodeHeartbeatRequest.class);
    assertNotNull(client.nodeHeartbeat(request));
    ResourceTrackerTestImpl.exception = true;
    try {
        client.nodeHeartbeat(request);
        fail("there  should be YarnException");
    } catch (YarnException e) {
        assertTrue(e.getMessage().startsWith("testMessage"));
    } finally {
        ResourceTrackerTestImpl.exception = false;
    }
}
Also used : NodeHeartbeatRequest(org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest) YarnException(org.apache.hadoop.yarn.exceptions.YarnException) Test(org.junit.Test)

Example 12 with NodeHeartbeatRequest

use of org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest in project hadoop by apache.

the class TestYSCRecordFactory method testPbRecordFactory.

@Test
public void testPbRecordFactory() {
    RecordFactory pbRecordFactory = RecordFactoryPBImpl.get();
    try {
        NodeHeartbeatRequest request = pbRecordFactory.newRecordInstance(NodeHeartbeatRequest.class);
        Assert.assertEquals(NodeHeartbeatRequestPBImpl.class, request.getClass());
    } catch (YarnRuntimeException e) {
        e.printStackTrace();
        Assert.fail("Failed to crete record");
    }
}
Also used : YarnRuntimeException(org.apache.hadoop.yarn.exceptions.YarnRuntimeException) RecordFactory(org.apache.hadoop.yarn.factories.RecordFactory) NodeHeartbeatRequest(org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest) Test(org.junit.Test)

Aggregations

NodeHeartbeatRequest (org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest)12 Test (org.junit.Test)9 NodeHeartbeatResponse (org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatResponse)7 Resource (org.apache.hadoop.yarn.api.records.Resource)6 RegisterNodeManagerRequest (org.apache.hadoop.yarn.server.api.protocolrecords.RegisterNodeManagerRequest)6 NodeStatus (org.apache.hadoop.yarn.server.api.records.NodeStatus)5 NodeId (org.apache.hadoop.yarn.api.records.NodeId)4 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)4 Configuration (org.apache.hadoop.conf.Configuration)3 RegisterNodeManagerResponse (org.apache.hadoop.yarn.server.api.protocolrecords.RegisterNodeManagerResponse)3 UnRegisterNodeManagerRequest (org.apache.hadoop.yarn.server.api.protocolrecords.UnRegisterNodeManagerRequest)3 NullRMNodeLabelsManager (org.apache.hadoop.yarn.server.resourcemanager.nodelabels.NullRMNodeLabelsManager)3 RMNodeLabelsManager (org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager)3 IOException (java.io.IOException)2 ContainerId (org.apache.hadoop.yarn.api.records.ContainerId)2 ContainerStatus (org.apache.hadoop.yarn.api.records.ContainerStatus)2 NMContainerStatus (org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus)2 NodeHealthStatus (org.apache.hadoop.yarn.server.api.records.NodeHealthStatus)2 ArrayList (java.util.ArrayList)1 BrokenBarrierException (java.util.concurrent.BrokenBarrierException)1