use of com.facebook.presto.spi.Plugin in project presto by prestodb.
the class TestQueues method getSimpleQueryRunner.
static DistributedQueryRunner getSimpleQueryRunner() throws Exception {
String dbConfigUrl = getDbConfigUrl();
H2ResourceGroupsDao dao = getDao(dbConfigUrl);
ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
builder.put("experimental.resource-groups-enabled", "true");
Map<String, String> properties = builder.build();
DistributedQueryRunner queryRunner = TpchQueryRunner.createQueryRunner(properties);
Plugin h2ResourceGroupManagerPlugin = new H2ResourceGroupManagerPlugin();
queryRunner.installPlugin(h2ResourceGroupManagerPlugin);
queryRunner.getCoordinator().getResourceGroupManager().get().setConfigurationManager(NAME, ImmutableMap.of("resource-groups.config-db-url", dbConfigUrl));
setup(queryRunner, dao);
return queryRunner;
}
use of com.facebook.presto.spi.Plugin in project presto by prestodb.
the class TestOraclePlugin method testCreateConnector.
@Test
public void testCreateConnector() {
Plugin plugin = new OraclePlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("connection-url", "jdbc:oracle:thin//test"), new TestingConnectorContext());
}
use of com.facebook.presto.spi.Plugin in project presto by prestodb.
the class H2TestUtil method createQueryRunner.
public static DistributedQueryRunner createQueryRunner(String dbConfigUrl, H2ResourceGroupsDao dao, String environment, Map<String, String> coordinatorProperties, int coordinatorCount) throws Exception {
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(testSessionBuilder().setCatalog("tpch").setSchema("tiny").build()).setNodeCount(2).setCoordinatorCount(coordinatorCount).setEnvironment(environment).setResourceManagerEnabled(true).setCoordinatorProperties(coordinatorProperties).build();
try {
Plugin h2ResourceGroupManagerPlugin = new H2ResourceGroupManagerPlugin();
queryRunner.installPlugin(h2ResourceGroupManagerPlugin);
for (int coordinator = 0; coordinator < coordinatorCount; coordinator++) {
queryRunner.getCoordinator(coordinator).getResourceGroupManager().get().setConfigurationManager(CONFIGURATION_MANAGER_TYPE, ImmutableMap.of("resource-groups.config-db-url", dbConfigUrl, "node.environment", environment));
}
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
setup(queryRunner, dao, environment);
queryRunner.waitForClusterToGetReady();
return queryRunner;
} catch (Exception e) {
queryRunner.close();
throw e;
}
}
use of com.facebook.presto.spi.Plugin in project presto by prestodb.
the class TestSqlServerPlugin method testCreateConnector.
@Test
public void testCreateConnector() {
Plugin plugin = new SqlServerPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("connection-url", "test"), new TestingConnectorContext());
}
use of com.facebook.presto.spi.Plugin in project presto by prestodb.
the class TestMySqlPlugin method testCreateConnector.
@Test
public void testCreateConnector() {
Plugin plugin = new MySqlPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("connection-url", "jdbc:mysql://test"), new TestingConnectorContext());
}
Aggregations