public class ZooKeeperTokenStore extends Object implements DelegationTokenStore
DelegationTokenStore.TokenStoreException| Modifier and Type | Field and Description |
|---|---|
protected static String |
ZK_SEQ_FORMAT |
| Modifier | Constructor and Description |
|---|---|
protected |
ZooKeeperTokenStore()
Default constructor for dynamic instantiation w/ Configurable
(ReflectionUtils does not support Configuration constructor injection).
|
| Modifier and Type | Method and Description |
|---|---|
int |
addMasterKey(String s)
Add new master key.
|
boolean |
addToken(DelegationTokenIdentifier tokenIdentifier,
org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager.DelegationTokenInformation token)
Add token.
|
void |
close() |
void |
ensurePath(String path,
List<org.apache.zookeeper.data.ACL> acl)
Create a path if it does not already exist ("mkdir -p")
|
List<DelegationTokenIdentifier> |
getAllDelegationTokenIdentifiers()
List of all token identifiers in the store.
|
org.apache.hadoop.conf.Configuration |
getConf() |
String[] |
getMasterKeys()
Return all master keys.
|
static int |
getPermFromString(String permString)
Parse ACL permission string, from ZooKeeperMain private method
|
org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager.DelegationTokenInformation |
getToken(DelegationTokenIdentifier tokenIdentifier)
Get token.
|
void |
init(Object objectStore,
HadoopThriftAuthBridge.Server.ServerMode smode) |
static List<org.apache.zookeeper.data.ACL> |
parseACLs(String aclString)
Parse comma separated list of ACL entries to secure generated nodes, e.g.
|
boolean |
removeMasterKey(int keySeq)
Remove key for given id.
|
boolean |
removeToken(DelegationTokenIdentifier tokenIdentifier)
Remove token.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
void |
updateMasterKey(int keySeq,
String s)
Update master key (for expiration and setting store assigned sequence within key)
|
protected static final String ZK_SEQ_FORMAT
protected ZooKeeperTokenStore()
public void ensurePath(String path, List<org.apache.zookeeper.data.ACL> acl) throws DelegationTokenStore.TokenStoreException
path - string with '/' separatoracl - list of ACL entriesTokenStoreExceptionDelegationTokenStore.TokenStoreExceptionpublic static int getPermFromString(String permString)
permString - public static List<org.apache.zookeeper.data.ACL> parseACLs(String aclString)
sasl:hive/host1@MY.DOMAIN:cdrwa,sasl:hive/host2@MY.DOMAIN:cdrwaaclString - public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.Configurablepublic org.apache.hadoop.conf.Configuration getConf()
getConf in interface org.apache.hadoop.conf.Configurablepublic int addMasterKey(String s)
DelegationTokenStoreaddMasterKey in interface DelegationTokenStorepublic void updateMasterKey(int keySeq,
String s)
DelegationTokenStoreupdateMasterKey in interface DelegationTokenStorepublic boolean removeMasterKey(int keySeq)
DelegationTokenStoreremoveMasterKey in interface DelegationTokenStorepublic String[] getMasterKeys()
DelegationTokenStoregetMasterKeys in interface DelegationTokenStorepublic boolean addToken(DelegationTokenIdentifier tokenIdentifier, org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager.DelegationTokenInformation token)
DelegationTokenStoreaddToken in interface DelegationTokenStorepublic boolean removeToken(DelegationTokenIdentifier tokenIdentifier)
DelegationTokenStoreremoveToken in interface DelegationTokenStorepublic org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager.DelegationTokenInformation getToken(DelegationTokenIdentifier tokenIdentifier)
DelegationTokenStoregetToken in interface DelegationTokenStorepublic List<DelegationTokenIdentifier> getAllDelegationTokenIdentifiers()
DelegationTokenStoregetAllDelegationTokenIdentifiers in interface DelegationTokenStorepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void init(Object objectStore, HadoopThriftAuthBridge.Server.ServerMode smode)
init in interface DelegationTokenStoreobjectStore - ObjectStore used by DBTokenStoresmode - Indicate whether this is a metastore or hiveserver2 token storeCopyright © 2017 The Apache Software Foundation. All rights reserved.