List of usage examples for org.apache.hadoop.yarn.api.records ContainerLaunchContext setTokens
@Public @Stable public abstract void setTokens(ByteBuffer tokens);
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; }