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;
}
Aggregations