Search in sources :

Example 1 with JLineTerminal

use of io.confluent.ksql.cli.console.JLineTerminal in project ksql by confluentinc.

the class Ksql method main.

public static void main(String[] args) throws IOException {
    final Options options = args.length == 0 ? Options.parse("http://localhost:8088") : Options.parse(args);
    if (options == null) {
        System.exit(-1);
    }
    final Properties properties = loadProperties(options.getConfigFile());
    final KsqlRestClient restClient = new KsqlRestClient(options.getServer(), properties);
    options.getUserNameAndPassword().ifPresent(creds -> restClient.setupAuthenticationCredentials(creds.left, creds.right));
    final KsqlVersionCheckerAgent versionChecker = new KsqlVersionCheckerAgent();
    versionChecker.start(KsqlModuleType.REMOTE_CLI, properties);
    try (final Cli cli = new Cli(options.getStreamedQueryRowLimit(), options.getStreamedQueryTimeoutMs(), restClient, new JLineTerminal(options.getOutputFormat(), restClient))) {
        cli.runInteractively();
    }
}
Also used : JLineTerminal(io.confluent.ksql.cli.console.JLineTerminal) Options(io.confluent.ksql.cli.Options) KsqlRestClient(io.confluent.ksql.rest.client.KsqlRestClient) Cli(io.confluent.ksql.cli.Cli) Properties(java.util.Properties) KsqlVersionCheckerAgent(io.confluent.ksql.version.metrics.KsqlVersionCheckerAgent)

Aggregations

Cli (io.confluent.ksql.cli.Cli)1 Options (io.confluent.ksql.cli.Options)1 JLineTerminal (io.confluent.ksql.cli.console.JLineTerminal)1 KsqlRestClient (io.confluent.ksql.rest.client.KsqlRestClient)1 KsqlVersionCheckerAgent (io.confluent.ksql.version.metrics.KsqlVersionCheckerAgent)1 Properties (java.util.Properties)1