gpt4 book ai didi

org.apache.twill.yarn.YarnSecureStore.create()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 09:55:31 27 4
gpt4 key购买 nike

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

YarnSecureStore.create介绍

暂无

代码示例

代码示例来源:origin: cdapio/cdap

@Override
public void renew(String application, RunId runId, SecureStoreWriter secureStoreWriter) throws IOException {
 Credentials credentials = createCredentials();
 UserGroupInformation currentUser = null;
 try {
  currentUser = UserGroupInformation.getCurrentUser();
 } catch (IOException e) {
  // this shouldn't happen
  LOG.debug("Cannot determine current user", e);
 }
 LOG.debug("Updating credentials for application {}, run {}, tokens {}, with current user {}",
      application, runId, credentials.getAllTokens(), currentUser);
 secureStoreWriter.write(YarnSecureStore.create(credentials));
}

代码示例来源:origin: co.cask.cdap/cdap-app-fabric

@Override
public void renew(String application, RunId runId, SecureStoreWriter secureStoreWriter) throws IOException {
 Credentials credentials = createCredentials();
 UserGroupInformation currentUser = null;
 try {
  currentUser = UserGroupInformation.getCurrentUser();
 } catch (IOException e) {
  // this shouldn't happen
  LOG.debug("Cannot determine current user", e);
 }
 LOG.debug("Updating credentials for application {}, run {}, tokens {}, with current user {}",
      application, runId, credentials.getAllTokens(), currentUser);
 secureStoreWriter.write(YarnSecureStore.create(credentials));
}

代码示例来源:origin: org.apache.twill/twill-yarn

@Override
 public void renew(String application, RunId runId, SecureStoreWriter secureStoreWriter) throws IOException {
  Credentials credentials = new Credentials();
  YarnUtils.addDelegationTokens(configuration, locationFactory, credentials);
  secureStoreWriter.write(YarnSecureStore.create(credentials));
 }
}

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

@Override
 public void renew(String application, RunId runId, SecureStoreWriter secureStoreWriter) throws IOException {
  Credentials credentials = new Credentials();
  YarnUtils.addDelegationTokens(configuration, locationFactory, credentials);
  secureStoreWriter.write(YarnSecureStore.create(credentials));
 }
}

代码示例来源:origin: cdapio/cdap

@Override
 public TwillController start(final long timeout, final TimeUnit timeoutUnit) {
  try {
   return impersonator.doAs(programId, () -> {
    // Add secure tokens
    if (User.isHBaseSecurityEnabled(hConf) || UserGroupInformation.isSecurityEnabled()) {
     addSecureStore(YarnSecureStore.create(secureStoreRenewer.createCredentials()));
    }
    return new ImpersonatedTwillController(delegate.start(timeout, timeoutUnit),
                        impersonator, programId);
   });
  } catch (Exception e) {
   throw Throwables.propagate(e);
  }
 }
}

代码示例来源:origin: co.cask.cdap/cdap-app-fabric

@Override
 public TwillController start(final long timeout, final TimeUnit timeoutUnit) {
  try {
   return impersonator.doAs(programId, () -> {
    // Add secure tokens
    if (User.isHBaseSecurityEnabled(hConf) || UserGroupInformation.isSecurityEnabled()) {
     addSecureStore(YarnSecureStore.create(secureStoreRenewer.createCredentials()));
    }
    return new ImpersonatedTwillController(delegate.start(timeout, timeoutUnit),
                        impersonator, programId);
   });
  } catch (Exception e) {
   throw Throwables.propagate(e);
  }
 }
}

代码示例来源:origin: co.cask.tigon/tigon-flow

@Override
 public TwillController launch(TwillApplication twillApplication) {
  TwillPreparer twillPreparer = twillRunner
   .prepare(twillApplication);
  if (options.isDebug()) {
   LOG.info("Starting {} with debugging enabled.", program.getId());
   twillPreparer.enableDebugging();
  }
  TwillController twillController = twillPreparer
   .withDependencies(new HBaseTableUtilFactory().get().getClass())
   .addSecureStore(YarnSecureStore.create(HBaseTokenUtils.obtainToken(hConf, new Credentials())))
   .withApplicationArguments(
    String.format("--%s", RunnableOptions.JAR), copiedProgram.getJarLocation().getName(),
    String.format("--%s", RunnableOptions.RUNTIME_ARGS), runtimeArgs
   ).start();
  return addCleanupListener(twillController, hConfFile, cConfFile, copiedProgram, programDir);
 }
});

代码示例来源:origin: cdapio/cdap

preparer.addSecureStore(YarnSecureStore.create(secureStoreRenewer.createCredentials()));

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