Package org.apache.hadoop.yarn.api.protocolrecords

Examples of org.apache.hadoop.yarn.api.protocolrecords.StopContainerRequest


    }
    Assert.assertTrue("ProcessStartFile doesn't exist!",
        processStartFile.exists());

    // Now test the stop functionality.
    StopContainerRequest stopRequest = recordFactory.newRecordInstance(StopContainerRequest.class);
    stopRequest.setContainerId(cId);
    containerManager.stopContainer(stopRequest);

    BaseContainerManagerTest.waitForContainerState(containerManager, cId,
        ContainerState.COMPLETE);
View Full Code Here


        try {
          proxy = getCMProxy(this.containerID, this.containerMgrAddress,
              this.containerToken);

            // kill the remote container if already launched
            StopContainerRequest stopRequest = Records
              .newRecord(StopContainerRequest.class);
            stopRequest.setContainerId(this.containerID);
            proxy.stopContainer(stopRequest);

        } catch (Throwable t) {

          // ignore the cleanup failure
View Full Code Here

    }

    @Override
    public void cancel() {
      LOG.info("Request to stop container {}.", container.getId());
      StopContainerRequest stopRequest = Records.newRecord(StopContainerRequest.class);
      stopRequest.setContainerId(container.getId());
      try {
        manager.stopContainer(stopRequest);
        boolean completed = false;
        while (!completed) {
          GetContainerStatusRequest statusRequest = Records.newRecord(GetContainerStatusRequest.class);
View Full Code Here

            } else {

              // TODO:check whether container is launched

              // kill the remote container if already launched
              StopContainerRequest stopRequest = recordFactory
                  .newRecordInstance(StopContainerRequest.class);
              stopRequest.setContainerId(event.getContainerID());
              proxy.stopContainer(stopRequest);
            }
          } catch (Throwable t) {
            // ignore the cleanup failure
            String message = "cleanup failed for container "
View Full Code Here

        ContainerManager client = (ContainerManager) yarnRPC.getProxy(
            ContainerManager.class, NetUtils
                .createSocketAddr(allocatedContainer.getNodeId().toString()),
            conf);
        LOG.info("Going to make a legal stopContainer() request");
        StopContainerRequest request = recordFactory
            .newRecordInstance(StopContainerRequest.class);
        request.setContainerId(containerID);
        client.stopContainer(request);
        return null;
      }
    });

    KillApplicationRequest request = Records
        .newRecord(KillApplicationRequest.class);
    request.setApplicationId(appID);
    resourceManager.getClientRMService().forceKillApplication(request);
  }
View Full Code Here

        try {
          proxy = getCMProxy(this.containerID, this.containerMgrAddress,
              this.containerToken);

            // kill the remote container if already launched
            StopContainerRequest stopRequest = Records
              .newRecord(StopContainerRequest.class);
            stopRequest.setContainerId(this.containerID);
            proxy.stopContainer(stopRequest);

        } catch (Throwable t) {

          // ignore the cleanup failure
View Full Code Here

    ContainerStatus status = response.getStatus();
   
    //test remote exception
    boolean exception = false;
    try {
      StopContainerRequest stopRequest = recordFactory.newRecordInstance(StopContainerRequest.class);
      stopRequest.setContainerId(containerLaunchContext.getContainerId());
      proxy.stopContainer(stopRequest);
    } catch (YarnRemoteException e) {
      exception = true;
      System.err.println(e.getMessage());
      System.err.println(e.getCause().getMessage());
View Full Code Here

    containerManager.startContainer(request);

    BaseContainerManagerTest.waitForContainerState(containerManager, cID,
        ContainerState.RUNNING);

    StopContainerRequest stopRequest =
        recordFactory.newRecordInstance(StopContainerRequest.class);
    stopRequest.setContainerId(cID);
    containerManager.stopContainer(stopRequest);
    BaseContainerManagerTest.waitForContainerState(containerManager, cID,
        ContainerState.COMPLETE);

    containerManager.stop();
View Full Code Here

    // Once more
    Assert.assertTrue("Process is not alive!",
        exec.signalContainer(user,
            pid, Signal.NULL));

    StopContainerRequest stopRequest = recordFactory.newRecordInstance(StopContainerRequest.class);
    stopRequest.setContainerId(cId);
    containerManager.stopContainer(stopRequest);

    BaseContainerManagerTest.waitForContainerState(containerManager, cId,
        ContainerState.COMPLETE);
   
View Full Code Here

  }
 
  private void cleanup() throws IOException {
    connect();
    ContainerId containerId = application.getMasterContainer().getId();
    StopContainerRequest stopRequest =
        recordFactory.newRecordInstance(StopContainerRequest.class);
    stopRequest.setContainerId(containerId);
    containerMgrProxy.stopContainer(stopRequest);
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.api.protocolrecords.StopContainerRequest

Copyright © 2018 www.massapicom. 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.