dcapwell commented on code in PR #111:
URL:
https://github.com/apache/cassandra-easy-stress/pull/111#discussion_r4354313979
##########
src/main/kotlin/org/apache/cassandra/easystress/commands/Run.kt:
##########
@@ -611,59 +645,75 @@ class Run(
runners: List<WorkloadRunner>,
metrics: Metrics,
) {
- // The --populate flag can be overridden by the profile
+ val settings = resolvePopulateSettings(workload)
+ val generator = populateGenerator ?:
workload.instance.getPopulatePartitionKeyGenerator().orElse("sequence")
+
+ println("Prepopulating data with ${settings.rows} records per thread
($threads)")
+
+ if (settings.rows <= 0) {
+ return
+ }
+ println(
+ "Populate generator: $generator, batch: ${settings.batchSize}, " +
+ "delete ratio: ${settings.deleteRatio}, concurrency per
thread: ${settings.concurrency}",
+ )
+
+ ProgressBar("Populate Progress", settings.rows * threads,
ProgressBarStyle.ASCII).use { bar ->
+ // update the bar every second, starting 1 second from now, as a
daemon thread
+ val timer =
+ fixedRateTimer("progress-bar", true, 1000, 1000) {
+ bar.stepTo(metrics.populateRows.count +
metrics.populateErrors.count)
+ }
+
+ // each runner returns once all of its writes have completed
+ runners
+ .map { thread(start = true, isDaemon = false, name =
"populate-${it.context.thread}") { it.populate(settings, generator) } }
+ .forEach { it.join() }
Review Comment:
if populate throws we silently ignore and move on. `join` doesn't know if
the thread had a exception, its waiting on the thread exiting.
so its possible for the threads to do 0 work and move on claiming success
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]