gpt4 book ai didi

org.apache.hadoop.yarn.client.api.YarnClient.getConfig()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 18:46:40 26 4
gpt4 key购买 nike

本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getConfig()方法的一些代码示例,展示了YarnClient.getConfig()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnClient.getConfig()方法的具体详情如下:
包路径:org.apache.hadoop.yarn.client.api.YarnClient
类名称:YarnClient
方法名:getConfig

YarnClient.getConfig介绍

暂无

代码示例

代码示例来源:origin: apache/flink

@Override
  public AbstractYarnClusterDescriptor createClusterDescriptor(CommandLine commandLine)
    throws FlinkException {
    AbstractYarnClusterDescriptor parent = super.createClusterDescriptor(commandLine);
    return new NonDeployingDetachedYarnClusterDescriptor(
        parent.getFlinkConfiguration(),
        (YarnConfiguration) parent.getYarnClient().getConfig(),
        configurationDirectory,
        parent.getYarnClient(),
        clusterClient);
  }
}

代码示例来源: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.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: 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: hopshadoop/hopsworks

this.clusterDescriptor = clusterDescriptor;
this.yarnClient = yarnClient;
this.hadoopConfig = yarnClient.getConfig();
this.sessionFilesDir = sessionFilesDir;
this.appReport = appReport;

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com