drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-5126) Provide simplified, unified "cluster fixture" for tests
Date Thu, 19 Jan 2017 18:47:26 GMT

    [ https://issues.apache.org/jira/browse/DRILL-5126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15830398#comment-15830398
] 

ASF GitHub Bot commented on DRILL-5126:
---------------------------------------

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.


> Provide simplified, unified "cluster fixture" for tests
> -------------------------------------------------------
>
>                 Key: DRILL-5126
>                 URL: https://issues.apache.org/jira/browse/DRILL-5126
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Tools, Build & Test
>    Affects Versions: 1.9.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Minor
>
> Drill provides a robust selection of test frameworks that have evolved to satisfy the
needs of a variety of test cases. For newbies, however, the result is a bewildering array
of ways to do basically the same thing: set up an embedded Drill cluster, run queries and
check results.
> Further, some key test settings are distributed: some are in the pom.xml file, some in
config files stored as resources, some in hard-coded settings in base test classes.
> Also, some test base classes helpfully set up a test cluster, but then individual tests
need a different config, so they immediately tear down the default cluster and create a new
one.
> This ticket proposes a new test framework, available for new tests, that combines the
best of the existing test frameworks into a single, easy-to-use package.
> * Builder for the cluster
> * Accept config-time options
> * Accept run-time session and system options
> * Specify number of Drillbits
> * Simplified API for the most common options
> * AutoCloseable for use in try-with-resources statements
> * Integration with existing test builder classes
> And so on.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message