use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class TestCrossRegionDynamicFilter method createDCQueryRunner.
private static DistributedQueryRunner createDCQueryRunner(TestingPrestoServer hetuServer, Map<String, String> properties) throws Exception {
hetuServer.installPlugin(new TpchPlugin());
hetuServer.createCatalog("tpch", "tpch");
hetuServer.installPlugin(new StateStoreManagerPlugin());
hetuServer.loadStateSotre();
DistributedQueryRunner distributedQueryRunner = null;
try {
distributedQueryRunner = DistributedQueryRunner.builder(testSessionBuilder().build()).setNodeCount(1).build();
Map<String, String> connectorProperties = new HashMap<>(properties);
connectorProperties.putIfAbsent("connection-url", hetuServer.getBaseUrl().toString());
connectorProperties.putIfAbsent("connection-user", "root");
distributedQueryRunner.installPlugin(new DataCenterPlugin());
distributedQueryRunner.createDCCatalog("dc", "dc", connectorProperties);
distributedQueryRunner.installPlugin(new TpchPlugin());
distributedQueryRunner.createCatalog("tpch", "tpch", properties);
return distributedQueryRunner;
} catch (Throwable e) {
closeAllSuppress(e, distributedQueryRunner);
throw e;
}
}
use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class TestDataCenterClientAuth method setup.
@BeforeClass
public void setup() throws Exception {
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(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());
server.installPlugin(new TpchPlugin());
server.createCatalog("tpch", "tpch");
}
use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class TestDataCenterMetadata method setup.
@BeforeClass
public void setup() throws Exception {
server = new TestingPrestoServer();
baseUri = server.getBaseUrl();
server.installPlugin(new TpchPlugin());
server.createCatalog("tpch", "tpch");
DataCenterConfig config = new DataCenterConfig().setConnectionUrl(this.baseUri).setConnectionUser("root");
this.httpClient = DataCenterStatementClientFactory.newHttpClient(config);
DataCenterClient client = new DataCenterClient(config, httpClient, typeManager);
this.metadata = new DataCenterMetadata(client, config);
}
use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class KafkaQueryRunner method createKafkaQueryRunner.
public static DistributedQueryRunner createKafkaQueryRunner(EmbeddedKafka embeddedKafka, Iterable<TpchTable<?>> tables) throws Exception {
DistributedQueryRunner queryRunner = null;
try {
queryRunner = new DistributedQueryRunner(createSession(), 2);
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
embeddedKafka.start();
for (TpchTable<?> table : tables) {
embeddedKafka.createTopics(kafkaTopicName(table));
}
Map<SchemaTableName, KafkaTopicDescription> topicDescriptions = createTpchTopicDescriptions(queryRunner.getCoordinator().getMetadata(), tables);
installKafkaPlugin(embeddedKafka, queryRunner, topicDescriptions);
TestingPrestoClient prestoClient = queryRunner.getClient();
log.info("Loading data...");
long startTime = System.nanoTime();
for (TpchTable<?> table : tables) {
loadTpchTopic(embeddedKafka, prestoClient, table);
}
log.info("Loading complete in %s", nanosSince(startTime).toString(SECONDS));
return queryRunner;
} catch (Throwable e) {
closeAllSuppress(e, queryRunner, embeddedKafka);
throw e;
}
}
use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class TestPrestoDriverTimeZone method setup.
@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"));
}
Aggregations