public class ConfigurationService extends java.lang.Object implements Service, Instrumentable
OOZIE_HOME environment variable as
${OOZIE_HOME}/conf. If the OOZIE_HOME environment variable is not defined the
initialization of the ConfigurationService fails.
The site configuration is loaded from the oozie-site.xml file in the configuration directory.
The site configuration file name to use can be changed by setting the OOZIE_CONFIG_FILE environment
variable to an alternate file name. The alternate file must ber in the Oozie configuration directory.
Configuration properties, prefixed with 'oozie.', passed as system properties overrides default and site values.
The configuration service logs details on how the configuration was loaded as well as what properties were overrode
via system properties settings.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONF_IGNORE_SYS_PROPS |
static java.lang.String |
CONF_PREFIX |
static java.lang.String |
CONF_VERIFY_AVAILABLE_PROPS |
static java.lang.String |
DEFAULT_CONFIG_FILE |
static java.lang.String |
OOZIE_CONFIG_DIR
System property that indicates the configuration directory.
|
static java.lang.String |
OOZIE_CONFIG_FILE
System property that indicates the name of the site configuration file to load.
|
static java.lang.String |
OOZIE_DATA_DIR
System property that indicates the data directory.
|
static java.lang.String |
SITE_CONFIG_FILE |
DEFAULT_LOCK_TIMEOUT, lockTimeout| Constructor and Description |
|---|
ConfigurationService() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy the configuration service.
|
static java.lang.String |
get(org.apache.hadoop.conf.Configuration conf,
java.lang.String name) |
static java.lang.String |
get(java.lang.String name) |
static boolean |
getBoolean(org.apache.hadoop.conf.Configuration conf,
java.lang.String name) |
static boolean |
getBoolean(java.lang.String name) |
static boolean |
getBoolean(java.lang.String name,
boolean defaultValue) |
static java.lang.Class<?> |
getClass(org.apache.hadoop.conf.Configuration conf,
java.lang.String name) |
static java.lang.Class<?>[] |
getClasses(org.apache.hadoop.conf.Configuration conf,
java.lang.String name) |
static java.lang.Class<?>[] |
getClasses(java.lang.String name) |
org.apache.hadoop.conf.Configuration |
getConf()
Return the services configuration.
|
java.lang.String |
getConfigDir()
Return Oozie configuration directory.
|
static java.lang.String |
getConfigurationDirectory() |
static float |
getFloat(java.lang.String name) |
static int |
getInt(org.apache.hadoop.conf.Configuration conf,
java.lang.String name) |
static int |
getInt(java.lang.String name) |
static int |
getInt(java.lang.String name,
int defaultValue) |
java.lang.Class<? extends Service> |
getInterface()
Return the public interface for configuration service.
|
static long |
getLong(org.apache.hadoop.conf.Configuration conf,
java.lang.String name) |
static long |
getLong(java.lang.String name) |
org.apache.hadoop.conf.Configuration |
getMaskedConfiguration()
Return a configuration with all sensitive values masked.
|
static java.lang.String |
getPassword(org.apache.hadoop.conf.Configuration conf,
java.lang.String name) |
static java.lang.String |
getPassword(org.apache.hadoop.conf.Configuration conf,
java.lang.String name,
java.lang.String defaultValue) |
static java.lang.String |
getPassword(java.lang.String name,
java.lang.String defaultValue) |
static java.lang.String[] |
getStrings(org.apache.hadoop.conf.Configuration conf,
java.lang.String name) |
static java.lang.String[] |
getStrings(java.lang.String name) |
void |
init(Services services)
Initialize the log service.
|
void |
instrument(Instrumentation instr)
Instruments the configuration service.
|
static void |
set(java.lang.String name,
java.lang.String value) |
static void |
setBoolean(java.lang.String name,
boolean value) |
void |
verifyConfigurationName()
Verify the configuration is in oozie-default
|
public static final java.lang.String CONF_PREFIX
public static final java.lang.String CONF_IGNORE_SYS_PROPS
public static final java.lang.String CONF_VERIFY_AVAILABLE_PROPS
public static final java.lang.String OOZIE_CONFIG_DIR
public static final java.lang.String OOZIE_DATA_DIR
public static final java.lang.String OOZIE_CONFIG_FILE
public static final java.lang.String DEFAULT_CONFIG_FILE
public static final java.lang.String SITE_CONFIG_FILE
public ConfigurationService()
public void init(Services services) throws ServiceException
init in interface Serviceservices - services instance.ServiceException - thrown if the log service could not be initialized.public static java.lang.String getConfigurationDirectory() throws ServiceException
ServiceExceptionpublic void destroy()
public java.lang.Class<? extends Service> getInterface()
getInterface in interface ServiceConfigurationService.public org.apache.hadoop.conf.Configuration getConf()
public java.lang.String getConfigDir()
public void instrument(Instrumentation instr)
instrument in interface Instrumentableinstr - instrumentation to use.public org.apache.hadoop.conf.Configuration getMaskedConfiguration()
public void verifyConfigurationName()
public static void set(java.lang.String name, java.lang.String value)
public static void setBoolean(java.lang.String name, boolean value)
public static java.lang.String get(java.lang.String name)
public static java.lang.String get(org.apache.hadoop.conf.Configuration conf, java.lang.String name)
public static java.lang.String[] getStrings(java.lang.String name)
public static java.lang.String[] getStrings(org.apache.hadoop.conf.Configuration conf, java.lang.String name)
public static boolean getBoolean(java.lang.String name)
public static boolean getBoolean(org.apache.hadoop.conf.Configuration conf, java.lang.String name)
public static boolean getBoolean(java.lang.String name, boolean defaultValue)
public static int getInt(java.lang.String name)
public static int getInt(java.lang.String name, int defaultValue)
public static int getInt(org.apache.hadoop.conf.Configuration conf, java.lang.String name)
public static float getFloat(java.lang.String name)
public static long getLong(java.lang.String name)
public static long getLong(org.apache.hadoop.conf.Configuration conf, java.lang.String name)
public static java.lang.Class<?>[] getClasses(java.lang.String name)
public static java.lang.Class<?>[] getClasses(org.apache.hadoop.conf.Configuration conf, java.lang.String name)
public static java.lang.Class<?> getClass(org.apache.hadoop.conf.Configuration conf, java.lang.String name)
public static java.lang.String getPassword(org.apache.hadoop.conf.Configuration conf, java.lang.String name)
public static java.lang.String getPassword(org.apache.hadoop.conf.Configuration conf, java.lang.String name, java.lang.String defaultValue)
public static java.lang.String getPassword(java.lang.String name, java.lang.String defaultValue)
Copyright © 2018 Apache Software Foundation. All Rights Reserved.