|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.security.Credentials
public class Credentials
A class that provides the facilities of reading and writing secret keys and Tokens.
Constructor Summary | |
---|---|
Credentials()
|
Method Summary | |
---|---|
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) |
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 |
Token<? extends TokenIdentifier> |
getToken(Text alias)
Returns the Token object for the alias |
int |
numberOfSecretKeys()
|
int |
numberOfTokens()
|
void |
readFields(DataInput in)
Loads all the keys |
static Credentials |
readTokenStorageFile(Path filename,
Configuration conf)
Convenience method for reading a token storage file, and loading the Tokens therein in the passed UGI |
void |
readTokenStorageStream(DataInputStream in)
Convenience method for reading a token storage file directly from a datainputstream |
void |
write(DataOutput out)
Stores all the keys to DataOutput |
void |
writeTokenStorageFile(Path filename,
Configuration conf)
|
void |
writeTokenStorageToStream(DataOutputStream os)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Credentials()
Method Detail |
---|
public byte[] getSecretKey(Text alias)
alias
- the alias for the key
public Token<? extends TokenIdentifier> getToken(Text alias)
alias
- the alias for the Token
public void addToken(Text alias, Token<? extends TokenIdentifier> t)
alias
- the alias for the keyt
- the token objectpublic Collection<Token<? extends TokenIdentifier>> getAllTokens()
public int numberOfTokens()
public int numberOfSecretKeys()
public void addSecretKey(Text alias, byte[] key)
alias
- the alias for the keykey
- the key bytespublic static Credentials readTokenStorageFile(Path filename, Configuration conf) throws IOException
filename
- conf
-
IOException
public void readTokenStorageStream(DataInputStream in) throws IOException
IOException
public void writeTokenStorageToStream(DataOutputStream os) throws IOException
IOException
public void writeTokenStorageFile(Path filename, Configuration conf) throws IOException
IOException
public void write(DataOutput out) throws IOException
write
in interface Writable
out
-
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface Writable
in
-
IOException
public void addAll(Credentials other)
other
- the credentials to copy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |