本文整理汇总了Java中org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier类的典型用法代码示例。如果您正苦于以下问题:Java DelegationTokenIdentifier类的具体用法?Java DelegationTokenIdentifier怎么用?Java DelegationTokenIdentifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DelegationTokenIdentifier类属于org.apache.hadoop.security.token.delegation.web包,在下文中一共展示了DelegationTokenIdentifier类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: verifyTokenFailWithRetry
import org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier; //导入依赖的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
示例2: testNodeHeartBeatResponse
import org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier; //导入依赖的package包/类
@Test
public void testNodeHeartBeatResponse() throws IOException {
NodeHeartbeatResponse record =
Records.newRecord(NodeHeartbeatResponse.class);
Map<ApplicationId, ByteBuffer> appCredentials =
new HashMap<ApplicationId, ByteBuffer>();
Credentials app1Cred = new Credentials();
Token<DelegationTokenIdentifier> token1 =
new Token<DelegationTokenIdentifier>();
token1.setKind(new Text("kind1"));
app1Cred.addToken(new Text("token1"), token1);
Token<DelegationTokenIdentifier> token2 =
new Token<DelegationTokenIdentifier>();
token2.setKind(new Text("kind2"));
app1Cred.addToken(new Text("token2"), token2);
DataOutputBuffer dob = new DataOutputBuffer();
app1Cred.writeTokenStorageToStream(dob);
ByteBuffer byteBuffer1 = ByteBuffer.wrap(dob.getData(), 0, dob.getLength());
appCredentials.put(ApplicationId.newInstance(1234, 1), byteBuffer1);
record.setSystemCredentialsForApps(appCredentials);
NodeHeartbeatResponse proto =
new NodeHeartbeatResponsePBImpl(
((NodeHeartbeatResponsePBImpl) record).getProto());
Assert.assertEquals(appCredentials, proto.getSystemCredentialsForApps());
}
开发者ID:naver,项目名称:hadoop,代码行数:29,代码来源:TestProtocolRecords.java
示例3: MyResourceTracker4
import org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier; //导入依赖的package包/类
public MyResourceTracker4(Context context) {
// create app Credentials
org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token1 =
new org.apache.hadoop.security.token.Token<DelegationTokenIdentifier>();
token1.setKind(new Text("kind1"));
expectedCredentials.addToken(new Text("token1"), token1);
this.context = context;
}
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestNodeStatusUpdater.java
示例4: verifyTokenFail
import org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier; //导入依赖的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.DelegationTokenIdentifier类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论