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;
}
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);
}
}
Aggregations