@Private
public class DelegationTokenSecretManager
extends org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier>
| Modifier and Type | Class | Description |
|---|---|---|
static class |
DelegationTokenSecretManager.SecretManagerState |
| Constructor | Description |
|---|---|
DelegationTokenSecretManager(long delegationKeyUpdateInterval,
long delegationTokenMaxLifetime,
long delegationTokenRenewInterval,
long delegationTokenRemoverScanInterval,
boolean storeTokenTrackingId,
FSNamesystem namesystem) |
Create a secret manager
|
DelegationTokenSecretManager(long delegationKeyUpdateInterval,
long delegationTokenMaxLifetime,
long delegationTokenRenewInterval,
long delegationTokenRemoverScanInterval,
FSNamesystem namesystem) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addPersistedDelegationToken(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier identifier,
long expiryTime) |
This method is intended to be used only while reading edit logs.
|
static org.apache.hadoop.security.Credentials |
createCredentials(NameNode namenode,
org.apache.hadoop.security.UserGroupInformation ugi,
java.lang.String renewer) |
A utility method for creating credentials.
|
org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier |
createIdentifier() |
|
int |
getNumberOfKeys() |
Returns the number of delegation keys currently stored.
|
long |
getTokenExpiryTime(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier dtId) |
Returns expiry time of a token given its identifier.
|
void |
loadSecretManagerState(DelegationTokenSecretManager.SecretManagerState state,
StartupProgress.Counter counter) |
|
void |
loadSecretManagerStateCompat(java.io.DataInput in) |
Load SecretManager state from fsimage.
|
protected void |
logExpireToken(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier dtId) |
|
protected void |
logUpdateMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey key) |
Call namesystem to update editlogs for new master key.
|
byte[] |
retriableRetrievePassword(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier identifier) |
|
byte[] |
retrievePassword(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier identifier) |
|
DelegationTokenSecretManager.SecretManagerState |
saveSecretManagerState() |
|
void |
saveSecretManagerStateCompat(java.io.DataOutputStream out,
java.lang.String sdPath) |
Store the current state of the SecretManager for persistence
|
void |
updatePersistedMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey key) |
Add a MasterKey to the list of keys.
|
void |
updatePersistedTokenCancellation(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier identifier) |
Update the token cache with the cancel record in edit logs
|
void |
updatePersistedTokenRenewal(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier identifier,
long expiryTime) |
Update the token cache with renewal record in edit logs.
|
addKey, addTokenForOwnerStats, cancelToken, checkToken, createPassword, createSecretKey, decodeTokenIdentifier, getAllKeys, getCandidateTokensForCleanup, getCurrentKeyId, getCurrentTokensSize, getDelegationKey, getDelegationTokenSeqNum, getMetrics, getTokenInfo, getTokenRenewInterval, getTokenTrackingId, getTopTokenRealOwners, getTrackingIdIfEnabled, incrementCurrentKeyId, incrementDelegationTokenSeqNum, isRunning, logExpireTokens, removeExpiredStoredToken, removeStoredMasterKey, removeStoredToken, renewToken, reset, rollMasterKey, setCurrentKeyId, setDelegationTokenSeqNum, startThreads, stopThreads, storeDelegationKey, storeNewMasterKey, storeNewToken, storeToken, syncTokenOwnerStats, updateDelegationKey, updateStoredToken, updateToken, verifyTokenpublic DelegationTokenSecretManager(long delegationKeyUpdateInterval,
long delegationTokenMaxLifetime,
long delegationTokenRenewInterval,
long delegationTokenRemoverScanInterval,
FSNamesystem namesystem)
public DelegationTokenSecretManager(long delegationKeyUpdateInterval,
long delegationTokenMaxLifetime,
long delegationTokenRenewInterval,
long delegationTokenRemoverScanInterval,
boolean storeTokenTrackingId,
FSNamesystem namesystem)
delegationKeyUpdateInterval - the number of milliseconds for rolling
new secret keys.delegationTokenMaxLifetime - the maximum lifetime of the delegation
tokens in millisecondsdelegationTokenRenewInterval - how often the tokens must be renewed
in millisecondsdelegationTokenRemoverScanInterval - how often the tokens are scanned
for expired tokens in millisecondsstoreTokenTrackingId - whether to store the token's tracking idpublic org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier createIdentifier()
createIdentifier in class org.apache.hadoop.security.token.SecretManager<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier>public byte[] retrievePassword(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier identifier)
throws org.apache.hadoop.security.token.SecretManager.InvalidToken
retrievePassword in class org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier>org.apache.hadoop.security.token.SecretManager.InvalidTokenpublic byte[] retriableRetrievePassword(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier identifier)
throws org.apache.hadoop.security.token.SecretManager.InvalidToken,
org.apache.hadoop.ipc.StandbyException,
org.apache.hadoop.ipc.RetriableException,
java.io.IOException
retriableRetrievePassword in class org.apache.hadoop.security.token.SecretManager<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier>org.apache.hadoop.security.token.SecretManager.InvalidTokenorg.apache.hadoop.ipc.StandbyExceptionorg.apache.hadoop.ipc.RetriableExceptionjava.io.IOExceptionpublic long getTokenExpiryTime(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier dtId)
throws java.io.IOException
dtId - DelegationTokenIdentifier of a tokenjava.io.IOExceptionpublic void loadSecretManagerStateCompat(java.io.DataInput in)
throws java.io.IOException
in - input stream to read fsimagejava.io.IOExceptionpublic void loadSecretManagerState(DelegationTokenSecretManager.SecretManagerState state, StartupProgress.Counter counter) throws java.io.IOException
java.io.IOExceptionpublic void saveSecretManagerStateCompat(java.io.DataOutputStream out,
java.lang.String sdPath)
throws java.io.IOException
out - Output stream for writing into fsimage.sdPath - String storage directory pathjava.io.IOExceptionpublic DelegationTokenSecretManager.SecretManagerState saveSecretManagerState()
public void addPersistedDelegationToken(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier identifier,
long expiryTime)
throws java.io.IOException
addPersistedDelegationToken in class org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier>identifier - DelegationTokenIdentifier read from the edit logs or
fsimageexpiryTime - token expiry timejava.io.IOExceptionpublic void updatePersistedMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey key)
throws java.io.IOException
key - DelegationKeyjava.io.IOExceptionpublic void updatePersistedTokenRenewal(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier identifier,
long expiryTime)
throws java.io.IOException
identifier - DelegationTokenIdentifier of the renewed tokenexpiryTime - expirty time in millisecondsjava.io.IOExceptionpublic void updatePersistedTokenCancellation(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier identifier)
throws java.io.IOException
identifier - DelegationTokenIdentifier of the canceled tokenjava.io.IOExceptionpublic int getNumberOfKeys()
protected void logUpdateMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey key)
throws java.io.IOException
logUpdateMasterKey in class org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier>java.io.IOExceptionprotected void logExpireToken(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier dtId)
throws java.io.IOException
logExpireToken in class org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier>java.io.IOExceptionpublic static org.apache.hadoop.security.Credentials createCredentials(NameNode namenode, org.apache.hadoop.security.UserGroupInformation ugi, java.lang.String renewer) throws java.io.IOException
java.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.