Search in sources :

Example 1 with TestingMySqlServer

use of com.facebook.presto.testing.mysql.TestingMySqlServer in project presto by prestodb.

the class BenchmarkTestUtil method setupMySql.

public static TestingMySqlServer setupMySql() throws Exception {
    TestingMySqlServer mySqlServer = new TestingMySqlServer("testuser", "testpass", ImmutableList.of(XDB));
    Handle handle = getJdbi(mySqlServer).open();
    BenchmarkSuiteDao benchmarkDao = handle.attach(BenchmarkSuiteDao.class);
    benchmarkDao.createBenchmarkSuitesTable("benchmark_suites");
    benchmarkDao.createBenchmarkQueriesTable("benchmark_queries");
    return mySqlServer;
}
Also used : TestingMySqlServer(com.facebook.presto.testing.mysql.TestingMySqlServer) BenchmarkSuiteDao(com.facebook.presto.benchmark.source.BenchmarkSuiteDao) Handle(org.jdbi.v3.core.Handle)

Example 2 with TestingMySqlServer

use of com.facebook.presto.testing.mysql.TestingMySqlServer in project presto by prestodb.

the class TestMySqlFunctionNamespaceManager method setup.

@BeforeClass
public void setup() throws Exception {
    this.mySqlServer = new TestingMySqlServer("testuser", "testpass", DB);
    Bootstrap app = new Bootstrap(new MySqlFunctionNamespaceManagerModule(TEST_CATALOG), new SimpleAddressSqlFunctionExecutorsModule(), new DriftNettyClientModule(), new MySqlConnectionModule());
    Map<String, String> config = ImmutableMap.<String, String>builder().put("function-cache-expiration", "0s").put("function-instance-cache-expiration", "0s").put("database-url", mySqlServer.getJdbcUrl(DB)).build();
    try {
        this.injector = app.doNotInitializeLogging().setRequiredConfigurationProperties(config).initialize();
        this.functionNamespaceManager = injector.getInstance(MySqlFunctionNamespaceManager.class);
        this.jdbi = injector.getInstance(Jdbi.class);
    } catch (Exception e) {
        throwIfUnchecked(e);
        throw new RuntimeException(e);
    }
}
Also used : SimpleAddressSqlFunctionExecutorsModule(com.facebook.presto.functionNamespace.execution.SimpleAddressSqlFunctionExecutorsModule) Jdbi(org.jdbi.v3.core.Jdbi) TestingMySqlServer(com.facebook.presto.testing.mysql.TestingMySqlServer) DriftNettyClientModule(com.facebook.drift.transport.netty.client.DriftNettyClientModule) Bootstrap(com.facebook.airlift.bootstrap.Bootstrap) PrestoException(com.facebook.presto.spi.PrestoException) UncheckedExecutionException(com.google.common.util.concurrent.UncheckedExecutionException) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

TestingMySqlServer (com.facebook.presto.testing.mysql.TestingMySqlServer)2 Bootstrap (com.facebook.airlift.bootstrap.Bootstrap)1 DriftNettyClientModule (com.facebook.drift.transport.netty.client.DriftNettyClientModule)1 BenchmarkSuiteDao (com.facebook.presto.benchmark.source.BenchmarkSuiteDao)1 SimpleAddressSqlFunctionExecutorsModule (com.facebook.presto.functionNamespace.execution.SimpleAddressSqlFunctionExecutorsModule)1 PrestoException (com.facebook.presto.spi.PrestoException)1 UncheckedExecutionException (com.google.common.util.concurrent.UncheckedExecutionException)1 Handle (org.jdbi.v3.core.Handle)1 Jdbi (org.jdbi.v3.core.Jdbi)1 BeforeClass (org.testng.annotations.BeforeClass)1