public class AutoHDFS extends AbstractAutoCreds
Automatically get HDFS delegation tokens and push it to user’s topology. The class assumes that HDFS configuration files are in your class path.
Modifier and Type | Field and Description |
---|---|
static String |
HDFS_CREDENTIALS |
static String |
TOPOLOGY_HDFS_URI |
CONFIG_KEY_RESOURCES
Constructor and Description |
---|
AutoHDFS() |
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,
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 HDFS_CREDENTIALS
public static final String TOPOLOGY_HDFS_URI
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 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.