Example usage for org.apache.hadoop.yarn.api.records ContainerLaunchContext setTokens

List of usage examples for org.apache.hadoop.yarn.api.records ContainerLaunchContext setTokens

Introduction

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

Prototype

@Public
@Stable
public abstract void setTokens(ByteBuffer tokens);

Source Link

Document

Set security tokens needed by this container.

Usage

From source file:yarnkit.container.ContainerLaunchContextFactory.java

License:Apache License

public ContainerLaunchContext duplicate(@CheckForNull ContainerLaunchContext original) {
    Preconditions.checkNotNull(original, "ContainerLaunchContext should not be null");

    ContainerLaunchContext copy = Records.newRecord(ContainerLaunchContext.class);
    copy.setCommands(original.getCommands());
    copy.setEnvironment(original.getEnvironment());
    copy.setLocalResources(original.getLocalResources());
    ByteBuffer token = original.getTokens();
    if (token != null) {
        copy.setTokens(token.duplicate());
    }/*from w w w .  j av a 2 s  .  co  m*/
    return copy;
}