Refine search
public static LocalQueryRunner createQueryRunner(Map<String, String> catalogProperties, Class<? extends AtopFactory> factoryClass) { Session session = testSessionBuilder() .setCatalog("atop") .setSchema("default") .setTimeZoneKey(TimeZoneKey.getTimeZoneKey(TimeZone.getDefault().getID())) .build(); LocalQueryRunner queryRunner = new LocalQueryRunner(session); try { AtopConnectorFactory connectorFactory = new AtopConnectorFactory(factoryClass, LocalAtopQueryRunner.class.getClassLoader()); ImmutableMap.Builder<String, String> properties = ImmutableMap.<String, String>builder() .putAll(catalogProperties) .put("atop.max-history-days", "1"); queryRunner.createCatalog("atop", connectorFactory, properties.build()); return queryRunner; } catch (Exception e) { closeAllSuppress(e, queryRunner); throw e; } } }
@AfterClass(alwaysRun = true) public void tearDown() { closeQuietly(server); closeQuietly(httpClient); }
@AfterClass(alwaysRun = true) public void close() throws Exception { closeAllRuntimeException(queryRunner, h2QueryRunner); queryRunner = null; h2QueryRunner = null; sqlParser = null; queryRunnerSupplier = null; }
@Override public void close() { Closeables.closeQuietly(prestoClient); Closeables.closeQuietly(server); }
@SuppressWarnings("deprecation") @AfterMethod public void teardown() { Closeables.closeQuietly(server); Closeables.closeQuietly(client); }
@AfterClass(alwaysRun = true) public final void destroyTestWindowFunction() { closeAllRuntimeException(queryRunner); queryRunner = null; }
@AfterClass(alwaysRun = true) public void teardown() { closeQuietly(server); closeQuietly(client); }
@SuppressWarnings("ThrowableResultOfMethodCallIgnored") public static DistributedQueryRunner createJmxQueryRunner() throws Exception { DistributedQueryRunner queryRunner = null; try { queryRunner = new DistributedQueryRunner(createSession(), 3); queryRunner.installPlugin(new JmxPlugin()); queryRunner.createCatalog("jmx", "jmx"); return queryRunner; } catch (Throwable e) { closeAllSuppress(e, queryRunner); throw e; } }
@AfterMethod public void teardown() { closeQuietly(server); closeQuietly(client); }
@AfterClass(alwaysRun = true) public void tearDown() { closeAllRuntimeException(queryRunner); queryRunner = null; }
@AfterClass(alwaysRun = true) public void teardown() { closeQuietly(server); closeQuietly(client); }
public static QueryRunner createMySqlQueryRunner(TestingMySqlServer server, 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 = ImmutableMap.<String, String>builder() .put("connection-url", server.getJdbcUrl()) .put("allow-drop-table", "true") .build(); queryRunner.installPlugin(new MySqlPlugin()); queryRunner.createCatalog("mysql", "mysql", properties); copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), tables); return queryRunner; } catch (Throwable e) { closeAllSuppress(e, queryRunner, server); throw e; } }
@Override public void close() { if (source != null) { closeQuietly(source); source = null; } if (thriftServers != null) { for (DriftServer server : thriftServers) { server.shutdown(); } thriftServers = null; } }
@AfterClass(alwaysRun = true) public void tearDown() { closeAllRuntimeException(queryRunner); queryRunner = null; }
@AfterClass(alwaysRun = true) public void tearDownHttpClient() { closeQuietly(httpClient); closeQuietly(jettyIoPool); closeQuietly(testingSocksProxy); }
public static QueryRunner createKuduQueryRunner(String schema) throws Exception { QueryRunner runner = null; String kuduSchema = isSchemaEmulationEnabled() ? schema : "default"; try { runner = DistributedQueryRunner.builder(createSession(kuduSchema)).setNodeCount(3).build(); installKuduConnector(runner, kuduSchema); return runner; } catch (Throwable e) { closeAllSuppress(e, runner); throw e; } }
public static QueryRunner createThriftQueryRunner(int thriftServers, int nodeCount, boolean enableIndexJoin, Map<String, String> properties) throws Exception { List<DriftServer> servers = null; DistributedQueryRunner runner = null; try { servers = startThriftServers(thriftServers, enableIndexJoin); runner = createThriftQueryRunnerInternal(servers, nodeCount, properties); return new ThriftQueryRunnerWithServers(runner, servers); } catch (Throwable t) { closeQuietly(runner); // runner might be null, so closing servers explicitly if (servers != null) { for (DriftServer server : servers) { server.shutdown(); } } throw t; } }
@AfterClass(alwaysRun = true) public final void destroyTestFunctions() { closeAllRuntimeException(functionAssertions); functionAssertions = null; }
@AfterClass(alwaysRun = true) public void teardown() { closeQuietly(server); closeQuietly(client); }
public static MongoQueryRunner createMongoQueryRunner(Iterable<TpchTable<?>> tables) throws Exception { MongoQueryRunner queryRunner = null; try { queryRunner = new MongoQueryRunner(createSession(), 3); queryRunner.installPlugin(new TpchPlugin()); queryRunner.createCatalog("tpch", "tpch"); Map<String, String> properties = ImmutableMap.of( "mongodb.seeds", queryRunner.getAddress().getHostString() + ":" + queryRunner.getAddress().getPort(), "mongodb.socket-keep-alive", "true"); queryRunner.installPlugin(new MongoPlugin()); queryRunner.createCatalog("mongodb", "mongodb", properties); copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), tables); return queryRunner; } catch (Throwable e) { closeAllSuppress(e, queryRunner); throw e; } }