[ 
https://issues.apache.org/jira/browse/HADOOP-9975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13770003#comment-13770003
 ] 

Kai Zheng commented on HADOOP-9975:
-----------------------------------

Based on the work by HADOOP-9797 and the family, it’s easy to implement this as 
the new codes almost support it already introducing kerberosRelogin() method 
when refactoring the codes for reloginFromKeytab() etc as follows. 
{code}
public interface HadoopLogin {
  public void login() throws HadoopLoginException;
  public void logout() throws HadoopLoginException;
  public void relogin() throws HadoopLoginException;
...

public class AbstractHadoopLogin implements HadoopLogin {
…
  public void relogin() throws HadoopLoginException {
    logout();
    login();
  }
…
{code}

UGI saves HadoopLoign object, which can be used to do relogin(), as follows
{code}
Public class UserGroupInformation {
  private HadoopLogin login;
  public synchronized void kerberosRelogin()  throws IOException {
          login.relogin();
  }
  public synchronized void reloginFromKeytab() throws IOException {
    kerberosRelogin();
  }
  public synchronized void reloginFromTicketCache() throws IOException {
    kerberosRelogin();
  }
…
{code}
Here it’s only needed to rename the kerberosRelogin() method to relogin().

                
> Adding relogin() method to UGI
> ------------------------------
>
>                 Key: HADOOP-9975
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9975
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Kai Zheng
>            Assignee: Kai Zheng
>
> In current Hadoop UGI implementation, it has API methods like 
> reloginFromKeytab() and reloginFromTicketCache().  However, such methods are 
> too Kerberos specific and also involves login implementation details, it 
> would be better to add generic relogin() method regardless authentication 
> mechanism. This is possible since relevant authentication specific parameters 
> like principal and keytab are already passed and saved in the UGI object 
> after initial login.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to