use of io.confluent.ksql.util.SharedKafkaStreamsRuntimeImpl in project ksql by confluentinc.
the class QueryBuilder method getKafkaStreamsInstance.
private SharedKafkaStreamsRuntime getKafkaStreamsInstance(final String applicationId, final Set<SourceName> sources, final QueryId queryId, final MetricCollectors metricCollectors) {
for (final SharedKafkaStreamsRuntime sharedKafkaStreamsRuntime : streams) {
if (sharedKafkaStreamsRuntime.getApplicationId().equals(applicationId) || (sharedKafkaStreamsRuntime.getApplicationId().equals(applicationId + "-validation") && !real)) {
return sharedKafkaStreamsRuntime;
}
}
final SharedKafkaStreamsRuntime stream;
final KsqlConfig ksqlConfig = config.getConfig(true);
if (real) {
stream = new SharedKafkaStreamsRuntimeImpl(kafkaStreamsBuilder, getConfiguredQueryErrorClassifier(ksqlConfig, applicationId), ksqlConfig.getInt(KsqlConfig.KSQL_QUERY_ERROR_MAX_QUEUE_SIZE), ksqlConfig.getLong(KsqlConfig.KSQL_SHUTDOWN_TIMEOUT_MS_CONFIG), buildStreamsProperties(applicationId, Optional.empty(), metricCollectors, config.getConfig(true), processingLogContext));
} else {
stream = new SandboxedSharedKafkaStreamsRuntimeImpl(kafkaStreamsBuilder, buildStreamsProperties(applicationId + "-validation", Optional.empty(), metricCollectors, config.getConfig(true), processingLogContext));
}
streams.add(stream);
return stream;
}
Aggregations