简体   繁体   中英

Controlling Apache-Kafka and Flink through SCALA (Not Command Line)

Using Kafka/FLink command line - "commands " in SCALA Code

Currently When I submit jobs to Flink, its through the command line. Same as for creating and Deleting Kafka Topics.

Is there an Scala - API for controlling the execution of command line Interface commands. So based on a condition in an application I can submit a job to flink and create/delete kafka from the code.

Commands I would like to use in Scala Code

Starting Flink Server
    bin/start-local.sh

Stopping Flink Server
    bin/stop-local.sh

Submitting Job Flink
    bin/flink run -c pathToMainClass pathToJar arg1 arg2

Creating topics in kafka

Deleting kafka topics

Cancelling a job (ID)
...

Regards

Flink's REST api can be used to submit and cancel jobs.

For creating and deleting Kafka topics, I would look at Kafka's Admin API .

As for APIs for controlling Flink's services, you might be better off waiting for the ongoing work on FLIP-6 to be completed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM