public class AutoHive extends AbstractAutoCreds
Automatically get hive delegation tokens and push it to user’s topology.
Modifier and Type | Field and Description |
---|---|
static String |
HIVE_CREDENTIALS |
static String |
HIVE_CREDENTIALS_CONFIG_KEYS |
static String |
HIVE_KEYTAB_FILE_KEY |
static String |
HIVE_PRINCIPAL_KEY |
String |
hiveKeytab |
String |
hivePrincipal |
String |
metaStoreURI |
CONFIG_KEY_RESOURCES
Constructor and Description |
---|
AutoHive() |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.hive.conf.HiveConf |
createHiveConf(String metaStoreURI,
String hiveMetaStorePrincipal) |
void |
doPrepare(Map conf)
Prepare the plugin
|
void |
doRenew(Map<String,String> credentials,
Map<String,Object> topologyConf,
String ownerPrincipal) |
protected String |
getConfigKeyString()
The lookup key for the config key string
|
protected String |
getCredentialKey(String configKey)
The key with which the credentials are stored in the credentials map
|
protected byte[] |
getHadoopCredentials(Map<String,Object> conf,
org.apache.hadoop.conf.Configuration configuration,
String topologyOwnerPrincipal) |
protected byte[] |
getHadoopCredentials(Map<String,Object> conf,
String topologyOwnerPrincipal) |
protected byte[] |
getHadoopCredentials(Map<String,Object> conf,
String configKey,
String topologyOwnerPrincipal) |
static void |
main(String[] args) |
void |
populateCredentials(Map<String,String> credentials,
Map topoConf)
Method that will be called on nimbus as part of submit topology.
|
void |
renew(Map<String,String> credentials,
Map topologyConf)
Renew any credentials that need to be renewed.
|
void |
shutdown() |
fillHadoopConfiguration, getCredentials, populateCredentials, populateCredentials, populateSubject, prepare, renew, updateSubject
public static final String HIVE_CREDENTIALS
public static final String HIVE_CREDENTIALS_CONFIG_KEYS
public static final String HIVE_KEYTAB_FILE_KEY
public static final String HIVE_PRINCIPAL_KEY
public String hiveKeytab
public String hivePrincipal
public String metaStoreURI
public void doPrepare(Map conf)
AbstractAutoCreds
Prepare the plugin
doPrepare
in class AbstractAutoCreds
conf
- the storm cluster conf set via storm.yamlprotected String getConfigKeyString()
AbstractAutoCreds
The lookup key for the config key string
getConfigKeyString
in class AbstractAutoCreds
public void shutdown()
protected byte[] getHadoopCredentials(Map<String,Object> conf, String configKey, String topologyOwnerPrincipal)
getHadoopCredentials
in class AbstractAutoCreds
protected byte[] getHadoopCredentials(Map<String,Object> conf, String topologyOwnerPrincipal)
getHadoopCredentials
in class AbstractAutoCreds
public org.apache.hadoop.hive.conf.HiveConf createHiveConf(String metaStoreURI, String hiveMetaStorePrincipal) throws IOException
IOException
protected byte[] getHadoopCredentials(Map<String,Object> conf, org.apache.hadoop.conf.Configuration configuration, String topologyOwnerPrincipal)
public void doRenew(Map<String,String> credentials, Map<String,Object> topologyConf, String ownerPrincipal)
doRenew
in class AbstractAutoCreds
protected String getCredentialKey(String configKey)
AbstractAutoCreds
The key with which the credentials are stored in the credentials map
getCredentialKey
in class AbstractAutoCreds
public void populateCredentials(Map<String,String> credentials, Map topoConf)
INimbusCredentialPlugin
Method that will be called on nimbus as part of submit topology. This plugin will be called at least once during the submit Topology action. It will be not be called during activate instead the credentials return by this method will be merged with the other credentials in the topology and stored in zookeeper. NOTE: THIS METHOD WILL BE CALLED THROUGH REFLECTION. Existing compiled implementations will still work but new implementations will not compile. A NOOP implementation can be added to make it compile.
credentials
- credentials map where more credentials will be added.topoConf
- topology configurationpublic void renew(Map<String,String> credentials, Map topologyConf)
ICredentialsRenewer
Renew any credentials that need to be renewed. (Update the credentials if needed) NOTE: THIS WILL BE CALLED THROUGH REFLECTION. So if the newer renew exists it will be called instead, but if it does not exist this will be called. That means that this is binary compatible but not source compatible with older version. To make the compilation work this can become a noop when the new API is implemented.
credentials
- the credentials that may have something to renew.topologyConf
- topology configuration.Copyright © 2019 The Apache Software Foundation. All Rights Reserved.