public ConnectorId createCatalog(String catalogName, String connectorName) { return createCatalog(catalogName, connectorName, ImmutableMap.of()); }
public void createCatalog(String catalogName, String connectorName, Map<String, String> properties) { ConnectorId connectorId = server.createCatalog(catalogName, connectorName, properties); refreshNodes(connectorId); }
@Override public void createCatalog(String catalogName, String connectorName, Map<String, String> properties) { long start = System.nanoTime(); Set<ConnectorId> connectorIds = new HashSet<>(); for (TestingPrestoServer server : servers) { connectorIds.add(server.createCatalog(catalogName, connectorName, properties)); } ConnectorId connectorId = getOnlyElement(connectorIds); log.info("Created catalog %s (%s) in %s", catalogName, connectorId, nanosSince(start)); // wait for all nodes to announce the new catalog start = System.nanoTime(); while (!isConnectionVisibleToAllNodes(connectorId)) { Assertions.assertLessThan(nanosSince(start), new Duration(100, SECONDS), "waiting for connector " + connectorId + " to be initialized in every node"); try { MILLISECONDS.sleep(10); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } } log.info("Announced catalog %s (%s) in %s", catalogName, connectorId, nanosSince(start)); }
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 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 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); }
@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 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")); }
TestQueryStateInfoResource() throws Exception { server = new TestingPrestoServer(); server.installPlugin(new TpchPlugin()); server.createCatalog("tpch", "tpch"); client = new JettyHttpClient(); }
server = new TestingPrestoServer(); server.installPlugin(new TpchPlugin()); server.createCatalog("tpch", "tpch"); server.installPlugin(new BlackHolePlugin()); server.createCatalog("blackhole", "blackhole"); server.refreshNodes();
testingPrestoServer.installPlugin(new RakamPlugin()); testingPrestoServer.createCatalog("rakam_raptor", "rakam_raptor", ImmutableMap.<String, String>builder() .put("storage.data-directory", Files.createTempDir().getAbsolutePath()) .put("metadata.db.type", "h2")
public void createCatalog(String catalogName, String connectorName) { createCatalog(catalogName, connectorName, ImmutableMap.<String, String>of()); }
public void createCatalog(String catalogName, String connectorName, Map<String, String> properties) { ConnectorId connectorId = server.createCatalog(catalogName, connectorName, properties); refreshNodes(connectorId); }
@Override public void createCatalog(String catalogName, String connectorName, Map<String, String> properties) { long start = System.nanoTime(); Set<ConnectorId> connectorIds = new HashSet<>(); for (TestingPrestoServer server : servers) { connectorIds.add(server.createCatalog(catalogName, connectorName, properties)); } ConnectorId connectorId = getOnlyElement(connectorIds); log.info("Created catalog %s (%s) in %s", catalogName, connectorId, nanosSince(start)); // wait for all nodes to announce the new catalog start = System.nanoTime(); while (!isConnectionVisibleToAllNodes(connectorId)) { Assertions.assertLessThan(nanosSince(start), new Duration(100, SECONDS), "waiting for connector " + connectorId + " to be initialized in every node"); try { MILLISECONDS.sleep(10); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } } log.info("Announced catalog %s (%s) in %s", catalogName, connectorId, nanosSince(start)); }
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 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 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); }
@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 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")); }