use of com.hazelcast.internal.config.YamlMemberDomConfigProcessor in project hazelcast by hazelcast.
the class YamlConfigBuilder method parseAndBuildConfig.
private void parseAndBuildConfig(Config config) throws Exception {
YamlMapping yamlRootNode;
try {
yamlRootNode = ((YamlMapping) YamlLoader.load(in));
} catch (Exception ex) {
throw new InvalidConfigurationException("Invalid YAML configuration", ex);
}
YamlNode imdgRoot = yamlRootNode.childAsMapping(ConfigSections.HAZELCAST.getName());
if (imdgRoot == null) {
imdgRoot = yamlRootNode;
}
YamlDomChecker.check(imdgRoot);
Node w3cRootNode = asW3cNode(imdgRoot);
replaceVariables(w3cRootNode);
importDocuments(imdgRoot);
if (shouldValidateTheSchema()) {
new YamlConfigSchemaValidator().validate((YamlMapping) imdgRoot.parent());
}
new YamlMemberDomConfigProcessor(true, config).buildConfig(w3cRootNode);
}
use of com.hazelcast.internal.config.YamlMemberDomConfigProcessor in project hazelcast by hazelcast.
the class ConfigNodeStateTrackerTest method shouldDetectUnappliedMemberConfigEntries.
@Test
public void shouldDetectUnappliedMemberConfigEntries() throws Exception {
Map<String, String> entries = new HashMap<>();
entries.put("HZ_CLUSTERNAME", "foo");
entries.put("HZ_CLUSTRNAME", "foo");
entries.put("HZ_NETWORK_PORT", "5702");
entries.put("HZ_NETWORK_JOIN_TCPIP_BLE", "false");
entries.put("HZ_NETWORK_JOIN_MULTCAST_ENABLED", "false");
ConfigNode configNode = PropertiesToNodeConverter.propsToNode(EnvVariablesConfigParser.member().parse(entries));
new YamlMemberDomConfigProcessor(true, new Config(), false).buildConfig(new ConfigOverrideElementAdapter(configNode));
Map<String, String> unprocessed = new ConfigNodeStateTracker().unprocessedNodes(configNode);
assertTrue(unprocessed.containsKey("hazelcast.network.port"));
assertTrue(unprocessed.containsKey("hazelcast.clustrname"));
assertTrue(unprocessed.containsKey("hazelcast.network.join.tcpip.ble"));
assertTrue(unprocessed.containsKey("hazelcast.network.join.multcast.enabled"));
}
Aggregations