本文整理汇总了Java中org.apache.hadoop.security.token.delegation.web.DelegationTokenManager类的典型用法代码示例。如果您正苦于以下问题:Java DelegationTokenManager类的具体用法?Java DelegationTokenManager怎么用?Java DelegationTokenManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DelegationTokenManager类属于org.apache.hadoop.security.token.delegation.web包,在下文中一共展示了DelegationTokenManager类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: verifyDestroy
import org.apache.hadoop.security.token.delegation.web.DelegationTokenManager; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
protected void verifyDestroy(DelegationTokenManager tm, Configuration conf)
throws Exception {
AbstractDelegationTokenSecretManager sm =
tm.getDelegationTokenSecretManager();
ZKDelegationTokenSecretManager zksm = (ZKDelegationTokenSecretManager) sm;
ExecutorService es = zksm.getListenerThreadPool();
tm.destroy();
Assert.assertTrue(es.isShutdown());
// wait for the pool to terminate
long timeout =
conf.getLong(
ZKDelegationTokenSecretManager.ZK_DTSM_ZK_SHUTDOWN_TIMEOUT,
ZKDelegationTokenSecretManager.ZK_DTSM_ZK_SHUTDOWN_TIMEOUT_DEFAULT);
Thread.sleep(timeout * 3);
Assert.assertTrue(es.isTerminated());
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:18,代码来源:TestZKDelegationTokenSecretManager.java
示例2: getSecretConf
import org.apache.hadoop.security.token.delegation.web.DelegationTokenManager; //导入依赖的package包/类
protected Configuration getSecretConf(String connectString) {
Configuration conf = new Configuration();
conf.setBoolean(DelegationTokenManager.ENABLE_ZK_KEY, true);
conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_CONNECTION_STRING, connectString);
conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZNODE_WORKING_PATH, "testPath");
conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_AUTH_TYPE, "none");
conf.setLong(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_SHUTDOWN_TIMEOUT, 100);
conf.setLong(DelegationTokenManager.UPDATE_INTERVAL, DAY_IN_SECS);
conf.setLong(DelegationTokenManager.MAX_LIFETIME, DAY_IN_SECS);
conf.setLong(DelegationTokenManager.RENEW_INTERVAL, DAY_IN_SECS);
conf.setLong(DelegationTokenManager.REMOVAL_SCAN_INTERVAL, DAY_IN_SECS);
return conf;
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:14,代码来源:TestZKDelegationTokenSecretManager.java
示例3: verifyTokenFailWithRetry
import org.apache.hadoop.security.token.delegation.web.DelegationTokenManager; //导入依赖的package包/类
private void verifyTokenFailWithRetry(DelegationTokenManager tm,
Token<DelegationTokenIdentifier> token, int retryCount)
throws IOException, InterruptedException {
try {
tm.verifyToken(token);
} catch (SecretManager.InvalidToken er) {
throw er;
}
if (retryCount > 0) {
Thread.sleep(RETRY_WAIT);
verifyTokenFailWithRetry(tm, token, retryCount - 1);
}
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:14,代码来源:TestZKDelegationTokenSecretManager.java
示例4: verifyTokenFail
import org.apache.hadoop.security.token.delegation.web.DelegationTokenManager; //导入依赖的package包/类
private void verifyTokenFail(DelegationTokenManager tm,
Token<DelegationTokenIdentifier> token) throws IOException,
InterruptedException {
verifyTokenFailWithRetry(tm, token, RETRY_COUNT);
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:6,代码来源:TestZKDelegationTokenSecretManager.java
注:本文中的org.apache.hadoop.security.token.delegation.web.DelegationTokenManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论