Search code examples
javaapache-flinkdistributed-computingflink-streaming

Does Flink provide Java API to submit jobs to JobManager?


I know Jobs can be submit to JobManager by flink or flink.bat. I wanna know whether Flink provides Java API to submit jobs to JobManager?


Solution

  • Yes. Depending on the type of cluster you want to connect, there are several implementations of the ClusterClient (https://ci.apache.org/projects/flink/flink-docs-release-1.3/api/java/org/apache/flink/client/program/ClusterClient.html).

    It can run jobs either in a blocking (synchronous) or detached (asynchronous) fashion. One way of deploying a job is to provide a PackagedProgram, which consists of a JAR file with a Main Class and several supporting JAR files (additional libraries required specifically for the job).