use of io.confluent.ksql.rest.server.computation.KafkaConfigStore in project ksql by confluentinc.
the class StandaloneExecutorFunctionalTest method setUp.
@SuppressWarnings("unchecked")
@Before
public void setUp() throws Exception {
queryFile = TMP.newFile().toPath();
final Map<String, Object> properties = ImmutableMap.<String, Object>builder().putAll(KsqlConfigTestUtil.baseTestConfig()).put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, TEST_HARNESS.kafkaBootstrapServers()).put(KsqlConfig.SCHEMA_REGISTRY_URL_PROPERTY, "http://foo:8080").build();
final Function<KsqlConfig, ServiceContext> serviceContextFactory = config -> TestServiceContext.create(new KsqlConfig(properties), TEST_HARNESS.getServiceContext().getSchemaRegistryClientFactory());
standalone = StandaloneExecutorFactory.create((Map) properties, queryFile.toString(), ".", serviceContextFactory, KafkaConfigStore::new, activeQuerySupplier -> versionChecker, StandaloneExecutor::new, new MetricCollectors());
s1 = KsqlIdentifierTestUtil.uniqueIdentifierName("S1");
s2 = KsqlIdentifierTestUtil.uniqueIdentifierName("S2");
t1 = KsqlIdentifierTestUtil.uniqueIdentifierName("T1");
}
use of io.confluent.ksql.rest.server.computation.KafkaConfigStore 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