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, updateSubjectpublic 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)
AbstractAutoCredsPrepare the plugin
doPrepare in class AbstractAutoCredsconf - the storm cluster conf set via storm.yamlprotected String getConfigKeyString()
AbstractAutoCredsThe lookup key for the config key string
getConfigKeyString in class AbstractAutoCredspublic void shutdown()
protected byte[] getHadoopCredentials(Map<String,Object> conf, String configKey, String topologyOwnerPrincipal)
getHadoopCredentials in class AbstractAutoCredsprotected byte[] getHadoopCredentials(Map<String,Object> conf, String topologyOwnerPrincipal)
getHadoopCredentials in class AbstractAutoCredspublic org.apache.hadoop.hive.conf.HiveConf createHiveConf(String metaStoreURI, String hiveMetaStorePrincipal) throws IOException
IOExceptionprotected 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 AbstractAutoCredsprotected String getCredentialKey(String configKey)
AbstractAutoCredsThe key with which the credentials are stored in the credentials map
getCredentialKey in class AbstractAutoCredspublic void populateCredentials(Map<String,String> credentials, Map topoConf)
INimbusCredentialPluginMethod 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)
ICredentialsRenewerRenew 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.