use of com.hazelcast.simulator.coordinator.ConfigFileTemplate in project hazelcast-simulator by hazelcast.
the class HazelcastDriver method initMemberHzConfig.
public String initMemberHzConfig(boolean liteMember) {
String config = loadMemberConfig();
ConfigFileTemplate template = new ConfigFileTemplate(config);
String licenseKey = get("LICENCE_KEY");
template.addEnvironment("licenseKey", licenseKey);
template.addEnvironment(properties);
// template.withAgents(componentRegistry);
template.addReplacement("<!--MEMBERS-->", createAddressConfig("member", agents, get("HAZELCAST_PORT")));
if (licenseKey != null) {
template.addReplacement("<!--LICENSE-KEY-->", format("<license-key>%s</license-key>", licenseKey));
}
String manCenterURL = get("MANAGEMENT_CENTER_URL");
if (!"none".equals(manCenterURL) && (manCenterURL.startsWith("http://") || manCenterURL.startsWith("https://"))) {
String updateInterval = get("MANAGEMENT_CENTER_UPDATE_INTERVAL");
String updateIntervalAttr = (updateInterval.isEmpty()) ? "" : " update-interval=\"" + updateInterval + '"';
template.addReplacement("<!--MANAGEMENT_CENTER_CONFIG-->", format("<management-center enabled=\"true\"%s>%n %s%n" + " </management-center>%n", updateIntervalAttr, manCenterURL));
}
if (liteMember) {
template.addReplacement("<!--LITE_MEMBER_CONFIG-->", "<lite-member enabled=\"true\"/>");
}
return template.render();
}
use of com.hazelcast.simulator.coordinator.ConfigFileTemplate in project hazelcast-simulator by hazelcast.
the class JetDriver method initClientHzConfig.
public String initClientHzConfig() {
String config = loadClientConfig();
ConfigFileTemplate template = new ConfigFileTemplate(config);
// template.withAgents(componentRegistry);
String licenseKey = get("LICENCE_KEY");
template.addEnvironment("licenseKey", licenseKey);
template.addEnvironment(properties);
template.addReplacement("<!--MEMBERS-->", createAddressConfig("address", agents, get("HAZELCAST_PORT")));
if (licenseKey != null) {
template.addReplacement("<!--LICENSE-KEY-->", format("<license-key>%s</license-key>", licenseKey));
}
return template.render();
}
use of com.hazelcast.simulator.coordinator.ConfigFileTemplate in project hazelcast-simulator by hazelcast.
the class JetDriver method initMemberHzConfig.
public String initMemberHzConfig(boolean liteMember) {
String config = loadMemberConfig();
ConfigFileTemplate template = new ConfigFileTemplate(config);
String licenseKey = get("LICENCE_KEY");
template.addEnvironment("licenseKey", licenseKey);
template.addEnvironment(properties);
// template.withAgents(componentRegistry);
template.addReplacement("<!--MEMBERS-->", createAddressConfig("member", agents, get("HAZELCAST_PORT")));
if (licenseKey != null) {
template.addReplacement("<!--LICENSE-KEY-->", format("<license-key>%s</license-key>", licenseKey));
}
String manCenterURL = get("MANAGEMENT_CENTER_URL");
if (!"none".equals(manCenterURL) && (manCenterURL.startsWith("http://") || manCenterURL.startsWith("https://"))) {
String updateInterval = get("MANAGEMENT_CENTER_UPDATE_INTERVAL");
String updateIntervalAttr = (updateInterval.isEmpty()) ? "" : " update-interval=\"" + updateInterval + '"';
template.addReplacement("<!--MANAGEMENT_CENTER_CONFIG-->", format("<management-center enabled=\"true\"%s>%n %s%n" + " </management-center>%n", updateIntervalAttr, manCenterURL));
}
if (liteMember) {
template.addReplacement("<!--LITE_MEMBER_CONFIG-->", "<lite-member enabled=\"true\"/>");
}
return template.render();
}
use of com.hazelcast.simulator.coordinator.ConfigFileTemplate in project hazelcast-simulator by hazelcast.
the class IgniteDriver method loadServerOrNativeClientConfig.
private String loadServerOrNativeClientConfig(boolean client) {
String config = loadConfiguration("Ignite configuration", "ignite.xml");
ConfigFileTemplate template = new ConfigFileTemplate(config).withAgents(agents);
StringBuilder addresses = new StringBuilder();
for (AgentData agent : agents) {
addresses.append("<value>").append(agent.getPrivateAddress()).append("</value>");
}
template.addReplacement("<!--ADDRESSES-->", addresses.toString());
template.addReplacement("<!--CLIENT_MODE-->", client);
return template.render();
}
use of com.hazelcast.simulator.coordinator.ConfigFileTemplate in project hazelcast-simulator by hazelcast.
the class HazelcastDriver method initClientHzConfig.
public String initClientHzConfig() {
String config = loadClientConfig();
ConfigFileTemplate template = new ConfigFileTemplate(config);
// template.withAgents(componentRegistry);
String licenseKey = get("LICENCE_KEY");
template.addEnvironment("licenseKey", licenseKey);
template.addEnvironment(properties);
template.addReplacement("<!--MEMBERS-->", createAddressConfig("address", agents, get("HAZELCAST_PORT")));
if (licenseKey != null) {
template.addReplacement("<!--LICENSE-KEY-->", format("<license-key>%s</license-key>", licenseKey));
}
return template.render();
}
Aggregations