@Override public Iterable<ConnectorFactory> getConnectorFactories() { return ImmutableList.of(new JdbcConnectorFactory(name, module, getClassLoader())); }
public static DistributedQueryRunner createJdbcQueryRunner(Iterable<TpchTable<?>> tables) throws Exception { DistributedQueryRunner queryRunner = null; try { queryRunner = new DistributedQueryRunner(createSession(), 3); queryRunner.installPlugin(new TpchPlugin()); queryRunner.createCatalog("tpch", "tpch"); Map<String, String> properties = TestingH2JdbcModule.createProperties(); createSchema(properties, "tpch"); queryRunner.installPlugin(new JdbcPlugin("base-jdbc", new TestingH2JdbcModule())); queryRunner.createCatalog("jdbc", "base-jdbc", properties); copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), tables); return queryRunner; } catch (Throwable e) { closeAllSuppress(e, queryRunner); throw e; } }
public static DistributedQueryRunner createJdbcQueryRunner(Iterable<TpchTable<?>> tables) throws Exception { DistributedQueryRunner queryRunner = null; try { queryRunner = new DistributedQueryRunner(createSession(), 3); queryRunner.installPlugin(new TpchPlugin()); queryRunner.createCatalog("tpch", "tpch"); Map<String, String> properties = TestingH2JdbcModule.createProperties(); createSchema(properties, "tpch"); queryRunner.installPlugin(new JdbcPlugin("base-jdbc", new TestingH2JdbcModule())); queryRunner.createCatalog("jdbc", "base-jdbc", properties); copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), tables); return queryRunner; } catch (Throwable e) { closeAllSuppress(e, queryRunner); throw e; } }
@Override public <T> List<T> getServices(Class<T> type) { if (type == ConnectorFactory.class) { return ImmutableList.of(type.cast(new JdbcConnectorFactory(name, module, optionalConfig, getClassLoader()))); } return ImmutableList.of(); }