当前位置: 首页>>代码示例>>Java>>正文


Java DelegationTokenFetcher.renewDelegationToken方法代码示例

本文整理汇总了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) {
  } 
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:TestDelegationTokenRemoteFetcher.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:TestDelegationTokenRemoteFetcher.java

示例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);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:14,代码来源:HftpFileSystem.java

示例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);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:12,代码来源:HftpFileSystem.java

示例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);
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:13,代码来源:HftpFileSystem.java

示例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);
 }
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:14,代码来源:HftpFileSystem.java


注:本文中的org.apache.hadoop.hdfs.tools.DelegationTokenFetcher.renewDelegationToken方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。