Package org.apache.accumulo.core.conf
Class HadoopCredentialProvider
- java.lang.Object
-
- org.apache.accumulo.core.conf.HadoopCredentialProvider
-
public class HadoopCredentialProvider extends Object
Shim around Hadoop's CredentialProviderFactory provided by hadoop-common.
-
-
Constructor Summary
Constructors Constructor Description HadoopCredentialProvider()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcreateEntry(org.apache.hadoop.conf.Configuration conf, String name, char[] credential)Create a CredentialEntry using the configured Providers.static List<String>getKeys(org.apache.hadoop.conf.Configuration conf)Attempt to extract all aliases from any configured CredentialProviders.static char[]getValue(org.apache.hadoop.conf.Configuration conf, String alias)Attempt to extract the password from any configured CredentialProviders for the given alias.static voidsetPath(org.apache.hadoop.conf.Configuration conf, String path)Set the Hadoop Credential Provider path in the provided Hadoop Configuration.
-
-
-
Method Detail
-
setPath
public static void setPath(org.apache.hadoop.conf.Configuration conf, String path)Set the Hadoop Credential Provider path in the provided Hadoop Configuration.- Parameters:
conf- the Hadoop Configuration objectpath- the credential provider paths to set
-
getValue
public static char[] getValue(org.apache.hadoop.conf.Configuration conf, String alias)Attempt to extract the password from any configured CredentialProviders for the given alias. If no providers or credential is found, null is returned.- Parameters:
conf- Configuration for CredentialProvideralias- Name of CredentialEntry key- Returns:
- The credential if found, null otherwise
-
getKeys
public static List<String> getKeys(org.apache.hadoop.conf.Configuration conf)
Attempt to extract all aliases from any configured CredentialProviders.- Parameters:
conf- Configuration for the CredentialProvider- Returns:
- A list of aliases. An empty list if no CredentialProviders are configured, or the providers are empty.
-
createEntry
public static void createEntry(org.apache.hadoop.conf.Configuration conf, String name, char[] credential) throws IOExceptionCreate a CredentialEntry using the configured Providers. If multiple CredentialProviders are configured, the first will be used.- Parameters:
conf- Configuration for the CredentialProvidername- CredentialEntry name (alias)credential- The credential- Throws:
IOException
-
-