public class AutoHBase extends AbstractAutoCreds
Automatically get hbase delegation tokens and push it to user’s topology. The class assumes that hadoop/hbase configuration files are in your class path.
Modifier and Type | Field and Description |
---|---|
static String |
HBASE_CREDENTIALS |
static String |
HBASE_KEYTAB_FILE_KEY |
static String |
HBASE_PRINCIPAL_KEY |
String |
hbaseKeytab |
String |
hbasePrincipal |
CONFIG_KEY_RESOURCES
Constructor and Description |
---|
AutoHBase() |
Modifier and Type | Method and Description |
---|---|
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 hbaseConf,
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 HBASE_CREDENTIALS
public static final String HBASE_KEYTAB_FILE_KEY
public static final String HBASE_PRINCIPAL_KEY
public String hbaseKeytab
public String hbasePrincipal
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
protected byte[] getHadoopCredentials(Map<String,Object> conf, org.apache.hadoop.conf.Configuration hbaseConf, 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 © 2022 The Apache Software Foundation. All Rights Reserved.