本文整理汇总了Java中org.apache.hadoop.hdfs.tools.DelegationTokenFetcher.renewDelegationToken方法的典型用法代码示例。如果您正苦于以下问题:Java DelegationTokenFetcher.renewDelegationToken方法的具体用法?Java DelegationTokenFetcher.renewDelegationToken怎么用?Java DelegationTokenFetcher.renewDelegationToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hdfs.tools.DelegationTokenFetcher
的用法示例。
在下文中一共展示了DelegationTokenFetcher.renewDelegationToken方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testTokenRenewFail
import org.apache.hadoop.hdfs.tools.DelegationTokenFetcher; //导入方法依赖的package包/类
/**
* try to fetch token without http server with IOException
*/
@Test
public void testTokenRenewFail() throws AuthenticationException {
try {
DelegationTokenFetcher.renewDelegationToken(connectionFactory, serviceUrl, testToken);
fail("Token fetcher shouldn't be able to renew tokens in absense of NN");
} catch (IOException ex) {
}
}
示例2: expectedTokenRenewErrorHttpResponse
import org.apache.hadoop.hdfs.tools.DelegationTokenFetcher; //导入方法依赖的package包/类
/**
* try fetch token and get http response with error
*/
@Test
public void expectedTokenRenewErrorHttpResponse()
throws AuthenticationException, URISyntaxException {
bootstrap = startHttpServer(httpPort, testToken, serviceUrl);
try {
DelegationTokenFetcher.renewDelegationToken(connectionFactory, new URI(
serviceUrl.toString() + "/exception"), createToken(serviceUrl));
fail("Token fetcher shouldn't be able to renew tokens using an invalid"
+ " NN URL");
} catch (IOException ex) {
}
if (assertionError != null)
throw assertionError;
}
示例3: renew
import org.apache.hadoop.hdfs.tools.DelegationTokenFetcher; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public long renew(Token<?> token,
Configuration conf) throws IOException {
// update the kerberos credentials, if they are coming from a keytab
UserGroupInformation.getLoginUser().checkTGTAndReloginFromKeytab();
// use http to renew the token
InetSocketAddress serviceAddr = SecurityUtil.getTokenServiceAddr(token);
return
DelegationTokenFetcher.renewDelegationToken
(DFSUtil.createUri("http", serviceAddr).toString(),
(Token<DelegationTokenIdentifier>) token);
}
示例4: renew
import org.apache.hadoop.hdfs.tools.DelegationTokenFetcher; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public long renew(Token<?> token, Configuration conf) throws IOException {
// update the kerberos credentials, if they are coming from a keytab
UserGroupInformation.getLoginUser().reloginFromKeytab();
// use http to renew the token
InetSocketAddress serviceAddr = SecurityUtil.getTokenServiceAddr(token);
return DelegationTokenFetcher.renewDelegationToken(
DFSUtil.createUri("http", serviceAddr).toString(),
(Token<DelegationTokenIdentifier>) token);
}
示例5: renew
import org.apache.hadoop.hdfs.tools.DelegationTokenFetcher; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public long renew(Token<?> token,
Configuration conf) throws IOException {
// update the kerberos credentials, if they are coming from a keytab
UserGroupInformation.getLoginUser().checkTGTAndReloginFromKeytab();
InetSocketAddress serviceAddr = SecurityUtil.getTokenServiceAddr(token);
return
DelegationTokenFetcher.renewDelegationToken
(DFSUtil.createUri(getUnderlyingProtocol(), serviceAddr).toString(),
(Token<DelegationTokenIdentifier>) token);
}
示例6: renew
import org.apache.hadoop.hdfs.tools.DelegationTokenFetcher; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public long renew(Token<?> token,
Configuration conf) throws IOException {
// update the kerberos credentials, if they are coming from a keytab
UserGroupInformation.getLoginUser().checkTGTAndReloginFromKeytab();
// use http to renew the token
InetSocketAddress serviceAddr = SecurityUtil.getTokenServiceAddr(token);
return DelegationTokenFetcher.
renewDelegationToken(DFSUtil.createUri(getUnderlyingProtocol(),
serviceAddr).toString(),
(Token<DelegationTokenIdentifier>) token);
}