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 entriesTokenStoreException
DelegationTokenStore.TokenStoreException
public 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:cdrwa
aclString
- public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
public org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable
public int addMasterKey(String s)
DelegationTokenStore
addMasterKey
in interface DelegationTokenStore
public void updateMasterKey(int keySeq, String s)
DelegationTokenStore
updateMasterKey
in interface DelegationTokenStore
public boolean removeMasterKey(int keySeq)
DelegationTokenStore
removeMasterKey
in interface DelegationTokenStore
public String[] getMasterKeys()
DelegationTokenStore
getMasterKeys
in interface DelegationTokenStore
public boolean addToken(DelegationTokenIdentifier tokenIdentifier, org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager.DelegationTokenInformation token)
DelegationTokenStore
addToken
in interface DelegationTokenStore
public boolean removeToken(DelegationTokenIdentifier tokenIdentifier)
DelegationTokenStore
removeToken
in interface DelegationTokenStore
public org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager.DelegationTokenInformation getToken(DelegationTokenIdentifier tokenIdentifier)
DelegationTokenStore
getToken
in interface DelegationTokenStore
public List<DelegationTokenIdentifier> getAllDelegationTokenIdentifiers()
DelegationTokenStore
getAllDelegationTokenIdentifiers
in interface DelegationTokenStore
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void init(Object objectStore, HadoopThriftAuthBridge.Server.ServerMode smode)
init
in interface DelegationTokenStore
objectStore
- ObjectStore used by DBTokenStoresmode
- Indicate whether this is a metastore or hiveserver2 token storeCopyright © 2017 The Apache Software Foundation. All rights reserved.