}
}
// Initialize HStoreConf
assert(hstore_conf_path != null) : "Missing HStoreConf file";
HStoreConf hstore_conf = HStoreConf.init(hstore_conf_path, vargs);
if (trace.val)
LOG.trace("HStore Conf '" + hstore_conf_path.getAbsolutePath() + "'\n" + hstore_conf.toString(true));
if (hstore_conf.client.duration < 1000) {
LOG.error("Duration is specified in milliseconds");
System.exit(-1);
}
else if (hstore_conf.client.threads_per_host <= 0) {
LOG.error("Invalid number of threads per host '" + hstore_conf.client.threads_per_host + "'");
System.exit(-1);
}
// The number of client hosts to place client processes on
int clientCount = hstore_conf.client.count;
// Comma or colon separated list of the hostnames to be used for benchmark clients
for (String host : hstore_conf.client.hosts.split("[,;]")) {
clientHosts.add(host);
} // FOR
if (clientHosts.isEmpty())
clientHosts.add(hstore_conf.global.defaulthost);
// If no hosts were given, then use the defaults
if (siteHosts.size() == 0)
siteHosts.add(hstore_conf.global.defaulthost);
if (compileOnly == false && clientHosts.size() < clientCount) {
LogKeys logkey = LogKeys.benchmark_BenchmarkController_NotEnoughClients;
LOG.l7dlog( Level.FATAL, logkey.name(),
new Object[] { clientHosts.size(), clientCount }, null);
System.exit(-1);
}
String[] hostNames = null;
if (! (useCatalogHosts || compileOnly) ) {
if (siteHosts.size() < hostCount) {
LogKeys logkey = LogKeys.benchmark_BenchmarkController_NotEnoughHosts;
LOG.l7dlog( Level.FATAL, logkey.name(),
new Object[] { siteHosts.size(), hostCount }, null);
LOG.fatal("Don't have enough hosts(" + siteHosts.size()
+ ") for host count " + hostCount);
System.exit(-1);
}
// copy the lists of hostnames into array of the right lengths
// (this truncates the list to the right number)
hostNames = new String[hostCount];
for (int i = 0; i < hostCount; i++)
hostNames[i] = siteHosts.get(i);
} else {
hostNames = new String[0];
}
String[] clientNames = new String[clientCount];
if (compileOnly == false) {
for (int i = 0; i < clientCount; i++)
clientNames[i] = clientHosts.get(i);
}
// create a config object, mostly for the results uploader at this point
BenchmarkConfig config = new BenchmarkConfig(
hstore_conf,
hstore_conf_path,
benchmark_conf_path,
projectBuilderClassname,
backend,
hostNames,
sitesPerHost,
k_factor,
clientNames,
sshOptions,
remotePath,
remoteUser,
listenForDebugger,
serverHeapSize,
clientHeapSize,
clientInitialPollingDelay,
localmode,
checkTransaction,
checkTables,
snapshotPath,
snapshotPrefix,
snapshotFrequency,
snapshotRetain,
statsDatabaseURL,
statsDatabaseUser,
statsDatabasePass,
statsDatabaseJDBC,
statsPollInterval,
statsTag,
applicationName,
subApplicationName,
compileBenchmark,
compileOnly,
useCatalogHosts,
noSites,
noLoader,
noUploading,
noExecute,
noShutdown,
killOnZeroResults,
workloadTrace,
profileSiteIds,
partitionPlanPath,
markov_path,
markov_thresholdsPath,
markov_thresholdsValue,
markov_recomputeAfterEnd,
markov_recomputeAfterWarmup,
evictable,
batchEvictable,
deferrable,
dumpDatabase,
dumpDatabaseDir
);
// Always pass these parameters
if (catalogPath != null) {
clientParams.put("CATALOG", catalogPath.getAbsolutePath());
clientParams.put("NUMPARTITIONS", Integer.toString(num_partitions));
}
int total_num_clients = clientCount * hstore_conf.client.threads_per_host;
if (hstore_conf.client.processesperclient_per_partition) {
total_num_clients *= num_partitions;
}
clientParams.put("NUMCLIENTS", Integer.toString(total_num_clients));
clientParams.putAll(hstore_conf.getParametersLoadedFromArgs());
// Make sure we put in the parameters passed from the command-line into both components
Map<String, String> loadedArgs = hstore_conf.getParametersLoadedFromArgs();
clientParams.putAll(loadedArgs);
siteParams.putAll(loadedArgs);
config.clientParameters.putAll(clientParams);
config.siteParameters.putAll(siteParams);
if (trace.val) LOG.trace("Benchmark Configuration\n" + config.toString());