- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getRMDelegationToken()
方法的一些代码示例,展示了YarnClient.getRMDelegationToken()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnClient.getRMDelegationToken()
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.client.api.YarnClient
类名称:YarnClient
方法名:getRMDelegationToken
[英]Get a delegation token so as to be able to talk to YARN using those tokens.
[中]获取一个委派令牌,以便能够使用这些令牌与纱线对话。
代码示例来源:origin: com.github.jiayuhan-it/hadoop-mapreduce-client-jobclient
@Override
public org.apache.hadoop.yarn.api.records.Token getRMDelegationToken(
Text renewer) throws YarnException, IOException {
return client.getRMDelegationToken(renewer);
}
代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-jobclient
@Override
public org.apache.hadoop.yarn.api.records.Token getRMDelegationToken(
Text renewer) throws YarnException, IOException {
return client.getRMDelegationToken(renewer);
}
代码示例来源:origin: org.apache.tez/tez-mapreduce
@SuppressWarnings("rawtypes")
public Token getDelegationToken(Text renewer) throws IOException,
InterruptedException {
try {
// Remove rmAddress after YARN-868 is addressed
return ConverterUtils.convertFromYarn(
client.getRMDelegationToken(renewer), rmAddress);
} catch (YarnException e) {
throw new IOException(e);
}
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-mapreduce-client-jobclient
@SuppressWarnings("rawtypes")
public Token getDelegationToken(Text renewer) throws IOException,
InterruptedException {
try {
return ConverterUtils.convertFromYarn(
client.getRMDelegationToken(renewer), getRMDelegationTokenService());
} catch (YarnException e) {
throw new IOException(e);
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-jobclient
@SuppressWarnings("rawtypes")
public Token getDelegationToken(Text renewer) throws IOException,
InterruptedException {
try {
return ConverterUtils.convertFromYarn(
client.getRMDelegationToken(renewer), getRMDelegationTokenService());
} catch (YarnException e) {
throw new IOException(e);
}
}
代码示例来源:origin: org.apache.apex/apex-engine
public void addRMDelegationToken(final String renewer, final Credentials credentials) throws IOException, YarnException
{
// Get the ResourceManager delegation rmToken
final org.apache.hadoop.yarn.api.records.Token rmDelegationToken = clientRM.getRMDelegationToken(new Text(renewer));
Token<RMDelegationTokenIdentifier> token;
// TODO: Use the utility method getRMDelegationTokenService in ClientRMProxy to remove the separate handling of
// TODO: HA and non-HA cases when hadoop dependency is changed to hadoop 2.4 or above
if (ConfigUtils.isRMHAEnabled(conf)) {
LOG.info("Yarn Resource Manager HA is enabled");
token = getRMHAToken(rmDelegationToken);
} else {
LOG.info("Yarn Resource Manager HA is not enabled");
InetSocketAddress rmAddress = conf.getSocketAddr(YarnConfiguration.RM_ADDRESS,
YarnConfiguration.DEFAULT_RM_ADDRESS,
YarnConfiguration.DEFAULT_RM_PORT);
token = ConverterUtils.convertFromYarn(rmDelegationToken, rmAddress);
}
LOG.info("RM dt {}", token);
credentials.addToken(token.getService(), token);
}
代码示例来源:origin: linkedin/TonY
throw new RuntimeException("Failed to get RM principal.");
final Token<?> rmToken = ConverterUtils.convertFromYarn(yarnClient.getRMDelegationToken(new Text(tokenRenewer)),
yarnConf.getSocketAddr(YarnConfiguration.RM_ADDRESS,
YarnConfiguration.DEFAULT_RM_ADDRESS,
代码示例来源:origin: caskdata/cdap
org.apache.hadoop.yarn.api.records.Token rmDelegationToken = yarnClient.getRMDelegationToken(renewer);
代码示例来源:origin: org.apache.twill/twill-yarn
org.apache.hadoop.yarn.api.records.Token rmDelegationToken = yarnClient.getRMDelegationToken(renewer);
代码示例来源:origin: co.cask.cdap/cdap-common
org.apache.hadoop.yarn.api.records.Token rmDelegationToken = yarnClient.getRMDelegationToken(renewer);
代码示例来源:origin: org.apache.slider/slider-core
/**
* Create and add an RM delegation token to the credentials
* @param yarnClient Yarn Client
* @param credentials to add token to
* @return the token which was added
* @throws IOException
* @throws YarnException
*/
public static Token<TokenIdentifier> addRMDelegationToken(YarnClient yarnClient,
Credentials credentials)
throws IOException, YarnException {
Configuration conf = yarnClient.getConfig();
Text rmPrincipal = new Text(CredentialUtils.getRMPrincipal(conf));
Text rmDTService = ClientRMProxy.getRMDelegationTokenService(conf);
Token<TokenIdentifier> rmDelegationToken =
ConverterUtils.convertFromYarn(
yarnClient.getRMDelegationToken(rmPrincipal),
rmDTService);
credentials.addToken(rmDelegationToken.getService(), rmDelegationToken);
return rmDelegationToken;
}
代码示例来源:origin: apache/twill
org.apache.hadoop.yarn.api.records.Token rmDelegationToken = yarnClient.getRMDelegationToken(renewer);
代码示例来源:origin: apache/incubator-slider
/**
* Create and add an RM delegation token to the credentials
* @param yarnClient Yarn Client
* @param credentials to add token to
* @return the token which was added
* @throws IOException
* @throws YarnException
*/
public static Token<TokenIdentifier> addRMDelegationToken(YarnClient yarnClient,
Credentials credentials)
throws IOException, YarnException {
Configuration conf = yarnClient.getConfig();
Text rmPrincipal = new Text(CredentialUtils.getRMPrincipal(conf));
Text rmDTService = ClientRMProxy.getRMDelegationTokenService(conf);
Token<TokenIdentifier> rmDelegationToken =
ConverterUtils.convertFromYarn(
yarnClient.getRMDelegationToken(rmPrincipal),
rmDTService);
credentials.addToken(rmDelegationToken.getService(), rmDelegationToken);
return rmDelegationToken;
}
代码示例来源:origin: org.apache.twill/twill-yarn
/**
* Adds RM delegation token to the given {@link ContainerLaunchContext} so that the AM can authenticate itself
* with RM using the delegation token.
*/
protected void addRMToken(ContainerLaunchContext context, YarnClient yarnClient, ApplicationId appId) {
if (!UserGroupInformation.isSecurityEnabled()) {
return;
}
try {
Credentials credentials = YarnUtils.decodeCredentials(context.getTokens());
Configuration config = yarnClient.getConfig();
Token<TokenIdentifier> token = ConverterUtils.convertFromYarn(
yarnClient.getRMDelegationToken(new Text(YarnUtils.getYarnTokenRenewer(config))),
YarnUtils.getRMAddress(config));
LOG.debug("Added RM delegation token {} for application {}", token, appId);
credentials.addToken(token.getService(), token);
context.setTokens(YarnUtils.encodeCredentials(credentials));
} catch (YarnException | IOException e) {
throw new RuntimeException("Failed to acquire RM delegation token", e);
}
}
代码示例来源:origin: apache/twill
/**
* Adds RM delegation token to the given {@link ContainerLaunchContext} so that the AM can authenticate itself
* with RM using the delegation token.
*/
protected void addRMToken(ContainerLaunchContext context, YarnClient yarnClient, ApplicationId appId) {
if (!UserGroupInformation.isSecurityEnabled()) {
return;
}
try {
Credentials credentials = YarnUtils.decodeCredentials(context.getTokens());
Configuration config = yarnClient.getConfig();
Token<TokenIdentifier> token = ConverterUtils.convertFromYarn(
yarnClient.getRMDelegationToken(new Text(YarnUtils.getYarnTokenRenewer(config))),
YarnUtils.getRMAddress(config));
LOG.debug("Added RM delegation token {} for application {}", token, appId);
credentials.addToken(token.getService(), token);
context.setTokens(YarnUtils.encodeCredentials(credentials));
} catch (YarnException | IOException e) {
throw new RuntimeException("Failed to acquire RM delegation token", e);
}
}
代码示例来源:origin: apache/oozie
/**
* Add an RM_DELEGATION_TOKEN to the {@link Credentials} provided.
*
* @param credentials the credentials object which is updated
* @param config launcher AM configuration
* @param props properties for getting credential token or certificate
* @param context workflow context
* @throws Exception thrown if failed
*/
@Override
public void updateCredentials(Credentials credentials, Configuration config, CredentialsProperties props,
ActionExecutor.Context context) throws Exception {
Text rmDelegationTokenService = ClientRMProxy.getRMDelegationTokenService(config);
if (rmDelegationTokenService == null) {
throw new CredentialException(ErrorCode.E0512, "Can't create RMDelegationTokenService");
}
try (YarnClient yarnClient = Services.get().get(HadoopAccessorService.class)
.createYarnClient(context.getWorkflow().getUser(), config)) {
org.apache.hadoop.yarn.api.records.Token rmDelegationToken =
yarnClient.getRMDelegationToken(new Text(new HadoopTokenHelper().getServerPrincipal(config)));
if (rmDelegationToken == null) {
throw new CredentialException(ErrorCode.E0512, "Returned token is null");
}
Token<TokenIdentifier> rmToken = ConverterUtils.convertFromYarn(rmDelegationToken, rmDelegationTokenService);
credentials.addToken(rmDelegationTokenService, rmToken);
} catch (Exception e) {
XLog.getLog(getClass()).debug("Exception in updateCredentials", e);
throw e;
}
}
代码示例来源:origin: org.apache.oozie/oozie-core
/**
* Add an RM_DELEGATION_TOKEN to the {@link Credentials} provided.
*
* @param credentials the credentials object which is updated
* @param config launcher AM configuration
* @param props properties for getting credential token or certificate
* @param context workflow context
* @throws Exception thrown if failed
*/
@Override
public void updateCredentials(Credentials credentials, Configuration config, CredentialsProperties props,
ActionExecutor.Context context) throws Exception {
Text rmDelegationTokenService = ClientRMProxy.getRMDelegationTokenService(config);
if (rmDelegationTokenService == null) {
throw new CredentialException(ErrorCode.E0512, "Can't create RMDelegationTokenService");
}
try (YarnClient yarnClient = Services.get().get(HadoopAccessorService.class)
.createYarnClient(context.getWorkflow().getUser(), config)) {
org.apache.hadoop.yarn.api.records.Token rmDelegationToken =
yarnClient.getRMDelegationToken(new Text(new HadoopTokenHelper().getServerPrincipal(config)));
if (rmDelegationToken == null) {
throw new CredentialException(ErrorCode.E0512, "Returned token is null");
}
Token<TokenIdentifier> rmToken = ConverterUtils.convertFromYarn(rmDelegationToken, rmDelegationTokenService);
credentials.addToken(rmDelegationTokenService, rmToken);
} catch (Exception e) {
XLog.getLog(getClass()).debug("Exception in updateCredentials", e);
throw e;
}
}
本文整理了Java中org.springframework.yarn.client.YarnClient.listApplications()方法的一些代码示例,展示了YarnClient.listA
本文整理了Java中org.springframework.yarn.client.YarnClient.getApplicationReport()方法的一些代码示例,展示了YarnClient.g
本文整理了Java中org.springframework.yarn.client.YarnClient.killApplication()方法的一些代码示例,展示了YarnClient.killAp
本文整理了Java中org.springframework.yarn.client.YarnClient.submitApplication()方法的一些代码示例,展示了YarnClient.subm
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getNodeToLabels()方法的一些代码示例,展示了YarnClient.getN
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.deleteReservation()方法的一些代码示例,展示了YarnClient.de
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.updateReservation()方法的一些代码示例,展示了YarnClient.up
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getClusterAttributes()方法的一些代码示例,展示了YarnClient
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.signalToContainer()方法的一些代码示例,展示了YarnClient.si
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getResourceProfiles()方法的一些代码示例,展示了YarnClient.
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getLabelsToNodes()方法的一些代码示例,展示了YarnClient.get
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getResourceTypeInfo()方法的一些代码示例,展示了YarnClient.
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.updateApplicationPriority()方法的一些代码示例,展示了YarnC
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getConfig()方法的一些代码示例,展示了YarnClient.getConfig(
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.serviceStop()方法的一些代码示例,展示了YarnClient.serviceS
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getContainerReport()方法的一些代码示例,展示了YarnClient.g
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getQueueAclsInfo()方法的一些代码示例,展示了YarnClient.get
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getApplicationAttempts()方法的一些代码示例,展示了YarnClie
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.serviceStart()方法的一些代码示例,展示了YarnClient.service
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getAllQueues()方法的一些代码示例,展示了YarnClient.getAllQ
我是一名优秀的程序员,十分优秀!