use of io.confluent.ksql.services.ServiceContextFactory in project ksql by confluentinc.
the class StandaloneExecutorFactory method create.
public static StandaloneExecutor create(final Map<String, String> properties, final String queriesFile, final String installDir, final MetricCollectors metricCollectors) {
final KsqlConfig tempConfig = new KsqlConfig(properties);
final Function<KsqlConfig, ServiceContext> serviceContextFactory = config -> ServiceContextFactory.create(config, DisabledKsqlClient::instance);
final ServiceContext tempServiceContext = serviceContextFactory.apply(tempConfig);
final String kafkaClusterId = KafkaClusterUtil.getKafkaClusterId(tempServiceContext);
final String ksqlServerId = tempConfig.getString(KsqlConfig.KSQL_SERVICE_ID_CONFIG);
final Map<String, Object> updatedProperties = tempConfig.originals();
updatedProperties.putAll(metricCollectors.addConfluentMetricsContextConfigs(ksqlServerId, kafkaClusterId));
return create(updatedProperties, queriesFile, installDir, serviceContextFactory, KafkaConfigStore::new, KsqlVersionCheckerAgent::new, StandaloneExecutor::new, metricCollectors);
}
Aggregations