You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Nikolaos Paraskakis <ni...@gmail.com> on 2023/08/30 14:00:00 UTC

Job graph

Hello folks,

I am trying to get the job graph of a running flink job. I want to use flink libraries. For now, I have the RestClusterClient and the job IDs. Tell me please how to get the job graph.

Thank you.

Re: Job graph

Posted by liu ron <ro...@gmail.com>.
Hi, Nikolaos

As far as I know, JobGraph is a relatively low-level concept, and currently
we don't expose it directly to users, and don't provide a direct Restful
API to get it from JobManager. Why do you need to get JobGraph and what is
your real need?

Best,
Ron

Nikolaos Paraskakis <ni...@gmail.com> 于2023年8月31日周四 01:13写道:

> Hello folks,
>
> I am trying to get the job graph of a running flink job. I want to use
> flink libraries. For now, I have the RestClusterClient and the job IDs.
> Tell me please how to get the job graph.
>
> Thank you.

Re: Job graph

Posted by Shammon FY <zj...@gmail.com>.
Hi Nikolaos,

As Ron said, the jobgraph is a low level structure in flink and it is not
exposed to users now. Currently you can get job details from
`RestClusterClient` in method `getJobDetails(JobID jobId)`, the result
`JobDetailsInfo` contains all vertices in the job and the json format job
plan.

Best,
Shammon FY

On Sat, Sep 2, 2023 at 6:26 AM David Anderson <da...@apache.org> wrote:

> This may or may not help, but you can get the execution plan from
> inside the client, by doing something like this (I printed the plan to
> stderr):
>
>     ...
>     System.err.println(env.getExecutionPlan());
>     env.execute("my job");
>
> The result is a JSON-encoded representation of the job graph, which
> for the simple example I just tried it with, produced this output:
>
> {
>   "nodes" : [ {
>     "id" : 1,
>     "type" : "Source: Custom Source",
>     "pact" : "Data Source",
>     "contents" : "Source: Custom Source",
>     "parallelism" : 10
>   }, {
>     "id" : 3,
>     "type" : "Sink: Writer",
>     "pact" : "Operator",
>     "contents" : "Sink: Writer",
>     "parallelism" : 10,
>     "predecessors" : [ {
>       "id" : 1,
>       "ship_strategy" : "FORWARD",
>       "side" : "second"
>     } ]
>   }, {
>     "id" : 5,
>     "type" : "Sink: Committer",
>     "pact" : "Operator",
>     "contents" : "Sink: Committer",
>     "parallelism" : 10,
>     "predecessors" : [ {
>       "id" : 3,
>       "ship_strategy" : "FORWARD",
>       "side" : "second"
>     } ]
>   } ]
> }
>
> On Wed, Aug 30, 2023 at 7:01 AM Nikolaos Paraskakis
> <ni...@gmail.com> wrote:
> >
> > Hello folks,
> >
> > I am trying to get the job graph of a running flink job. I want to use
> flink libraries. For now, I have the RestClusterClient and the job IDs.
> Tell me please how to get the job graph.
> >
> > Thank you.
>

Re: Job graph

Posted by David Anderson <da...@apache.org>.
This may or may not help, but you can get the execution plan from
inside the client, by doing something like this (I printed the plan to
stderr):

    ...
    System.err.println(env.getExecutionPlan());
    env.execute("my job");

The result is a JSON-encoded representation of the job graph, which
for the simple example I just tried it with, produced this output:

{
  "nodes" : [ {
    "id" : 1,
    "type" : "Source: Custom Source",
    "pact" : "Data Source",
    "contents" : "Source: Custom Source",
    "parallelism" : 10
  }, {
    "id" : 3,
    "type" : "Sink: Writer",
    "pact" : "Operator",
    "contents" : "Sink: Writer",
    "parallelism" : 10,
    "predecessors" : [ {
      "id" : 1,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 5,
    "type" : "Sink: Committer",
    "pact" : "Operator",
    "contents" : "Sink: Committer",
    "parallelism" : 10,
    "predecessors" : [ {
      "id" : 3,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  } ]
}

On Wed, Aug 30, 2023 at 7:01 AM Nikolaos Paraskakis
<ni...@gmail.com> wrote:
>
> Hello folks,
>
> I am trying to get the job graph of a running flink job. I want to use flink libraries. For now, I have the RestClusterClient and the job IDs. Tell me please how to get the job graph.
>
> Thank you.