Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/710#discussion_r96928159
  
    --- 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 --
    
    Fixed the other way: consistent white space before & after Javadoc comments.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to