use of com.hazelcast.simulator.common.SimulatorProperties in project hazelcast-simulator by hazelcast.
the class WizardCli method run.
public void run() {
if (options.has(installSpec)) {
String homeDir = getUserHomePath();
wizard.install(getSimulatorPath(), getProfileFile(homeDir));
} else if (options.has(createWorkDirSpec)) {
SimulatorProperties simulatorProperties = getSimulatorProperties(false);
wizard.createWorkDir(simulatorProperties, createWorkDirSpec.value(options), cloudProvider.value(options));
} else if (options.has(listCloudProvidersSpec)) {
wizard.listCloudProviders();
} else if (options.has(createSshCopyIdScriptSpec)) {
wizard.createSshCopyIdScript(getSimulatorProperties());
} else if (options.has(sshConnectionCheckSpec)) {
SimulatorProperties simulatorProperties = getSimulatorProperties();
wizard.sshConnectionCheck(simulatorProperties, newBash(simulatorProperties));
} else if (options.has(compareSimulatorPropertiesSpec)) {
wizard.compareSimulatorProperties();
} else {
printHelpAndExit(parser);
}
}
use of com.hazelcast.simulator.common.SimulatorProperties in project hazelcast-simulator by hazelcast.
the class SimulatorUtils method loadSimulatorProperties.
public static SimulatorProperties loadSimulatorProperties() {
SimulatorProperties simulatorProperties = new SimulatorProperties();
File file = new File(FileUtils.getUserDir(), "simulator.properties");
if (file.exists()) {
simulatorProperties.init(file);
}
return simulatorProperties;
}
use of com.hazelcast.simulator.common.SimulatorProperties in project hazelcast-simulator by hazelcast.
the class CoordinatorTest method beforeClass.
@BeforeClass
public static void beforeClass() throws Exception {
setupFakeEnvironment();
hzConfig = FileUtils.fileAsText(new File(localResourceDirectory(), "hazelcast.xml"));
hzClientConfig = FileUtils.fileAsText(new File(localResourceDirectory(), "client-hazelcast.xml"));
File simulatorPropertiesFile = new File(getUserDir(), "simulator.properties");
appendText("CLOUD_PROVIDER=embedded\n", simulatorPropertiesFile);
SimulatorProperties simulatorProperties = loadSimulatorProperties();
CoordinatorParameters coordinatorParameters = new CoordinatorParameters().setSimulatorProperties(simulatorProperties).setSkipShutdownHook(true);
agent = new Agent(1, "127.0.0.1", simulatorProperties.getAgentPort(), 60, null);
agent.start();
registry = new Registry();
agentData = registry.addAgent(localIp(), localIp());
coordinator = new Coordinator(registry, coordinatorParameters);
coordinator.start();
}
use of com.hazelcast.simulator.common.SimulatorProperties in project hazelcast-simulator by hazelcast.
the class HazelcastDriverTest method before.
@Before
public void before() {
simulatorProperties = new SimulatorProperties();
agent = new AgentData(1, SimulatorUtils.localIp(), SimulatorUtils.localIp());
}
use of com.hazelcast.simulator.common.SimulatorProperties in project hazelcast-simulator by hazelcast.
the class Wizard method compareSimulatorProperties.
void compareSimulatorProperties() {
SimulatorProperties defaultProperties = new SimulatorProperties();
String defaultPropertiesString = defaultProperties.getDefaultsAsString();
Properties userProperties = WizardUtils.getUserProperties();
int size = userProperties.size();
if (size == 0) {
echo(format("Found no %s file or file was empty!", SimulatorProperties.PROPERTIES_FILE_NAME));
return;
}
echo("Defined user properties:");
int unknownProperties = 0;
int changedProperties = 0;
for (String property : new TreeSet<String>(userProperties.stringPropertyNames())) {
boolean commentedOutProperty = containsCommentedOutProperty(defaultPropertiesString, property);
String userValue = userProperties.getProperty(property);
String defaultValue = (commentedOutProperty ? getCommentedOutProperty(defaultPropertiesString, property) : defaultProperties.get(property));
if (!defaultProperties.containsKey(property) && !commentedOutProperty) {
echo("%s = %s [unknown property]", property, userValue);
unknownProperties++;
} else if (!userValue.equals(defaultValue)) {
echo("%s = %s [default: %s]", property, userValue, defaultValue);
changedProperties++;
} else {
echo("%s = %s", property, userValue);
}
}
logResults(size, unknownProperties, changedProperties);
}
Aggregations