Search in sources :

Example 1 with DistributingExecutor

use of io.confluent.ksql.rest.server.computation.DistributingExecutor in project ksql by confluentinc.

the class KsqlResource method configure.

@Override
public void configure(final KsqlConfig config) {
    if (!config.getKsqlStreamConfigProps().containsKey(StreamsConfig.APPLICATION_SERVER_CONFIG)) {
        throw new IllegalArgumentException("Need KS application server set");
    }
    final String applicationServer = (String) config.getKsqlStreamConfigProps().get(StreamsConfig.APPLICATION_SERVER_CONFIG);
    final HostInfo hostInfo = ServerUtil.parseHostInfo(applicationServer);
    this.localHost = new KsqlHostInfo(hostInfo.host(), hostInfo.port());
    try {
        this.localUrl = new URL(applicationServer);
    } catch (final Exception e) {
        throw new IllegalStateException("Failed to convert remote host info to URL." + " remoteInfo: " + localHost.host() + ":" + localHost.host());
    }
    this.validator = new RequestValidator(CustomValidators.VALIDATOR_MAP, injectorFactory, ksqlEngine::createSandbox, new ValidatedCommandFactory());
    this.handler = new RequestHandler(customExecutors.EXECUTOR_MAP, new DistributingExecutor(config, commandRunner.getCommandQueue(), distributedCmdResponseTimeout, injectorFactory, authorizationValidator, new ValidatedCommandFactory(), errorHandler, commandRunnerWarning), ksqlEngine, new DefaultCommandQueueSync(commandRunner.getCommandQueue(), this::shouldSynchronize, distributedCmdResponseTimeout));
}
Also used : DistributingExecutor(io.confluent.ksql.rest.server.computation.DistributingExecutor) RequestValidator(io.confluent.ksql.rest.server.validation.RequestValidator) RequestHandler(io.confluent.ksql.rest.server.execution.RequestHandler) KsqlHostInfo(io.confluent.ksql.util.KsqlHostInfo) DefaultCommandQueueSync(io.confluent.ksql.rest.server.execution.DefaultCommandQueueSync) ValidatedCommandFactory(io.confluent.ksql.rest.server.computation.ValidatedCommandFactory) HostInfo(org.apache.kafka.streams.state.HostInfo) KsqlHostInfo(io.confluent.ksql.util.KsqlHostInfo) URL(java.net.URL) PatternSyntaxException(java.util.regex.PatternSyntaxException) KsqlException(io.confluent.ksql.util.KsqlException) KsqlStatementException(io.confluent.ksql.util.KsqlStatementException)

Aggregations

DistributingExecutor (io.confluent.ksql.rest.server.computation.DistributingExecutor)1 ValidatedCommandFactory (io.confluent.ksql.rest.server.computation.ValidatedCommandFactory)1 DefaultCommandQueueSync (io.confluent.ksql.rest.server.execution.DefaultCommandQueueSync)1 RequestHandler (io.confluent.ksql.rest.server.execution.RequestHandler)1 RequestValidator (io.confluent.ksql.rest.server.validation.RequestValidator)1 KsqlException (io.confluent.ksql.util.KsqlException)1 KsqlHostInfo (io.confluent.ksql.util.KsqlHostInfo)1 KsqlStatementException (io.confluent.ksql.util.KsqlStatementException)1 URL (java.net.URL)1 PatternSyntaxException (java.util.regex.PatternSyntaxException)1 HostInfo (org.apache.kafka.streams.state.HostInfo)1