Search in sources :

Example 21 with TpchPlugin

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;
    }
}
Also used : DistributedQueryRunner(io.prestosql.tests.DistributedQueryRunner) HashMap(java.util.HashMap) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) StateStoreManagerPlugin(io.hetu.core.statestore.StateStoreManagerPlugin)

Example 22 with TpchPlugin

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");
}
Also used : TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) File(java.io.File) URL(java.net.URL) BeforeClass(org.testng.annotations.BeforeClass)

Example 23 with TpchPlugin

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);
}
Also used : TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) DataCenterClient(io.hetu.core.plugin.datacenter.client.DataCenterClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 24 with TpchPlugin

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;
    }
}
Also used : TestingPrestoClient(io.prestosql.tests.TestingPrestoClient) DistributedQueryRunner(io.prestosql.tests.DistributedQueryRunner) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) SchemaTableName(io.prestosql.spi.connector.SchemaTableName)

Example 25 with TpchPlugin

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"));
}
Also used : BlackHolePlugin(io.prestosql.plugin.blackhole.BlackHolePlugin) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

TpchPlugin (io.prestosql.plugin.tpch.TpchPlugin)35 DistributedQueryRunner (io.prestosql.tests.DistributedQueryRunner)22 HashMap (java.util.HashMap)10 BeforeClass (org.testng.annotations.BeforeClass)10 TestingPrestoServer (io.prestosql.server.testing.TestingPrestoServer)8 File (java.io.File)5 HetuMetastorePlugin (io.hetu.core.metastore.HetuMetastorePlugin)4 BlackHolePlugin (io.prestosql.plugin.blackhole.BlackHolePlugin)4 IOException (java.io.IOException)4 BufferedWriter (java.io.BufferedWriter)3 FileWriter (java.io.FileWriter)3 StarTreePlugin (io.hetu.core.cube.startree.StarTreePlugin)2 HetuFileSystemClientPlugin (io.hetu.core.filesystem.HetuFileSystemClientPlugin)2 Session (io.prestosql.Session)2 HiveIdentity (io.prestosql.plugin.hive.authentication.HiveIdentity)2 NoHdfsAuthentication (io.prestosql.plugin.hive.authentication.NoHdfsAuthentication)2 FileHiveMetastore (io.prestosql.plugin.hive.metastore.file.FileHiveMetastore)2 SelectedRole (io.prestosql.spi.security.SelectedRole)2 TestingPrestoClient (io.prestosql.tests.TestingPrestoClient)2 URL (java.net.URL)2