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

                if (rmClient != null)
                {
                    try
                    {
                        CancelDelegationTokenRequest request = Records.NewRecord <CancelDelegationTokenRequest
                                                                                  >();
                        request.SetDelegationToken(ConvertToProtoToken(token));
                        rmClient.CancelDelegationToken(request);
                    }
                    catch (YarnException e)
                    {
                        throw new IOException(e);
                    }
                    finally
                    {
                        RPC.StopProxy(rmClient);
                    }
                }
                else
                {
                    localSecretManager.CancelToken((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 Void Run()
            {
                CancelDelegationTokenRequest request = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord
                                                       <CancelDelegationTokenRequest>();

                request.SetDelegationToken(dToken);
                clientRMService.CancelDelegationToken(request);
                return(null);
            }
        /// <exception cref="System.IO.IOException"/>
        /// <exception cref="System.Exception"/>
        public override void Cancel <_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
            {
                CancelDelegationTokenRequest request = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord
                                                       <CancelDelegationTokenRequest>();
                request.SetDelegationToken(dToken);
                histProxy.CancelDelegationToken(request);
            }
            finally
            {
                StopHistoryProxy(histProxy);
            }
        }