public class ConfiguratorBase extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ConfiguratorBase.ConnectorInfo
Configuration keys for
Instance.getConnector(String, AuthenticationToken). |
protected static class |
ConfiguratorBase.GeneralOpts
Configuration keys for general configuration options.
|
protected static class |
ConfiguratorBase.InstanceOpts
|
| Constructor and Description |
|---|
ConfiguratorBase() |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
enumToConfKey(Class<?> implementingClass,
Enum<?> e)
Provides a configuration key for a given feature enum, prefixed by the implementingClass
|
static Instance |
getInstance(Class<?> implementingClass,
org.apache.hadoop.conf.Configuration conf)
Initializes an Accumulo
Instance based on the configuration. |
static org.apache.log4j.Level |
getLogLevel(Class<?> implementingClass,
org.apache.hadoop.conf.Configuration conf)
Gets the log level from this configuration.
|
static String |
getPrincipal(Class<?> implementingClass,
org.apache.hadoop.conf.Configuration conf)
Gets the user name from the configuration.
|
static byte[] |
getToken(Class<?> implementingClass,
org.apache.hadoop.conf.Configuration conf)
Gets the password from the configuration.
|
static String |
getTokenClass(Class<?> implementingClass,
org.apache.hadoop.conf.Configuration conf)
Gets the serialized token class from the configuration.
|
static Boolean |
isConnectorInfoSet(Class<?> implementingClass,
org.apache.hadoop.conf.Configuration conf)
Determines if the connector info has already been set for this instance.
|
static void |
setConnectorInfo(Class<?> implementingClass,
org.apache.hadoop.conf.Configuration conf,
String principal,
AuthenticationToken token)
Sets the connector information needed to communicate with Accumulo in this job.
|
static void |
setLogLevel(Class<?> implementingClass,
org.apache.hadoop.conf.Configuration conf,
org.apache.log4j.Level level)
Sets the log level for this job.
|
static void |
setMockInstance(Class<?> implementingClass,
org.apache.hadoop.conf.Configuration conf,
String instanceName)
Configures a
MockInstance for this job. |
static void |
setZooKeeperInstance(Class<?> implementingClass,
org.apache.hadoop.conf.Configuration conf,
String instanceName,
String zooKeepers)
Configures a
ZooKeeperInstance for this job. |
protected static String enumToConfKey(Class<?> implementingClass, Enum<?> e)
implementingClass - the class whose name will be used as a prefix for the property configuration keye - the enum used to provide the unique part of the configuration keypublic static void setConnectorInfo(Class<?> implementingClass, org.apache.hadoop.conf.Configuration conf, String principal, AuthenticationToken token) throws AccumuloSecurityException
WARNING: The serialized token is stored in the configuration and shared with all MapReduce tasks. It is BASE64 encoded to provide a charset safe conversion to a string, and is not intended to be secure.
implementingClass - the class whose name will be used as a prefix for the property configuration keyconf - the Hadoop configuration object to configureprincipal - a valid Accumulo user nametoken - the user's passwordAccumuloSecurityExceptionpublic static Boolean isConnectorInfoSet(Class<?> implementingClass, org.apache.hadoop.conf.Configuration conf)
implementingClass - the class whose name will be used as a prefix for the property configuration keyconf - the Hadoop configuration object to configuresetConnectorInfo(Class, Configuration, String, AuthenticationToken)public static String getPrincipal(Class<?> implementingClass, org.apache.hadoop.conf.Configuration conf)
implementingClass - the class whose name will be used as a prefix for the property configuration keyconf - the Hadoop configuration object to configuresetConnectorInfo(Class, Configuration, String, AuthenticationToken)public static String getTokenClass(Class<?> implementingClass, org.apache.hadoop.conf.Configuration conf)
implementingClass - the class whose name will be used as a prefix for the property configuration keyconf - the Hadoop configuration object to configuresetConnectorInfo(Class, Configuration, String, AuthenticationToken)public static byte[] getToken(Class<?> implementingClass, org.apache.hadoop.conf.Configuration conf)
implementingClass - the class whose name will be used as a prefix for the property configuration keyconf - the Hadoop configuration object to configuresetConnectorInfo(Class, Configuration, String, AuthenticationToken)public static void setZooKeeperInstance(Class<?> implementingClass, org.apache.hadoop.conf.Configuration conf, String instanceName, String zooKeepers)
ZooKeeperInstance for this job.implementingClass - the class whose name will be used as a prefix for the property configuration keyconf - the Hadoop configuration object to configureinstanceName - the Accumulo instance namezooKeepers - a comma-separated list of zookeeper serverspublic static void setMockInstance(Class<?> implementingClass, org.apache.hadoop.conf.Configuration conf, String instanceName)
MockInstance for this job.implementingClass - the class whose name will be used as a prefix for the property configuration keyconf - the Hadoop configuration object to configureinstanceName - the Accumulo instance namepublic static Instance getInstance(Class<?> implementingClass, org.apache.hadoop.conf.Configuration conf)
Instance based on the configuration.implementingClass - the class whose name will be used as a prefix for the property configuration keyconf - the Hadoop configuration object to configuresetZooKeeperInstance(Class, Configuration, String, String),
setMockInstance(Class, Configuration, String)public static void setLogLevel(Class<?> implementingClass, org.apache.hadoop.conf.Configuration conf, org.apache.log4j.Level level)
implementingClass - the class whose name will be used as a prefix for the property configuration keyconf - the Hadoop configuration object to configurelevel - the logging levelpublic static org.apache.log4j.Level getLogLevel(Class<?> implementingClass, org.apache.hadoop.conf.Configuration conf)
implementingClass - the class whose name will be used as a prefix for the property configuration keyconf - the Hadoop configuration object to configuresetLogLevel(Class, Configuration, Level)Copyright © 2011-2016 The Apache Software Foundation. All Rights Reserved.