public TestQueryResource() throws Exception { server = new TestingPrestoServer(); }
private static TestingPrestoServer createTestingPrestoServer() throws Exception { ImmutableMap.Builder<String, String> properties = ImmutableMap.<String, String>builder() .put("query.client.timeout", "10m") .put("exchange.http-client.idle-timeout", "1h") .put("node-scheduler.min-candidates", "1") .put("datasources", "system"); return new TestingPrestoServer(true, properties.build(), null, null, new SqlParserOptions(), ImmutableList.of()); } }
private static TestingPrestoServer createTestingPrestoServer(URI discoveryUri, boolean coordinator, Map<String, String> extraProperties, SqlParserOptions parserOptions, String environment) throws Exception { long start = System.nanoTime(); ImmutableMap.Builder<String, String> propertiesBuilder = ImmutableMap.<String, String>builder() .put("query.client.timeout", "10m") .put("exchange.http-client.idle-timeout", "1h") .put("task.max-index-memory", "16kB") // causes index joins to fault load .put("datasources", "system") .put("distributed-index-joins-enabled", "true"); if (coordinator) { propertiesBuilder.put("node-scheduler.include-coordinator", "true"); propertiesBuilder.put("join-distribution-type", "PARTITIONED"); } HashMap<String, String> properties = new HashMap<>(propertiesBuilder.build()); properties.putAll(extraProperties); TestingPrestoServer server = new TestingPrestoServer(coordinator, properties, environment, discoveryUri, parserOptions, ImmutableList.of()); log.info("Created TestingPrestoServer in %s", nanosSince(start).convertToMostSuccinctTimeUnit()); return server; }
@BeforeClass public void setupServer() throws Exception { Logging.initialize(); server = new TestingPrestoServer(); }
@BeforeClass public void setupServer() throws Exception { Logging.initialize(); server = new TestingPrestoServer(); }
@BeforeMethod public void setup() throws Exception { server = new TestingPrestoServer(); client = new JettyHttpClient(); }
@BeforeMethod public void setup() throws Exception { server = new TestingPrestoServer(); client = new JettyHttpClient(); }
public void run() throws Exception { try (TestingPrestoServer server = new TestingPrestoServer()) { for (String pluginClass : options.getPluginClassNames()) { Plugin plugin = (Plugin) Class.forName(pluginClass).getConstructor().newInstance(); server.installPlugin(plugin); } for (Catalog catalog : options.getCatalogs()) { server.createCatalog(catalog.getCatalogName(), catalog.getConnectorName()); } System.out.println(server.getAddress()); waitForInterruption(); } }
@BeforeClass public void setup() throws Exception { server = new TestingPrestoServer(ImmutableList.of(new TestGenerateTokenFilterModule())); httpClient = (JettyHttpClient) server.getInstance(Key.get(HttpClient.class, GenerateTokenFilterTest.class)); // extract the filter List<HttpRequestFilter> filters = httpClient.getRequestFilters(); assertEquals(filters.size(), 2); assertInstanceOf(filters.get(1), GenerateTraceTokenRequestFilter.class); filter = (GenerateTraceTokenRequestFilter) filters.get(1); }
@BeforeClass public void setupServer() throws Exception { Logging.initialize(); server = new TestingPrestoServer(); server.installPlugin(new HiveHadoop2Plugin()); server.createCatalog("hive", "hive-hadoop2", ImmutableMap.<String, String>builder() .put("hive.metastore", "file") .put("hive.metastore.catalog.dir", server.getBaseDataDir().resolve("hive").toAbsolutePath().toString()) .put("hive.security", "sql-standard") .build()); try (Connection connection = createConnection(); Statement statement = connection.createStatement()) { statement.execute("CREATE SCHEMA default"); statement.execute("CREATE SCHEMA fruit"); } }
@BeforeClass public void setup() throws Exception { Logging.initialize(); URL resource = getClass().getClassLoader().getResource("33.privateKey"); assertNotNull(resource, "key directory not found"); File keyDir = new File(resource.getFile()).getAbsoluteFile().getParentFile(); defaultKey = getMimeDecoder().decode(asCharSource(new File(keyDir, "default-key.key"), US_ASCII).read().getBytes(US_ASCII)); hmac222 = getMimeDecoder().decode(asCharSource(new File(keyDir, "222.key"), US_ASCII).read().getBytes(US_ASCII)); privateKey33 = PemReader.loadPrivateKey(new File(keyDir, "33.privateKey"), Optional.empty()); server = new TestingPrestoServer( true, ImmutableMap.<String, String>builder() .put("http-server.authentication.type", "JWT") .put("http.authentication.jwt.key-file", new File(keyDir, "${KID}.key").toString()) .put("http-server.https.enabled", "true") .put("http-server.https.keystore.path", getResource("localhost.keystore").getPath()) .put("http-server.https.keystore.key", "changeit") .build(), null, null, new SqlParserOptions(), ImmutableList.of()); server.installPlugin(new TpchPlugin()); server.createCatalog(TEST_CATALOG, "tpch"); waitForNodeRefresh(server); }
@BeforeClass public void setup() throws Exception { Logging.initialize(); server = new TestingPrestoServer(); server.installPlugin(new BlackHolePlugin()); server.createCatalog("blackhole", "blackhole"); waitForNodeRefresh(server); try (Connection connection = createConnection(); Statement statement = connection.createStatement()) { statement.executeUpdate("CREATE SCHEMA blackhole.blackhole"); } }
@BeforeClass public void setupServer() throws Exception { server = new TestingPrestoServer( true, ImmutableMap.<String, String>builder() .put("testing-warning-collector.add-warnings", "true") .put("testing-warning-collector.preloaded-warnings", String.valueOf(PRELOADED_WARNINGS)) .build(), null, null, new SqlParserOptions(), ImmutableList.of()); server.installPlugin(new TpchPlugin()); server.createCatalog("tpch", "tpch"); server.installPlugin(new BlackHolePlugin()); server.createCatalog("blackhole", "blackhole"); waitForNodeRefresh(server); }
TestQueryStateInfoResource() throws Exception { server = new TestingPrestoServer(); server.installPlugin(new TpchPlugin()); server.createCatalog("tpch", "tpch"); client = new JettyHttpClient(); }
@BeforeClass public void setup() throws Exception { Logging.initialize(); server = new TestingPrestoServer(); server.installPlugin(new TpchPlugin()); server.createCatalog(TEST_CATALOG, "tpch"); server.installPlugin(new BlackHolePlugin()); server.createCatalog("blackhole", "blackhole"); waitForNodeRefresh(server); setupTestTables(); executorService = newCachedThreadPool(daemonThreadsNamed("test-%s")); }
server = new TestingPrestoServer(); server.installPlugin(new TpchPlugin()); server.createCatalog("tpch", "tpch");
if (testingPrestoServer == null) { synchronized (TestingEnvironment.class) { testingPrestoServer = new TestingPrestoServer();
@BeforeClass public void setupServer() throws Exception { Logging.initialize(); server = new TestingPrestoServer(); }
@BeforeMethod public void setup() throws Exception { server = new TestingPrestoServer(); client = new JettyHttpClient(); }
@BeforeClass public void setupServer() throws Exception { Logging.initialize(); server = new TestingPrestoServer(); }