Search in sources :

Example 1 with SharedKafkaStreamsRuntimeImpl

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;
}
Also used : SharedKafkaStreamsRuntime(io.confluent.ksql.util.SharedKafkaStreamsRuntime) SandboxedSharedKafkaStreamsRuntimeImpl(io.confluent.ksql.util.SandboxedSharedKafkaStreamsRuntimeImpl) SandboxedSharedKafkaStreamsRuntimeImpl(io.confluent.ksql.util.SandboxedSharedKafkaStreamsRuntimeImpl) SharedKafkaStreamsRuntimeImpl(io.confluent.ksql.util.SharedKafkaStreamsRuntimeImpl) KsqlConfig(io.confluent.ksql.util.KsqlConfig)

Aggregations

KsqlConfig (io.confluent.ksql.util.KsqlConfig)1 SandboxedSharedKafkaStreamsRuntimeImpl (io.confluent.ksql.util.SandboxedSharedKafkaStreamsRuntimeImpl)1 SharedKafkaStreamsRuntime (io.confluent.ksql.util.SharedKafkaStreamsRuntime)1 SharedKafkaStreamsRuntimeImpl (io.confluent.ksql.util.SharedKafkaStreamsRuntimeImpl)1