Examples of HeartbeatResponsePBImpl


Examples of org.apache.hadoop.yarn.server.api.records.impl.pb.HeartbeatResponsePBImpl

   * data from prototype
   */

  @Test(timeout = 500)
  public void testHeartbeatResponsePBImpl() {
    HeartbeatResponsePBImpl original = new HeartbeatResponsePBImpl();
    original.setMasterKey(getMasterKey());
    original.setNodeAction(NodeAction.NORMAL);
    original.setResponseId(30);
    original.addApplicationToCleanup(getApplicationId(1));
    original.addApplicationToCleanup(getApplicationId(2));
    original.addAllContainersToCleanup(Arrays.asList(getContainerId(0, 0),
        getContainerId(1, 1), getContainerId(2, 2)));
    original.addContainerToCleanup( getContainerId(3, 3));
   
    assertEquals(2, original.getApplicationsToCleanupCount());
    assertEquals(2, original.getContainerToCleanup(2).getId());

    HeartbeatResponsePBImpl middle = new HeartbeatResponsePBImpl(
        original.getProto());
    HeartbeatResponsePBImpl copy = new HeartbeatResponsePBImpl(
        middle.getProto());

    assertEquals(30, copy.getResponseId());
    assertEquals(NodeAction.NORMAL, copy.getNodeAction());
    assertEquals(1, copy.getMasterKey().getKeyId());
    assertEquals(2, copy.getApplicationsToCleanupCount());
    assertEquals(2, copy.getApplicationsToCleanup(1).getId());
    copy.removeApplicationToCleanup(1);
    assertEquals(1, copy.getApplicationsToCleanupList().size());
    copy.clearApplicationsToCleanup();
    assertEquals(0, copy.getApplicationsToCleanupCount());

    assertEquals(1, copy.getContainerToCleanup(1).getId());
    assertEquals(4, copy.getContainersToCleanupCount());
    copy.removeContainerToCleanup(2);
    assertEquals(3, copy.getContainersToCleanupCount());
    copy.clearContainersToCleanup();
    assertEquals(0, copy.getContainersToCleanupCount());
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.api.records.impl.pb.HeartbeatResponsePBImpl

      builder.clearHeartbeatResponse();
    this.heartbeatResponse = heartbeatResponse;
  }

  private HeartbeatResponsePBImpl convertFromProtoFormat(HeartbeatResponseProto p) {
    return new HeartbeatResponsePBImpl(p);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.