Search in sources :

Example 1 with UdfLoader

use of io.confluent.ksql.function.UdfLoader in project ksql by confluentinc.

the class TemporaryEngine method before.

@Override
protected void before() {
    final InternalFunctionRegistry functionRegistry = new InternalFunctionRegistry();
    metaStore = new MetaStoreImpl(functionRegistry);
    serviceContext = TestServiceContext.create();
    engine = (KsqlEngineTestUtil.createKsqlEngine(getServiceContext(), metaStore, new MetricCollectors()));
    ksqlConfig = KsqlConfigTestUtil.create("localhost:9092", ImmutableMap.<String, Object>builder().putAll(configs).put("ksql.command.topic.suffix", "commands").put(KsqlRestConfig.LISTENERS_CONFIG, "http://localhost:8088").build());
    final SqlTypeParser typeParser = SqlTypeParser.create(TypeRegistry.EMPTY);
    final Optional<Metrics> noMetrics = Optional.empty();
    final UdfLoader udfLoader = new UdfLoader(functionRegistry, noMetrics, typeParser, true);
    udfLoader.loadUdfFromClass(TestUdf1.class, "test");
    final UdtfLoader udtfLoader = new UdtfLoader(functionRegistry, noMetrics, typeParser, true);
    udtfLoader.loadUdtfFromClass(TestUdtf1.class, "whatever");
    udtfLoader.loadUdtfFromClass(TestUdtf2.class, "whatever");
}
Also used : Metrics(org.apache.kafka.common.metrics.Metrics) MetaStoreImpl(io.confluent.ksql.metastore.MetaStoreImpl) MetricCollectors(io.confluent.ksql.metrics.MetricCollectors) SqlTypeParser(io.confluent.ksql.schema.ksql.SqlTypeParser) InternalFunctionRegistry(io.confluent.ksql.function.InternalFunctionRegistry) UdfLoader(io.confluent.ksql.function.UdfLoader) UdtfLoader(io.confluent.ksql.function.UdtfLoader)

Aggregations

InternalFunctionRegistry (io.confluent.ksql.function.InternalFunctionRegistry)1 UdfLoader (io.confluent.ksql.function.UdfLoader)1 UdtfLoader (io.confluent.ksql.function.UdtfLoader)1 MetaStoreImpl (io.confluent.ksql.metastore.MetaStoreImpl)1 MetricCollectors (io.confluent.ksql.metrics.MetricCollectors)1 SqlTypeParser (io.confluent.ksql.schema.ksql.SqlTypeParser)1 Metrics (org.apache.kafka.common.metrics.Metrics)1