| Modifier and Type | Class | Description |
|---|---|---|
static class |
Credentials.SerializedFormat |
| Constructor | Description |
|---|---|
Credentials() |
Create an empty credentials instance.
|
Credentials(Credentials credentials) |
Create a copy of the given credentials.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addAll(Credentials other) |
Copy all of the credentials from one credential object into another.
|
void |
addSecretKey(Text alias,
byte[] key) |
Set the key for an alias.
|
void |
addToken(Text alias,
Token<? extends TokenIdentifier> t) |
Add a token in the storage (in memory).
|
java.util.List<Text> |
getAllSecretKeys() |
Return all the secret key entries in the in-memory map.
|
java.util.Collection<Token<? extends TokenIdentifier>> |
getAllTokens() |
Return all the tokens in the in-memory map.
|
byte[] |
getSecretKey(Text alias) |
Returns the key bytes for the alias.
|
java.util.Map<Text,byte[]> |
getSecretKeyMap() |
Returns an unmodifiable version of the full map of aliases to secret keys.
|
Token<? extends TokenIdentifier> |
getToken(Text alias) |
Returns the Token object for the alias.
|
java.util.Map<Text,Token<? extends TokenIdentifier>> |
getTokenMap() |
Returns an unmodifiable version of the full map of aliases to Tokens.
|
void |
mergeAll(Credentials other) |
Copy all of the credentials from one credential object into another.
|
int |
numberOfSecretKeys() |
|
int |
numberOfTokens() |
|
void |
readFields(java.io.DataInput in) |
Loads all the keys.
|
static Credentials |
readTokenStorageFile(java.io.File filename,
Configuration conf) |
Convenience method for reading a token storage file and loading its Tokens.
|
static Credentials |
readTokenStorageFile(Path filename,
Configuration conf) |
Convenience method for reading a token storage file and loading its Tokens.
|
void |
readTokenStorageStream(java.io.DataInputStream in) |
Convenience method for reading a token from a DataInputStream.
|
void |
removeSecretKey(Text alias) |
Remove the key for a given alias.
|
void |
write(java.io.DataOutput out) |
Stores all the keys to DataOutput.
|
void |
writeTokenStorageFile(Path filename,
Configuration conf) |
|
void |
writeTokenStorageFile(Path filename,
Configuration conf,
Credentials.SerializedFormat format) |
|
void |
writeTokenStorageToStream(java.io.DataOutputStream os) |
|
void |
writeTokenStorageToStream(java.io.DataOutputStream os,
Credentials.SerializedFormat format) |
public Credentials()
public Credentials(Credentials credentials)
credentials - to copypublic Token<? extends TokenIdentifier> getToken(Text alias)
alias - the alias for the Tokenpublic void addToken(Text alias, Token<? extends TokenIdentifier> t)
alias - the alias for the keyt - the token objectpublic java.util.Collection<Token<? extends TokenIdentifier>> getAllTokens()
public java.util.Map<Text,Token<? extends TokenIdentifier>> getTokenMap()
public int numberOfTokens()
public byte[] getSecretKey(Text alias)
alias - the alias for the keypublic int numberOfSecretKeys()
public void addSecretKey(Text alias, byte[] key)
alias - the alias for the keykey - the key bytespublic void removeSecretKey(Text alias)
alias - the alias for the keypublic java.util.List<Text> getAllSecretKeys()
public java.util.Map<Text,byte[]> getSecretKeyMap()
public static Credentials readTokenStorageFile(Path filename, Configuration conf) throws java.io.IOException
filename - filename.conf - configuration.java.io.IOException - raised on errors performing I/O.public static Credentials readTokenStorageFile(java.io.File filename, Configuration conf) throws java.io.IOException
filename - filename.conf - configuration.java.io.IOException - raised on errors performing I/O.public void readTokenStorageStream(java.io.DataInputStream in)
throws java.io.IOException
in - DataInputStream.java.io.IOException - raised on errors performing I/O.public void writeTokenStorageToStream(java.io.DataOutputStream os)
throws java.io.IOException
java.io.IOExceptionpublic void writeTokenStorageToStream(java.io.DataOutputStream os,
Credentials.SerializedFormat format)
throws java.io.IOException
java.io.IOExceptionpublic void writeTokenStorageFile(Path filename, Configuration conf) throws java.io.IOException
java.io.IOExceptionpublic void writeTokenStorageFile(Path filename, Configuration conf, Credentials.SerializedFormat format) throws java.io.IOException
java.io.IOExceptionpublic void write(java.io.DataOutput out)
throws java.io.IOException
public void readFields(java.io.DataInput in)
throws java.io.IOException
readFields in interface Writablein - DataInput.java.io.IOException - raised on errors performing I/O.public void addAll(Credentials other)
other - the credentials to copypublic void mergeAll(Credentials other)
other - the credentials to copyCopyright © 2008–2025 Apache Software Foundation. All rights reserved.