Search in sources :

Example 1 with RaptorPlugin

use of com.facebook.presto.raptor.RaptorPlugin in project presto by prestodb.

the class TestRaptorIntegrationSmokeTestMySql method createRaptorMySqlQueryRunner.

private static DistributedQueryRunner createRaptorMySqlQueryRunner(String mysqlUrl) throws Exception {
    DistributedQueryRunner queryRunner = new DistributedQueryRunner(createSession("tpch"), 2);
    queryRunner.installPlugin(new TpchPlugin());
    queryRunner.createCatalog("tpch", "tpch");
    queryRunner.installPlugin(new RaptorPlugin());
    File baseDir = queryRunner.getCoordinator().getBaseDataDir().toFile();
    Map<String, String> raptorProperties = ImmutableMap.<String, String>builder().put("metadata.db.type", "mysql").put("metadata.db.url", mysqlUrl).put("storage.data-directory", new File(baseDir, "data").toURI().toString()).put("storage.max-shard-rows", "2000").put("backup.provider", "file").put("raptor.startup-grace-period", "10s").put("backup.directory", new File(baseDir, "backup").getAbsolutePath()).build();
    queryRunner.createCatalog("raptor", "raptor", raptorProperties);
    copyTables(queryRunner, "tpch", createSession(), false);
    return queryRunner;
}
Also used : DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) TpchPlugin(com.facebook.presto.tpch.TpchPlugin) File(java.io.File) RaptorPlugin(com.facebook.presto.raptor.RaptorPlugin)

Aggregations

RaptorPlugin (com.facebook.presto.raptor.RaptorPlugin)1 DistributedQueryRunner (com.facebook.presto.tests.DistributedQueryRunner)1 TpchPlugin (com.facebook.presto.tpch.TpchPlugin)1 File (java.io.File)1