if (hstore_conf.client.blocking) {
debugOpts += ", concurrent=" + hstore_conf.client.blocking_concurrent;
}
debugOpts += "]";
ProfileMeasurement stopwatch = new ProfileMeasurement("clients").start();
LOG.info(String.format("Starting %s execution with %d %sclient%s %s",
this.projectBuilder.getProjectName().toUpperCase(),
m_clientThreads.size(),
(hstore_conf.client.blocking ? "blocking " : ""),
(m_clientThreads.size() > 1 ? "s" : ""),
debugOpts));
if (m_config.statsDatabaseURL != null) {
LOG.info("Client Stats Database: " + m_config.statsDatabaseURL);
}
// ---------------------------------------------------------------------------------
// HACK
int gdb_sleep = 0;
if (gdb_sleep > 0) {
LOG.info("Sleeping for " + gdb_sleep + " waiting for GDB");
ThreadUtil.sleep(gdb_sleep*1000);
}
currentResults = new BenchmarkResults(hstore_conf.client.interval,
hstore_conf.client.duration,
m_clientThreads.size());
currentResults.setEnableBasePartitions(hstore_conf.client.output_basepartitions);
long nextIntervalTime = hstore_conf.client.interval;
for (int i = 0; i < m_clients.size(); i++) {
ClientStatusThread t = new ClientStatusThread(this, i);
t.setUncaughtExceptionHandler(this.exceptionHandler);
t.start();
m_statusThreads.add(t);
} // FOR
if (debug.val)
LOG.debug(String.format("Started %d %s",
m_statusThreads.size(), ClientStatusThread.class.getSimpleName()));
// Get a connection to the cluster
Client local_client = this.getClientConnection();
// Spin on whether all clients are ready
while (m_clientsNotReady.get() > 0 && this.stop == false) {
if (debug.val)
LOG.debug(String.format("Waiting for %d clients to come online", m_clientsNotReady.get()));
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
if (this.stop == false) throw ex;
return;
}
} // WHILE
stopwatch.stop();
LOG.info(String.format("Initialized %d %s client threads in %.2f sec",
m_clientThreads.size(),
this.projectBuilder.getProjectName().toUpperCase(),
stopwatch.getTotalThinkTimeSeconds()));
if (this.stop) {
if (debug.val) LOG.debug("Stop flag is set to true");
return;
}