public class DelegationTokenSecretManager extends AbstractDelegationTokenSecretManager<DelegationTokenIdentifier>
AbstractDelegationTokenSecretManager.DelegationTokenInformationSecretManager.InvalidTokenallKeys, currentId, currentTokens, delegationTokenSequenceNumber, noInterruptsLock, running| 构造器和说明 |
|---|
DelegationTokenSecretManager(long delegationKeyUpdateInterval,
long delegationTokenMaxLifetime,
long delegationTokenRenewInterval,
long delegationTokenRemoverScanInterval,
FSNamesystem namesystem)
Create a secret manager
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addPersistedDelegationToken(DelegationTokenIdentifier identifier,
long expiryTime)
This method is intended to be used only while reading edit logs.
|
static Credentials |
createCredentials(NameNode namenode,
UserGroupInformation ugi,
String renewer)
A utility method for creating credentials.
|
DelegationTokenIdentifier |
createIdentifier()
Create an empty token identifier.
|
int |
getNumberOfKeys()
Returns the number of delegation keys currently stored.
|
long |
getTokenExpiryTime(DelegationTokenIdentifier dtId)
Returns expiry time of a token given its identifier.
|
void |
loadSecretManagerState(DataInputStream in)
Load SecretManager state from fsimage.
|
protected void |
logUpdateMasterKey(DelegationKey key)
Call namesystem to update editlogs for new master key.
|
void |
saveSecretManagerState(DataOutputStream out)
Store the current state of the SecretManager for persistence
|
void |
updatePersistedMasterKey(DelegationKey key)
Add a MasterKey to the list of keys.
|
void |
updatePersistedTokenCancellation(DelegationTokenIdentifier identifier)
Update the token cache with the cancel record in edit logs
|
void |
updatePersistedTokenRenewal(DelegationTokenIdentifier identifier,
long expiryTime)
Update the token cache with renewal record in edit logs.
|
addKey, cancelToken, createPassword, createSecretKey, getAllKeys, isRunning, renewToken, retrievePassword, startThreads, stopThreads, verifyTokencreatePassword, generateSecretpublic DelegationTokenSecretManager(long delegationKeyUpdateInterval,
long delegationTokenMaxLifetime,
long delegationTokenRenewInterval,
long delegationTokenRemoverScanInterval,
FSNamesystem namesystem)
delegationKeyUpdateInterval - the number of seconds for rolling new
secret keys.delegationTokenMaxLifetime - the maximum lifetime of the delegation
tokensdelegationTokenRenewInterval - how often the tokens must be reneweddelegationTokenRemoverScanInterval - how often the tokens are scanned
for expired tokenspublic DelegationTokenIdentifier createIdentifier()
SecretManagercreateIdentifier 在类中 SecretManager<DelegationTokenIdentifier>public long getTokenExpiryTime(DelegationTokenIdentifier dtId) throws IOException
dtId - DelegationTokenIdentifier of a tokenIOExceptionpublic void loadSecretManagerState(DataInputStream in) throws IOException
in - input stream to read fsimageIOExceptionpublic void saveSecretManagerState(DataOutputStream out) throws IOException
out - Output stream for writing into fsimage.IOExceptionpublic void addPersistedDelegationToken(DelegationTokenIdentifier identifier, long expiryTime) throws IOException
identifier - DelegationTokenIdentifier read from the edit logs or
fsimageexpiryTime - token expiry timeIOExceptionpublic void updatePersistedMasterKey(DelegationKey key) throws IOException
key - DelegationKeyIOExceptionpublic void updatePersistedTokenRenewal(DelegationTokenIdentifier identifier, long expiryTime) throws IOException
identifier - DelegationTokenIdentifier of the renewed tokenexpiryTime - IOExceptionpublic void updatePersistedTokenCancellation(DelegationTokenIdentifier identifier) throws IOException
identifier - DelegationTokenIdentifier of the canceled tokenIOExceptionpublic int getNumberOfKeys()
protected void logUpdateMasterKey(DelegationKey key) throws IOException
public static Credentials createCredentials(NameNode namenode, UserGroupInformation ugi, String renewer) throws IOException
IOExceptionCopyright © 2009 The Apache Software Foundation