Example usage for org.apache.hadoop.yarn.api.records Container getResource

List of usage examples for org.apache.hadoop.yarn.api.records Container getResource

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.api.records Container getResource.

Prototype

@Public
@Stable
public abstract Resource getResource();

Source Link

Document

Get the Resource allocated to the container.

Usage

From source file:org.springframework.yarn.boot.MockUtils.java

License:Apache License

public static Container getMockContainer(ContainerId containerId, NodeId nodeId, Resource resource,
        Priority priority) {//from   w w  w .j a  v a2 s. c om
    Container container = mock(Container.class);
    when(container.getId()).thenReturn(containerId);
    when(container.getNodeId()).thenReturn(nodeId);
    when(container.getResource()).thenReturn(resource);
    when(container.getPriority()).thenReturn(priority);
    return container;
}