本文整理了Java中org.apache.twill.yarn.YarnSecureStore
类的一些代码示例,展示了YarnSecureStore
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnSecureStore
类的具体详情如下:
包路径:org.apache.twill.yarn.YarnSecureStore
类名称:YarnSecureStore
[英]A SecureStore for hadoop credentials.
[中]
代码示例来源: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: org.apache.twill/twill-yarn
public static SecureStore create(Credentials credentials) {
return new YarnSecureStore(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: apache/twill
public static SecureStore create(Credentials credentials) {
return new YarnSecureStore(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()));
内容来源于网络,如有侵权,请联系作者删除!