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