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