Search in sources :

Example 1 with QueryState

use of com.facebook.presto.execution.QueryState in project presto by prestodb.

the class TestQueues method testTwoQueriesAtSameTime.

@Test(timeOut = 240_000)
public void testTwoQueriesAtSameTime() throws Exception {
    String dbConfigUrl = getDbConfigUrl();
    H2ResourceGroupsDao dao = getDao(dbConfigUrl);
    try (DistributedQueryRunner queryRunner = createQueryRunner(dbConfigUrl, dao)) {
        QueryId firstDashboardQuery = createQuery(queryRunner, newDashboardSession(), LONG_LASTING_QUERY);
        QueryId secondDashboardQuery = createQuery(queryRunner, newDashboardSession(), LONG_LASTING_QUERY);
        ImmutableSet<QueryState> queuedOrRunning = ImmutableSet.of(QUEUED, RUNNING);
        waitForQueryState(queryRunner, firstDashboardQuery, RUNNING);
        waitForQueryState(queryRunner, secondDashboardQuery, QUEUED);
    }
}
Also used : DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) QueryId(com.facebook.presto.spi.QueryId) H2ResourceGroupsDao(com.facebook.presto.resourceGroups.db.H2ResourceGroupsDao) QueryState(com.facebook.presto.execution.QueryState) Test(org.testng.annotations.Test)

Aggregations

QueryState (com.facebook.presto.execution.QueryState)1 H2ResourceGroupsDao (com.facebook.presto.resourceGroups.db.H2ResourceGroupsDao)1 QueryId (com.facebook.presto.spi.QueryId)1 DistributedQueryRunner (com.facebook.presto.tests.DistributedQueryRunner)1 Test (org.testng.annotations.Test)1