ChinmaySKulkarni commented on a change in pull request #749: PHOENIX-4521:
Allow Pherf scenario to define per query max allowed query execution duration
after which thread is interrupted
URL: https://github.com/apache/phoenix/pull/749#discussion_r410425250
##########
File path:
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
##########
@@ -148,34 +161,55 @@ private void timedQuery() throws Exception {
boolean isQuery = statement.execute();
if (isQuery) {
rs = statement.getResultSet();
- while (rs.next()) {
- if (null != query.getExpectedAggregateRowCount()) {
- if (rs.getLong(1) !=
query.getExpectedAggregateRowCount())
- throw new RuntimeException(
- "Aggregate count " + rs.getLong(1) + "
does not match expected "
- +
query.getExpectedAggregateRowCount());
- }
-
- if (isSelectCountStatement) {
- resultRowCount = rs.getLong(1);
- } else {
- resultRowCount++;
- }
- }
+ Pair<Long, Boolean> r = getResults(rs, queryIteration,
isSelectCountStatement);
Review comment:
As discussed, let's make this method return a Pair<Long, Long> where the
second Long is an `endTime` which we then use to write to the csv later. That
way the actual time we check and the time we report is the same. Also saves us
unnecessary calls to `EnvironmentEdgeManager.currentTimeMs()`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services