org.apache.hadoop.yarn.server.resourcemanager.security
Class DelegationTokenRenewer

java.lang.Object
  extended by org.apache.hadoop.service.AbstractService
      extended by org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer
All Implemented Interfaces:
Closeable, org.apache.hadoop.service.Service

@InterfaceAudience.Private
@InterfaceStability.Unstable
public class DelegationTokenRenewer
extends org.apache.hadoop.service.AbstractService

Service to renew application delegation tokens.


Nested Class Summary
protected static class DelegationTokenRenewer.DelegationTokenToRenew
          class that is used for keeping tracks of DT to renew
 
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE
 
Field Summary
static String SCHEME
           
 
Constructor Summary
DelegationTokenRenewer()
           
 
Method Summary
 void addApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, org.apache.hadoop.security.Credentials ts, boolean shouldCancelAtEnd)
          Add application tokens for renewal.
 void applicationFinished(org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
          Removing delegation token for completed applications.
 Set<org.apache.hadoop.security.token.Token<?>> getDelegationTokens()
           
protected  void renewIfServiceIsStarted(List<DelegationTokenRenewer.DelegationTokenToRenew> dtrs)
           
protected  void renewToken(DelegationTokenRenewer.DelegationTokenToRenew dttr)
           
protected  void serviceInit(org.apache.hadoop.conf.Configuration conf)
           
protected  void serviceStart()
           
protected  void serviceStop()
           
 void setRMContext(RMContext rmContext)
           
protected  void setTimerForTokenRenewal(DelegationTokenRenewer.DelegationTokenToRenew token)
          set task to renew the token
 void updateKeepAliveApplications(List<org.apache.hadoop.yarn.api.records.ApplicationId> appIds)
          Add a list of applications to the keep alive list.
 
Methods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SCHEME

public static final String SCHEME
See Also:
Constant Field Values
Constructor Detail

DelegationTokenRenewer

public DelegationTokenRenewer()
Method Detail

serviceInit

protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
                    throws Exception
Overrides:
serviceInit in class org.apache.hadoop.service.AbstractService
Throws:
Exception

serviceStart

protected void serviceStart()
                     throws Exception
Overrides:
serviceStart in class org.apache.hadoop.service.AbstractService
Throws:
Exception

serviceStop

protected void serviceStop()
Overrides:
serviceStop in class org.apache.hadoop.service.AbstractService

getDelegationTokens

public Set<org.apache.hadoop.security.token.Token<?>> getDelegationTokens()

addApplication

public void addApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
                           org.apache.hadoop.security.Credentials ts,
                           boolean shouldCancelAtEnd)
                    throws IOException
Add application tokens for renewal.

Parameters:
applicationId - added application
ts - tokens
shouldCancelAtEnd - true if tokens should be canceled when the app is done else false.
Throws:
IOException

renewIfServiceIsStarted

protected void renewIfServiceIsStarted(List<DelegationTokenRenewer.DelegationTokenToRenew> dtrs)
                                throws IOException
Throws:
IOException

setTimerForTokenRenewal

protected void setTimerForTokenRenewal(DelegationTokenRenewer.DelegationTokenToRenew token)
                                throws IOException
set task to renew the token

Throws:
IOException

renewToken

protected void renewToken(DelegationTokenRenewer.DelegationTokenToRenew dttr)
                   throws IOException
Throws:
IOException

applicationFinished

public void applicationFinished(org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
Removing delegation token for completed applications.

Parameters:
applicationId - completed application

updateKeepAliveApplications

public void updateKeepAliveApplications(List<org.apache.hadoop.yarn.api.records.ApplicationId> appIds)
Add a list of applications to the keep alive list. If an appId already exists, update it's keep-alive time.

Parameters:
appIds - the list of applicationIds to be kept alive.

setRMContext

public void setRMContext(RMContext rmContext)


Copyright © 2014 Apache Software Foundation. All Rights Reserved.