public class ConfigurationService extends 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 String |
CONF_IGNORE_SYS_PROPS |
static String |
CONF_PREFIX |
static String |
CONF_VERIFY_AVAILABLE_PROPS |
static String |
DEFAULT_CONFIG_FILE |
static String |
OOZIE_CONFIG_DIR
System property that indicates the configuration directory.
|
static String |
OOZIE_CONFIG_FILE
System property that indicates the name of the site configuration file to load.
|
static String |
OOZIE_DATA_DIR
System property that indicates the data directory.
|
static 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 String |
get(org.apache.hadoop.conf.Configuration conf,
String name) |
static String |
get(String name) |
static boolean |
getBoolean(org.apache.hadoop.conf.Configuration conf,
String name) |
static boolean |
getBoolean(String name) |
static Class<?> |
getClass(org.apache.hadoop.conf.Configuration conf,
String name) |
static Class<?>[] |
getClasses(org.apache.hadoop.conf.Configuration conf,
String name) |
static Class<?>[] |
getClasses(String name) |
org.apache.hadoop.conf.Configuration |
getConf()
Return the services configuration.
|
String |
getConfigDir()
Return Oozie configuration directory.
|
static String |
getConfigurationDirectory() |
static float |
getFloat(String name) |
static int |
getInt(org.apache.hadoop.conf.Configuration conf,
String name) |
static int |
getInt(String name) |
Class<? extends Service> |
getInterface()
Return the public interface for configuration service.
|
static long |
getLong(org.apache.hadoop.conf.Configuration conf,
String name) |
static long |
getLong(String name) |
org.apache.hadoop.conf.Configuration |
getMaskedConfiguration()
Return a configuration with all sensitive values masked.
|
static String[] |
getStrings(org.apache.hadoop.conf.Configuration conf,
String name) |
static String[] |
getStrings(String name) |
void |
init(Services services)
Initialize the log service.
|
void |
instrument(Instrumentation instr)
Instruments the configuration service.
|
static void |
set(String name,
String value) |
static void |
setBoolean(String name,
boolean value) |
void |
verifyConfigurationName()
Verify the configuration is in oozie-default
|
public static final String CONF_PREFIX
public static final String CONF_IGNORE_SYS_PROPS
public static final String CONF_VERIFY_AVAILABLE_PROPS
public static final String OOZIE_CONFIG_DIR
public static final String OOZIE_DATA_DIR
public static final String OOZIE_CONFIG_FILE
public static final String DEFAULT_CONFIG_FILE
public static final String SITE_CONFIG_FILE
public ConfigurationService()
public void init(Services services) throws ServiceException
init
in interface Service
services
- services instance.ServiceException
- thrown if the log service could not be initialized.public static String getConfigurationDirectory() throws ServiceException
ServiceException
public void destroy()
public Class<? extends Service> getInterface()
getInterface
in interface Service
ConfigurationService
.public org.apache.hadoop.conf.Configuration getConf()
public String getConfigDir()
public void instrument(Instrumentation instr)
instrument
in interface Instrumentable
instr
- instrumentation to use.public org.apache.hadoop.conf.Configuration getMaskedConfiguration()
public void verifyConfigurationName()
public static void setBoolean(String name, boolean value)
public static String[] getStrings(String name)
public static String[] getStrings(org.apache.hadoop.conf.Configuration conf, String name)
public static boolean getBoolean(String name)
public static boolean getBoolean(org.apache.hadoop.conf.Configuration conf, String name)
public static Class<?>[] getClasses(String name)
public static Class<?>[] getClasses(org.apache.hadoop.conf.Configuration conf, String name)
Copyright © 2015 Apache Software Foundation. All Rights Reserved.