@InterfaceAudience.Private
@InterfaceStability.Unstable
public class DelegationTokenRenewer
extends org.apache.hadoop.service.AbstractService
Modifier and Type | Class and Description |
---|---|
protected static class |
DelegationTokenRenewer.DelegationTokenToRenew
class that is used for keeping tracks of DT to renew
|
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_RM_SYSTEM_CREDENTIALS_VALID_TIME_REMAINING |
static org.apache.hadoop.io.Text |
HDFS_DELEGATION_KIND |
static String |
RM_SYSTEM_CREDENTIALS_VALID_TIME_REMAINING |
static String |
SCHEME |
Constructor and Description |
---|
DelegationTokenRenewer() |
Modifier and Type | Method and Description |
---|---|
void |
addApplicationAsync(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
org.apache.hadoop.security.Credentials ts,
boolean shouldCancelAtEnd,
String user)
Asynchronously add application tokens for renewal.
|
void |
addApplicationAsyncDuringRecovery(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
org.apache.hadoop.security.Credentials ts,
boolean shouldCancelAtEnd,
String user)
Asynchronously add application tokens for renewal.
|
void |
addApplicationSync(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
org.apache.hadoop.security.Credentials ts,
boolean shouldCancelAtEnd,
String user)
Synchronously renew delegation tokens.
|
void |
applicationFinished(org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
Removing delegation token for completed applications.
|
protected ThreadPoolExecutor |
createNewThreadPoolService(org.apache.hadoop.conf.Configuration conf) |
protected ConcurrentMap<org.apache.hadoop.security.token.Token<?>,DelegationTokenRenewer.DelegationTokenToRenew> |
getAllTokens() |
Set<org.apache.hadoop.security.token.Token<?>> |
getDelegationTokens() |
protected org.apache.hadoop.security.token.Token<?>[] |
obtainSystemTokensForUser(String user,
org.apache.hadoop.security.Credentials credentials) |
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.
|
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
public static final org.apache.hadoop.io.Text HDFS_DELEGATION_KIND
public static final String SCHEME
public static final String RM_SYSTEM_CREDENTIALS_VALID_TIME_REMAINING
public static final long DEFAULT_RM_SYSTEM_CREDENTIALS_VALID_TIME_REMAINING
protected void serviceInit(org.apache.hadoop.conf.Configuration conf) throws Exception
serviceInit
in class org.apache.hadoop.service.AbstractService
Exception
protected ThreadPoolExecutor createNewThreadPoolService(org.apache.hadoop.conf.Configuration conf)
protected void serviceStart() throws Exception
serviceStart
in class org.apache.hadoop.service.AbstractService
Exception
protected void serviceStop()
serviceStop
in class org.apache.hadoop.service.AbstractService
public Set<org.apache.hadoop.security.token.Token<?>> getDelegationTokens()
public void addApplicationAsync(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, org.apache.hadoop.security.Credentials ts, boolean shouldCancelAtEnd, String user)
applicationId
- added applicationts
- tokensshouldCancelAtEnd
- true if tokens should be canceled when the app is
done else false.user
- userpublic void addApplicationAsyncDuringRecovery(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, org.apache.hadoop.security.Credentials ts, boolean shouldCancelAtEnd, String user)
applicationId
- added applicationts
- tokensshouldCancelAtEnd
- true if tokens should be canceled when the app is done else false.user
- userpublic void addApplicationSync(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, org.apache.hadoop.security.Credentials ts, boolean shouldCancelAtEnd, String user) throws IOException, InterruptedException
user
- userIOException
InterruptedException
protected void setTimerForTokenRenewal(DelegationTokenRenewer.DelegationTokenToRenew token) throws IOException
IOException
protected void renewToken(DelegationTokenRenewer.DelegationTokenToRenew dttr) throws IOException
IOException
protected org.apache.hadoop.security.token.Token<?>[] obtainSystemTokensForUser(String user, org.apache.hadoop.security.Credentials credentials) throws IOException, InterruptedException
IOException
InterruptedException
public void applicationFinished(org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
applicationId
- completed applicationpublic void updateKeepAliveApplications(List<org.apache.hadoop.yarn.api.records.ApplicationId> appIds)
appIds
- the list of applicationIds to be kept alive.public void setRMContext(RMContext rmContext)
protected ConcurrentMap<org.apache.hadoop.security.token.Token<?>,DelegationTokenRenewer.DelegationTokenToRenew> getAllTokens()
Copyright © 2017 Apache Software Foundation. All Rights Reserved.