public class DbConfigManager extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Properties |
props |
| Constructor and Description |
|---|
DbConfigManager(EnvironmentConfig config) |
| Modifier and Type | Method and Description |
|---|---|
static void |
applyFileConfig(File envHome,
Properties props,
boolean forReplication)
Apply the configurations specified in the je.properties file to override
the programmatically set configuration values held in the property bag.
|
String |
get(ConfigParam configParam)
Get this parameter from the environment wide configuration settings.
|
String |
get(String configParamName)
Get this parameter from the environment wide configuration settings.
|
boolean |
getBoolean(BooleanConfigParam configParam)
Get this parameter from the environment wide configuration settings.
|
static boolean |
getBooleanVal(Properties props,
BooleanConfigParam param)
Helper method for getting boolean values.
|
static String |
getConfigParam(Properties props,
String paramName)
Helper method for environment and replication configuration classes.
|
int |
getDuration(DurationConfigParam configParam)
Get this parameter from the environment wide configuration settings.
|
long |
getDurationNS(DurationConfigParam configParam)
Get this parameter from the environment wide configuration settings.
|
static long |
getDurationVal(Properties props,
DurationConfigParam param,
TimeUnit unit)
Helper method for getting duration values.
|
EnvironmentConfig |
getEnvironmentConfig() |
int |
getInt(IntConfigParam configParam)
Get this parameter from the environment wide configuration settings.
|
static int |
getIntVal(Properties props,
IntConfigParam param)
Helper method for getting integer values.
|
String |
getLoggingDir(String defaultDir)
Get the directory where trace files (je.info) are written.
|
long |
getLong(LongConfigParam configParam)
Get this parameter from the environment wide configuration settings.
|
static long |
getLongVal(Properties props,
LongConfigParam param)
Helper method for getting long values.
|
String |
getPrefixedFileName(String fileName)
JE trace files (je.info) and statistics files
(je.stat.csv and je.config.csv) may or may not get prefixed depending
upon the value of
EnvironmentConfig.FILE_LOGGING_PREFIX.This method is used to get the prefixed file name for a given file name if a prefix was set, else it returns the given file name. |
short |
getShort(ShortConfigParam configParam)
Get this parameter from the environment wide configuration settings.
|
String |
getStatsDir(String defaultDir)
Get the directory where statistics files
(je.stat.csv and je.config.csv) are written.
|
static String |
getVal(Properties props,
ConfigParam param)
Helper method for environment and replication configuration classes.
|
static String |
getVal(Properties props,
ConfigParam param,
String paramName)
Helper method for environment and replication configuration classes.
|
boolean |
isSpecified(ConfigParam configParam)
Returns whether this parameter is specified by the user's configuration.
|
static void |
setBooleanVal(Properties props,
BooleanConfigParam param,
boolean val,
boolean validateValue)
Helper method for setting boolean values.
|
static void |
setConfigParam(Properties props,
String paramName,
String value,
boolean requireMutability,
boolean validateValue,
boolean forReplication,
boolean verifyForReplication)
Helper method for environment and replication configuration classes.
|
static void |
setDurationVal(Properties props,
DurationConfigParam param,
long val,
TimeUnit unit,
boolean validateValue)
Helper method for setting duration values.
|
static void |
setIntVal(Properties props,
IntConfigParam param,
int val,
boolean validateValue)
Helper method for setting integer values.
|
static void |
setVal(Properties props,
ConfigParam param,
String val,
boolean validateValue)
Helper method for environment and replication configuration classes.
|
static void |
setVal(Properties props,
ConfigParam param,
String paramName,
String val,
boolean validateValue)
Helper method for environment and replication configuration classes.
|
static void |
validateProperties(Properties props,
boolean isRepConfigInstance,
String configClassName)
Validate a collection of configurations, checking that
- the name and value are valid
- a replication param is not being set through an EnvironmentConfig
class, and a non-rep param is not set through a ReplicationConfig
instance.
|
protected Properties props
public DbConfigManager(EnvironmentConfig config)
public EnvironmentConfig getEnvironmentConfig()
public boolean isSpecified(ConfigParam configParam)
public String get(ConfigParam configParam)
public String get(String configParamName)
public boolean getBoolean(BooleanConfigParam configParam)
public short getShort(ShortConfigParam configParam)
public int getInt(IntConfigParam configParam)
public long getLong(LongConfigParam configParam)
public int getDuration(DurationConfigParam configParam)
public long getDurationNS(DurationConfigParam configParam)
public String getLoggingDir(String defaultDir)
defaultDir - Default directory for trace files (je.info).
That is, the directory where trace files(je.info) are written if the
EnvironmentConfig.FILE_LOGGING_DIRECTORY is not set.public String getStatsDir(String defaultDir)
defaultDir - Default directory for statistics files.EnvironmentConfig.FILE_LOGGING_DIRECTORYEnvironmentConfig.STATS_FILE_DIRECTORY is set.public String getPrefixedFileName(String fileName)
EnvironmentConfig.FILE_LOGGING_PREFIX.fileName - - Given file name to be prefixed.public static void validateProperties(Properties props, boolean isRepConfigInstance, String configClassName) throws IllegalArgumentException
IllegalArgumentException - via XxxConfig(Properties) ctor.public static void applyFileConfig(File envHome, Properties props, boolean forReplication) throws IllegalArgumentException
IllegalArgumentException - via XxxConfig(Properties) ctor.public static void setConfigParam(Properties props, String paramName, String value, boolean requireMutability, boolean validateValue, boolean forReplication, boolean verifyForReplication) throws IllegalArgumentException
props - Property bag held within the configuration object.IllegalArgumentException - via XxxConfig.setXxx methods and
XxxConfig(Properties) ctor.public static String getConfigParam(Properties props, String paramName) throws IllegalArgumentException
props - Property bag held within the configuration object.IllegalArgumentException - via XxxConfig.getConfigParam.public static String getVal(Properties props, ConfigParam param)
public static String getVal(Properties props, ConfigParam param, String paramName)
public static void setVal(Properties props, ConfigParam param, String val, boolean validateValue) throws IllegalArgumentException
IllegalArgumentExceptionpublic static void setVal(Properties props, ConfigParam param, String paramName, String val, boolean validateValue) throws IllegalArgumentException
IllegalArgumentExceptionpublic static int getIntVal(Properties props, IntConfigParam param)
public static void setIntVal(Properties props, IntConfigParam param, int val, boolean validateValue)
public static long getLongVal(Properties props, LongConfigParam param)
public static boolean getBooleanVal(Properties props, BooleanConfigParam param)
public static void setBooleanVal(Properties props, BooleanConfigParam param, boolean val, boolean validateValue)
public static long getDurationVal(Properties props, DurationConfigParam param, TimeUnit unit)
public static void setDurationVal(Properties props, DurationConfigParam param, long val, TimeUnit unit, boolean validateValue)
Copyright © 2024. All rights reserved.