Search in sources :

Example 1 with TestingKinesisConnectorFactory

use of io.trino.plugin.kinesis.TestingKinesisConnectorFactory in project trino by trinodb.

the class TestUtils method installKinesisPlugin.

/**
 * Install the plugin into the given query runner, using the mock client and the given table descriptions.
 */
public static MockKinesisClient installKinesisPlugin(QueryRunner queryRunner) {
    KinesisTestClientManager kinesisTestClientManager = new KinesisTestClientManager();
    MockKinesisClient mockClient = (MockKinesisClient) kinesisTestClientManager.getClient();
    mockClient.createStream("test123", 2);
    mockClient.createStream("sampleTable", 2);
    mockClient.createStream("sampleGzipCompressTable", 2);
    mockClient.createStream("sampleAutomaticCompressTable", 2);
    KinesisConnectorFactory kinesisConnectorFactory = new TestingKinesisConnectorFactory(kinesisTestClientManager);
    KinesisPlugin kinesisPlugin = new KinesisPlugin(kinesisConnectorFactory);
    queryRunner.installPlugin(kinesisPlugin);
    Map<String, String> kinesisConfig = ImmutableMap.of("kinesis.default-schema", "default", "kinesis.access-key", "", "kinesis.secret-key", "", "kinesis.table-description-location", "src/test/resources/tableDescriptions");
    queryRunner.createCatalog("kinesis", "kinesis", kinesisConfig);
    return mockClient;
}
Also used : TestingKinesisConnectorFactory(io.trino.plugin.kinesis.TestingKinesisConnectorFactory) TestingKinesisConnectorFactory(io.trino.plugin.kinesis.TestingKinesisConnectorFactory) KinesisConnectorFactory(io.trino.plugin.kinesis.KinesisConnectorFactory) KinesisPlugin(io.trino.plugin.kinesis.KinesisPlugin)

Aggregations

KinesisConnectorFactory (io.trino.plugin.kinesis.KinesisConnectorFactory)1 KinesisPlugin (io.trino.plugin.kinesis.KinesisPlugin)1 TestingKinesisConnectorFactory (io.trino.plugin.kinesis.TestingKinesisConnectorFactory)1