/// <exception cref="System.IO.IOException"/>
            /// <exception cref="System.Exception"/>
            public override long Renew <_T0>(Org.Apache.Hadoop.Security.Token.Token <_T0> token
                                             , Configuration conf)
            {
                ApplicationClientProtocol rmClient = GetRmClient(token, conf);

                if (rmClient != null)
                {
                    try
                    {
                        RenewDelegationTokenRequest request = Records.NewRecord <RenewDelegationTokenRequest
                                                                                 >();
                        request.SetDelegationToken(ConvertToProtoToken(token));
                        return(rmClient.RenewDelegationToken(request).GetNextExpirationTime());
                    }
                    catch (YarnException e)
                    {
                        throw new IOException(e);
                    }
                    finally
                    {
                        RPC.StopProxy(rmClient);
                    }
                }
                else
                {
                    return(localSecretManager.RenewToken((Org.Apache.Hadoop.Security.Token.Token <RMDelegationTokenIdentifier
                                                                                                  >)token, GetRenewer(token)));
                }
            }
Example #2
0
            /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
            /// <exception cref="System.IO.IOException"/>
            public long Run()
            {
                RenewDelegationTokenRequest request = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord
                                                      <RenewDelegationTokenRequest>();

                request.SetDelegationToken(dToken);
                return(clientRMService.RenewDelegationToken(request).GetNextExpirationTime());
            }
        /// <exception cref="System.IO.IOException"/>
        /// <exception cref="System.Exception"/>
        public override long Renew <_T0>(Org.Apache.Hadoop.Security.Token.Token <_T0> token
                                         , Configuration conf)
        {
            Org.Apache.Hadoop.Yarn.Api.Records.Token dToken = Org.Apache.Hadoop.Yarn.Api.Records.Token
                                                              .NewInstance(token.GetIdentifier(), token.GetKind().ToString(), token.GetPassword
                                                                               (), token.GetService().ToString());
            MRClientProtocol histProxy = InstantiateHistoryProxy(conf, SecurityUtil.GetTokenServiceAddr
                                                                     (token));

            try
            {
                RenewDelegationTokenRequest request = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord
                                                      <RenewDelegationTokenRequest>();
                request.SetDelegationToken(dToken);
                return(histProxy.RenewDelegationToken(request).GetNextExpirationTime());
            }
            finally
            {
                StopHistoryProxy(histProxy);
            }
        }