drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sohami <...@git.apache.org>
Subject [GitHub] drill pull request #710: DRILL-5126: Provide simplified, unified "cluster fi...
Date Thu, 19 Jan 2017 03:24:13 GMT
Github user sohami commented on a diff in the pull request:

    https://github.com/apache/drill/pull/710#discussion_r96785470
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/test/QueryBuilder.java ---
    @@ -49,6 +57,107 @@
     public class QueryBuilder {
     
       /**
    +   * Listener used to retrieve the query summary (only) asynchronously
    +   * using a {@link QuerySummaryFuture}.
    +   */
    +
    +  public class SummaryOnlyQueryEventListener implements UserResultsListener {
    +
    +    private final QuerySummaryFuture future;
    +    private QueryId queryId;
    +    private int recordCount;
    +    private int batchCount;
    +    private long startTime;
    +
    +    public SummaryOnlyQueryEventListener(QuerySummaryFuture future) {
    +      this.future = future;
    +      startTime = System.currentTimeMillis();
    +    }
    +
    +    @Override
    +    public void queryIdArrived(QueryId queryId) {
    +      this.queryId = queryId;
    +    }
    +
    +    @Override
    +    public void submissionFailed(UserException ex) {
    +      future.completed(new QuerySummary(queryId, recordCount, batchCount,
    +          System.currentTimeMillis() - startTime, ex));
    +    }
    +
    +    @Override
    +    public void dataArrived(QueryDataBatch result, ConnectionThrottle throttle) {
    +      batchCount++;
    +      recordCount += result.getHeader().getRowCount();
    +      result.release();
    +    }
    +
    +    @Override
    +    public void queryCompleted(QueryState state) {
    +      future.completed(new QuerySummary(queryId, recordCount, batchCount,
    +                       System.currentTimeMillis() - startTime, state));
    +    }
    +  }
    +
    +  /**
    +   * The future used to wait for the completion of an async query. Returns
    +   * just the summary of the query.
    +   */
    +
    +  public class QuerySummaryFuture implements Future<QuerySummary> {
    +
    +    /**
    +     * Synchronizes the listener thread and the test thread that
    +     * launched the query.
    +     */
    +
    --- End diff --
    
    please remove extra space here and other places too. Like line 120


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message