本文整理汇总了Java中org.apache.hadoop.security.token.delegation.TestDelegationToken.TestDelegationTokenSecretManager类的典型用法代码示例。如果您正苦于以下问题:Java TestDelegationTokenSecretManager类的具体用法?Java TestDelegationTokenSecretManager怎么用?Java TestDelegationTokenSecretManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TestDelegationTokenSecretManager类属于org.apache.hadoop.security.token.delegation.TestDelegationToken包,在下文中一共展示了TestDelegationTokenSecretManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDecodeIdentifier
import org.apache.hadoop.security.token.delegation.TestDelegationToken.TestDelegationTokenSecretManager; //导入依赖的package包/类
public void testDecodeIdentifier() throws IOException {
TestDelegationTokenSecretManager secretManager =
new TestDelegationTokenSecretManager(0, 0, 0, 0);
secretManager.startThreads();
TestDelegationTokenIdentifier id = new TestDelegationTokenIdentifier(
new Text("owner"), new Text("renewer"), new Text("realUser"));
Token<TestDelegationTokenIdentifier> token =
new Token<TestDelegationTokenIdentifier>(id, secretManager);
TokenIdentifier idCopy = token.decodeIdentifier();
assertNotSame(id, idCopy);
assertEquals(id, idCopy);
}
示例2: MiniServer
import org.apache.hadoop.security.token.delegation.TestDelegationToken.TestDelegationTokenSecretManager; //导入依赖的package包/类
/** Start RPC server */
MiniServer(Configuration conf, String user, String keytabFile)
throws IOException {
UserGroupInformation.setConfiguration(conf);
UserGroupInformation.loginUserFromKeytab(user, keytabFile);
secretManager =
new TestDelegationTokenSecretManager(24*60*60*1000,
7*24*60*60*1000,24*60*60*1000,3600000);
secretManager.startThreads();
rpcServer = new RPC.Builder(conf).setProtocol(MiniProtocol.class)
.setInstance(this).setBindAddress(DEFAULT_SERVER_ADDRESS).setPort(0)
.setNumHandlers(1).setVerbose(false).setSecretManager(secretManager)
.build();
rpcServer.start();
}
示例3: MiniServer
import org.apache.hadoop.security.token.delegation.TestDelegationToken.TestDelegationTokenSecretManager; //导入依赖的package包/类
/** Start RPC server */
MiniServer(Configuration conf, String user, String keytabFile)
throws IOException {
UserGroupInformation.setConfiguration(conf);
UserGroupInformation.loginUserFromKeytab(user, keytabFile);
secretManager =
new TestDelegationTokenSecretManager(24*60*60*1000,
7*24*60*60*1000,24*60*60*1000,3600000);
secretManager.startThreads();
rpcServer = RPC.getServer(
this, DEFAULT_SERVER_ADDRESS, 0, 1, false, conf, secretManager);
rpcServer.start();
}