Skip to content

Commit

Permalink
Paginate through all results before reporting time.
Browse files Browse the repository at this point in the history
Closes #119
  • Loading branch information
rustyrazorblade committed Nov 19, 2019
1 parent 747ec74 commit c40c59d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.thelastpickle.tlpstress

import com.datastax.driver.core.ResultSet
import com.google.common.util.concurrent.FutureCallback
import java.util.*
import com.codahale.metrics.Timer
import com.thelastpickle.tlpstress.profiles.IStressRunner
import com.thelastpickle.tlpstress.profiles.Operation
Expand Down Expand Up @@ -36,6 +35,14 @@ class OperationCallback(val context: StressContext,
override fun onSuccess(result: ResultSet?) {
semaphore.release()
startTime.stop()
if(result == null)
error("Unexpected result")

if(op is Operation.SelectStatement) {
while(!result.isFullyFetched ) {
result.fetchMoreResults()
}
}

// we only do the callback for mutations
// might extend this to select, but I can't see a reason for it now
Expand Down

0 comments on commit c40c59d

Please sign in to comment.