@InterfaceAudience.Private @InterfaceStability.Unstable public class DelegationTokenRenewer extends AbstractService
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DelegationTokenRenewer.DelegationTokenToRenew
class that is used for keeping tracks of DT to renew
|
Service.STATE| Constructor and Description |
|---|
DelegationTokenRenewer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addApplication(ApplicationId applicationId,
Credentials ts,
boolean shouldCancelAtEnd)
Add application tokens for renewal.
|
void |
applicationFinished(ApplicationId applicationId)
Removing delegation token for completed applications.
|
Set<Token<?>> |
getDelegationTokens() |
protected void |
renewIfServiceIsStarted(List<DelegationTokenRenewer.DelegationTokenToRenew> dtrs) |
protected void |
renewToken(DelegationTokenRenewer.DelegationTokenToRenew dttr) |
protected void |
serviceInit(Configuration conf)
All initialization code needed by a service.
|
protected void |
serviceStart()
Actions called during the INITED to STARTED transition.
|
protected void |
serviceStop()
Actions called during the transition to the STOPPED state.
|
void |
setRMContext(RMContext rmContext) |
protected void |
setTimerForTokenRenewal(DelegationTokenRenewer.DelegationTokenToRenew token)
set task to renew the token
|
void |
updateKeepAliveApplications(List<ApplicationId> appIds)
Add a list of applications to the keep alive list.
|
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStoppublic static final String SCHEME
protected void serviceInit(Configuration conf) throws Exception
AbstractServiceAbstractService.init(Configuration) prevents re-entrancy.
The base implementation checks to see if the subclass has created
a new configuration instance, and if so, updates the base class valueserviceInit in class AbstractServiceconf - configurationException - on a failure -these will be caught,
possibly wrapped, and wil; trigger a service stopprotected void serviceStart()
throws Exception
AbstractServiceAbstractService.start() prevents re-entrancy.serviceStart in class AbstractServiceException - if needed -these will be caught,
wrapped, and trigger a service stopprotected void serviceStop()
AbstractServiceAbstractService.stop() prevents re-entrancy.
Implementations MUST write this to be robust against failures, including
checks for null references -and for the first failure to not stop other
attempts to shut down parts of the service.serviceStop in class AbstractServicepublic void addApplication(ApplicationId applicationId, Credentials ts, boolean shouldCancelAtEnd) throws IOException
applicationId - added applicationts - tokensshouldCancelAtEnd - true if tokens should be canceled when the app is
done else false.IOExceptionprotected void renewIfServiceIsStarted(List<DelegationTokenRenewer.DelegationTokenToRenew> dtrs) throws IOException
IOExceptionprotected void setTimerForTokenRenewal(DelegationTokenRenewer.DelegationTokenToRenew token) throws IOException
IOExceptionprotected void renewToken(DelegationTokenRenewer.DelegationTokenToRenew dttr) throws IOException
IOExceptionpublic void applicationFinished(ApplicationId applicationId)
applicationId - completed applicationpublic void updateKeepAliveApplications(List<ApplicationId> appIds)
appIds - the list of applicationIds to be kept alive.public void setRMContext(RMContext rmContext)
Copyright © 2013 Apache Software Foundation. All rights reserved.