/// <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)));
                }
            }
        /// <exception cref="Com.Google.Protobuf.ServiceException"/>
        public virtual SecurityProtos.RenewDelegationTokenResponseProto RenewDelegationToken
            (RpcController controller, SecurityProtos.RenewDelegationTokenRequestProto proto
            )
        {
            RenewDelegationTokenRequestPBImpl request = new RenewDelegationTokenRequestPBImpl
                                                            (proto);

            try
            {
                RenewDelegationTokenResponse response = real.RenewDelegationToken(request);
                return(((RenewDelegationTokenResponsePBImpl)response).GetProto());
            }
            catch (YarnException e)
            {
                throw new ServiceException(e);
            }
            catch (IOException e)
            {
                throw new ServiceException(e);
            }
        }