Search in sources :

Example 11 with TestingPrestoServer

use of io.prestosql.server.testing.TestingPrestoServer in project hetu-core by openlookeng.

the class DistributedQueryRunner method isConnectionVisibleToAllNodes.

private boolean isConnectionVisibleToAllNodes(CatalogName catalogName) {
    for (TestingPrestoServer server : servers) {
        server.refreshNodes();
        Set<InternalNode> activeNodesWithConnector = server.getActiveNodesWithConnector(catalogName);
        if (activeNodesWithConnector.size() != servers.size()) {
            return false;
        }
    }
    return true;
}
Also used : TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) InternalNode(io.prestosql.metadata.InternalNode)

Example 12 with TestingPrestoServer

use of io.prestosql.server.testing.TestingPrestoServer in project hetu-core by openlookeng.

the class TestGenerateTokenFilter method setup.

@BeforeClass
public void setup() throws Exception {
    server = new TestingPrestoServer(ImmutableList.of(new TestGenerateTokenFilterModule()));
    httpClient = (JettyHttpClient) server.getInstance(Key.get(HttpClient.class, GenerateTokenFilterTest.class));
    // extract the filter
    List<HttpRequestFilter> filters = httpClient.getRequestFilters();
    assertEquals(filters.size(), 3);
    assertInstanceOf(filters.get(2), GenerateTraceTokenRequestFilter.class);
    filter = (GenerateTraceTokenRequestFilter) filters.get(2);
}
Also used : HttpRequestFilter(io.airlift.http.client.HttpRequestFilter) HttpClient(io.airlift.http.client.HttpClient) JettyHttpClient(io.airlift.http.client.jetty.JettyHttpClient) TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 13 with TestingPrestoServer

use of io.prestosql.server.testing.TestingPrestoServer in project hetu-core by openlookeng.

the class TestNodeResource method setup.

@BeforeClass
public void setup() throws Exception {
    server = new TestingPrestoServer();
    client = new JettyHttpClient();
}
Also used : JettyHttpClient(io.airlift.http.client.jetty.JettyHttpClient) TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 14 with TestingPrestoServer

use of io.prestosql.server.testing.TestingPrestoServer in project hetu-core by openlookeng.

the class TestDataCenterClient method setup.

/**
 * setup
 *
 * @throws Exception setup failed.
 */
@BeforeClass
public void setup() throws Exception {
    this.server = new TestingPrestoServer();
    this.baseUri = server.getBaseUrl();
    this.server.installPlugin(new TpchPlugin());
    this.server.createCatalog("tpch", "tpch");
    this.config = new DataCenterConfig().setConnectionUrl(this.baseUri).setConnectionUser("root");
    this.httpClient = DataCenterStatementClientFactory.newHttpClient(this.config);
}
Also used : TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 15 with TestingPrestoServer

use of io.prestosql.server.testing.TestingPrestoServer in project hetu-core by openlookeng.

the class TestPrestoDriver method setup.

@BeforeClass
public void setup() throws Exception {
    Logging.initialize();
    server = new TestingPrestoServer();
    server.installPlugin(new TpchPlugin());
    server.createCatalog(TEST_CATALOG, "tpch");
    server.installPlugin(new BlackHolePlugin());
    server.createCatalog("blackhole", "blackhole");
    waitForNodeRefresh(server);
    setupTestTables();
    executorService = newCachedThreadPool(daemonThreadsNamed("test-%s"));
}
Also used : BlackHolePlugin(io.prestosql.plugin.blackhole.BlackHolePlugin) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

TestingPrestoServer (io.prestosql.server.testing.TestingPrestoServer)36 BeforeClass (org.testng.annotations.BeforeClass)17 Test (org.testng.annotations.Test)11 TpchPlugin (io.prestosql.plugin.tpch.TpchPlugin)8 ArrayList (java.util.ArrayList)8 BlackHolePlugin (io.prestosql.plugin.blackhole.BlackHolePlugin)5 BasicQueryInfo (io.prestosql.server.BasicQueryInfo)5 DistributedQueryRunner (io.prestosql.tests.DistributedQueryRunner)5 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)4 JettyHttpClient (io.airlift.http.client.jetty.JettyHttpClient)4 ImmutableMap (com.google.common.collect.ImmutableMap)3 QueryId (io.prestosql.spi.QueryId)3 CatalogName (io.prestosql.spi.connector.CatalogName)3 HashMap (java.util.HashMap)3 Future (java.util.concurrent.Future)3 QueryManager (io.prestosql.execution.QueryManager)2 TaskManager (io.prestosql.execution.TaskManager)2 NodeStateChangeHandler (io.prestosql.server.NodeStateChangeHandler)2 File (java.io.File)2 URL (java.net.URL)2