Removed override from env for now
package com.orientechnologies.orient.server.distributed.config;
-import com.orientechnologies.common.parser.OSystemVariableResolver;
import com.orientechnologies.orient.core.config.OContextConfiguration;
import com.orientechnologies.orient.core.db.OrientDBConfig;
import com.orientechnologies.orient.core.db.OrientDBConfigBuilder;
import com.orientechnologies.orient.core.db.config.OMulticastConfguration;
-import com.orientechnologies.orient.core.db.config.OMulticastConfigurationBuilder;
import com.orientechnologies.orient.core.db.config.ONodeConfigurationBuilder;
import com.orientechnologies.orient.core.exception.OConfigurationException;
import com.orientechnologies.orient.server.config.distributed.OServerDistributedConfiguration;
import com.orientechnologies.orient.server.config.distributed.OServerDistributedNetworkMulticastConfiguration;
-import java.util.*;
-import java.util.function.BiConsumer;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-
public class ODistributedConfig {
- static Map<String, BiConsumer<String, OServerDistributedConfiguration>> configurators = new HashMap<>();
-
- static {
- configurators.put("ORIENTDB_DISTRIBUTED_ENABLED", (value, config) -> config.enabled = Boolean.parseBoolean(value));
- configurators.put("ORIENTDB_DISTRIBUTED_NODE_NAME", (value, config) -> config.nodeName = value);
- configurators.put("ORIENTDB_DISTRIBUTED_QUORUM", (value, config) -> config.quorum = Integer.parseInt(value));
- configurators.put("ORIENTDB_DISTRIBUTED_GROUP_NAME", (value, config) -> config.group.name = value);
- configurators.put("ORIENTDB_DISTRIBUTED_GROUP_PASSWORD", (value, config) -> config.group.password = value);
- configurators.put("ORIENTDB_DISTRIBUTED_NETWORK_MULTICAST_ENABLED",
- (value, config) -> config.network.multicast.enabled = Boolean.parseBoolean(value));
- configurators.put("ORIENTDB_DISTRIBUTED_NETWORK_MULTICAST_IP", (value, config) -> config.network.multicast.ip = value);
- configurators.put("ORIENTDB_DISTRIBUTED_NETWORK_MULTICAST_PORT",
- (value, config) -> config.network.multicast.port = Integer.parseInt(value));
- configurators.put("ORIENTDB_DISTRIBUTED_NETWORK_MULTICAST_DISCOVERY_PORTS",
- (value, config) -> config.network.multicast.discoveryPorts = Arrays.stream(value.split(",")).map(Integer::parseInt)
- .mapToInt(i -> i).toArray());
-
- }
public static OServerDistributedConfiguration fromEnv(OServerDistributedConfiguration distributed)
throws OConfigurationException {
@@ -48,16 +23,6 @@ public class ODistributedConfig {
config = distributed;
}
- configurators.entrySet().stream().forEach((entry) -> {
-
- String env = System.getenv(entry.getKey());
-
- if (env != null) {
- entry.getValue().accept(env, config);
- }
-
- });
-
validateConfiguration(config);
return config;
