Search in sources :

Example 1 with InvalidSettingException

use of jetbrains.exodus.InvalidSettingException in project pwm by pwm-project.

the class XodusLocalDB method makeEnvironmentConfig.

private EnvironmentConfig makeEnvironmentConfig(final Map<String, String> initParameters) {
    final EnvironmentConfig environmentConfig = new EnvironmentConfig();
    environmentConfig.setEnvCloseForcedly(true);
    environmentConfig.setMemoryUsage(50 * 1024 * 1024);
    environmentConfig.setEnvGatherStatistics(true);
    for (final Map.Entry<String, String> entry : initParameters.entrySet()) {
        final String key = entry.getKey();
        final String value = entry.getValue();
        final Map<String, String> singleMap = Collections.singletonMap(key, value);
        try {
            environmentConfig.setSettings(singleMap);
            LOGGER.trace("set env setting from appProperty: " + key + "=" + value);
        } catch (InvalidSettingException e) {
            LOGGER.warn("problem setting configured env settings: " + e.getMessage());
        }
    }
    return environmentConfig;
}
Also used : EnvironmentConfig(jetbrains.exodus.env.EnvironmentConfig) InvalidSettingException(jetbrains.exodus.InvalidSettingException) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Aggregations

HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 InvalidSettingException (jetbrains.exodus.InvalidSettingException)1 EnvironmentConfig (jetbrains.exodus.env.EnvironmentConfig)1