Example usage for org.apache.hadoop.yarn.api.protocolrecords StopContainersRequest getContainerIds

List of usage examples for org.apache.hadoop.yarn.api.protocolrecords StopContainersRequest getContainerIds

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.api.protocolrecords StopContainersRequest getContainerIds.

Prototype

@Public
@Stable
public abstract List<ContainerId> getContainerIds();

Source Link

Document

Get the ContainerIds of the containers to be stopped.

Usage

From source file:org.apache.hama.bsp.BSPTaskLauncher.java

License:Apache License

public void stopAndCleanup() throws YarnException, IOException {
    StopContainersRequest stopRequest = Records.newRecord(StopContainersRequest.class);
    List<ContainerId> containerIds = new ArrayList<ContainerId>();
    containerIds.add(allocatedContainer.getId());
    LOG.info("getId : " + allocatedContainer.getId());
    stopRequest.setContainerIds(containerIds);
    LOG.info("StopContainer : " + stopRequest.getContainerIds());
    cm.stopContainers(stopRequest);/*from   ww  w  .  j  a va2  s. c o  m*/

}