コード例 #1
0
ファイル: HftpFileSystem.cs プロジェクト: orf53975/hadoop.net
            /// <exception cref="System.Exception"/>
            public long Run()
            {
                IPEndPoint serviceAddr = SecurityUtil.GetTokenServiceAddr(token);

                return(DelegationTokenFetcher.RenewDelegationToken(this._enclosing.connectionFactory
                                                                   , DFSUtil.CreateUri(this._enclosing.GetUnderlyingProtocol(), serviceAddr), (Org.Apache.Hadoop.Security.Token.Token
                                                                                                                                               <DelegationTokenIdentifier>)token));
            }
コード例 #2
0
 public virtual void TestRenewTokenFromHttp()
 {
     bootstrap = StartHttpServer(httpPort, testToken, serviceUrl);
     NUnit.Framework.Assert.IsTrue("testRenewTokenFromHttp error", long.Parse(ExpDate)
                                   == DelegationTokenFetcher.RenewDelegationToken(connectionFactory, serviceUrl, testToken
                                                                                  ));
     if (assertionError != null)
     {
         throw assertionError;
     }
 }
コード例 #3
0
 public virtual void TestTokenRenewFail()
 {
     try
     {
         DelegationTokenFetcher.RenewDelegationToken(connectionFactory, serviceUrl, testToken
                                                     );
         NUnit.Framework.Assert.Fail("Token fetcher shouldn't be able to renew tokens in absense of NN"
                                     );
     }
     catch (IOException)
     {
     }
 }
コード例 #4
0
 public virtual void ExpectedTokenRenewErrorHttpResponse()
 {
     bootstrap = StartHttpServer(httpPort, testToken, serviceUrl);
     try
     {
         DelegationTokenFetcher.RenewDelegationToken(connectionFactory, new URI(serviceUrl
                                                                                .ToString() + "/exception"), CreateToken(serviceUrl));
         NUnit.Framework.Assert.Fail("Token fetcher shouldn't be able to renew tokens using an invalid"
                                     + " NN URL");
     }
     catch (IOException)
     {
     }
     if (assertionError != null)
     {
         throw assertionError;
     }
 }