Search in sources :

Example 1 with QueryEventListener

use of io.confluent.ksql.engine.QueryEventListener in project ksql by confluentinc.

the class KsqlTesterTest method setUp.

@Before
public void setUp() {
    final MockSchemaRegistryClient srClient = new MockSchemaRegistryClient();
    this.topicClient = new FakeKafkaTopicClient();
    this.serviceContext = TestServiceContext.create(topicClient, () -> srClient);
    this.config = new KsqlConfig(BASE_CONFIG);
    this.formatInjector = new DefaultFormatInjector();
    final MetaStoreImpl metaStore = new MetaStoreImpl(TestFunctionRegistry.INSTANCE.get());
    final MetricCollectors metricCollectors = new MetricCollectors();
    this.engine = new KsqlEngine(serviceContext, NoopProcessingLogContext.INSTANCE, metaStore, ServiceInfo.create(config), new SequentialQueryIdGenerator(), this.config, Collections.singletonList(new QueryEventListener() {

        @Override
        public void onDeregister(QueryMetadata query) {
            final DriverAndProperties driverAndProperties = drivers.get(query.getQueryId());
            closeDriver(driverAndProperties.driver, driverAndProperties.properties, false);
        }
    }), metricCollectors);
    this.expectedException = null;
    this.expectedMessage = null;
    this.overrides = new HashMap<>();
    this.driverPipeline = new TestDriverPipeline();
}
Also used : KsqlEngine(io.confluent.ksql.engine.KsqlEngine) PersistentQueryMetadata(io.confluent.ksql.util.PersistentQueryMetadata) QueryMetadata(io.confluent.ksql.util.QueryMetadata) MockSchemaRegistryClient(io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient) MetaStoreImpl(io.confluent.ksql.metastore.MetaStoreImpl) FakeKafkaTopicClient(io.confluent.ksql.services.FakeKafkaTopicClient) MetricCollectors(io.confluent.ksql.metrics.MetricCollectors) KsqlConfig(io.confluent.ksql.util.KsqlConfig) DefaultFormatInjector(io.confluent.ksql.format.DefaultFormatInjector) QueryEventListener(io.confluent.ksql.engine.QueryEventListener) SequentialQueryIdGenerator(io.confluent.ksql.query.id.SequentialQueryIdGenerator) Before(org.junit.Before)

Aggregations

MockSchemaRegistryClient (io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient)1 KsqlEngine (io.confluent.ksql.engine.KsqlEngine)1 QueryEventListener (io.confluent.ksql.engine.QueryEventListener)1 DefaultFormatInjector (io.confluent.ksql.format.DefaultFormatInjector)1 MetaStoreImpl (io.confluent.ksql.metastore.MetaStoreImpl)1 MetricCollectors (io.confluent.ksql.metrics.MetricCollectors)1 SequentialQueryIdGenerator (io.confluent.ksql.query.id.SequentialQueryIdGenerator)1 FakeKafkaTopicClient (io.confluent.ksql.services.FakeKafkaTopicClient)1 KsqlConfig (io.confluent.ksql.util.KsqlConfig)1 PersistentQueryMetadata (io.confluent.ksql.util.PersistentQueryMetadata)1 QueryMetadata (io.confluent.ksql.util.QueryMetadata)1 Before (org.junit.Before)1