Querying the Job Execution Plan

Function

This API is used to query a job execution plan.

Debugging

You can debug this API in API Explorer.

URI

  • URI format

    GET /v1.0/{project_id}/streaming/jobs/{job_id}/execute-graph

  • Parameter description
    Table 1 URI parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID, which is used for resource isolation. For details about how to obtain its value, see Obtaining a Project ID.

    job_id

    Yes

    Long

    Job ID.

Request

None

Response

Table 2 Response parameters

Parameter

Mandatory

Type

Description

is_success

No

Boolean

Whether the request is successful.

message

No

String

Message content.

execute_graph

No

Object

Response parameter for querying a job plan. For details, see Table 3.

Table 3 execute_graph parameters

Parameter

Mandatory

Type

Description

jid

No

String

ID of a Flink job.

name

No

String

Name of a Flink job.

isStoppable

No

Boolean

Whether a job can be stopped.

state

No

String

Execution status of a job.

start-time

No

Long

Time when a job is started.

end-time

No

Long

Time when a job is stopped.

duration

No

Long

Running duration of a job.

Example

  • Example request
    None
  • Example response
    {
        "is_success": "true",
      "message": "Querying the job execution graph succeeds.",
        "execute_graph": {
            "jid": "4e966f43f2c90b0e1bf3188ecf55504b",
            "name": "",
            "isStoppable": false,
            "state": "RUNNING",
            "start-time": 1578904488436,
            "end-time": -1,
            "duration": 516274,
            "now": 1578905004710,
            "timestamps": {
                "FAILING": 0,
                "SUSPENDING": 0,
                "FAILED": 0,
                "FINISHED": 0,
                "RESTARTING": 0,
                "RUNNING": 1578904488665,
                "CANCELED": 0,
                "SUSPENDED": 0,
                "CREATED": 1578904488436,
                "CANCELLING": 0,
                "RECONCILING": 0
            },
            "vertices": [
                {
                    "id": "bc764cd8ddf7a0cff126f51c16239658",
                    "name": "Source: DIS_128_CAR_INFOS",
                    "parallelism": 1,
                    "status": "RUNNING",
                    "start-time": 1578904505130,
                    "end-time": -1,
                    "duration": 499580,
                    "tasks": {
                        "SCHEDULED": 0,
                        "RUNNING": 1,
                        "RECONCILING": 0,
                        "FINISHED": 0,
                        "DEPLOYING": 0,
                        "CREATED": 0,
                        "CANCELING": 0,
                        "FAILED": 0,
                        "CANCELED": 0
                    },
                    "metrics": {
                        "read-bytes": 0,
                        "read-bytes-complete": true,
                        "write-bytes": 0,
                        "write-bytes-complete": true,
                        "read-records": 0,
                        "read-records-complete": true,
                        "write-records": 50,
                        "write-records-complete": true
                    },
                    "backpressure-level": "ok"
                },
                {
                    "id": "6cdc5bb954874d922eaee11a8e7b5dd5",
                    "name": "Source: Custom Source -> select: (_UTF-16LE'1' AS CAR_ID, _UTF-16LE'lilei' AS CAR_OWNER, _UTF-16LE'bmw320i' AS CAR_BRAND, 28 AS CAR_PRICE) -> to: Tuple2 -> Flat Map",
                    "parallelism": 1,
                    "status": "FINISHED",
                    "start-time": 1578904505138,
                    "end-time": 1578904506009,
                    "duration": 871,
                    "tasks": {
                        "SCHEDULED": 0,
                        "RUNNING": 0,
                        "RECONCILING": 0,
                        "FINISHED": 1,
                        "DEPLOYING": 0,
                        "CREATED": 0,
                        "CANCELING": 0,
                        "FAILED": 0,
                        "CANCELED": 0
                    },
                    "metrics": {
                        "read-bytes": 0,
                        "read-bytes-complete": true,
                        "write-bytes": 0,
                        "write-bytes-complete": true,
                        "read-records": 0,
                        "read-records-complete": true,
                        "write-records": 1,
                        "write-records-complete": true
                    }
                },
                {
                    "id": "2963852293169ba90d9d1e7d6308db5c",
                    "name": "Source: Custom Source -> select: (_UTF-16LE'2' AS CAR_ID, _UTF-16LE'hanmeimei' AS CAR_OWNER, _UTF-16LE'audia4' AS CAR_BRAND, 27 AS CAR_PRICE) -> to: Tuple2 -> Flat Map",
                    "parallelism": 1,
                    "status": "FINISHED",
                    "start-time": 1578904505140,
                    "end-time": 1578904506017,
                    "duration": 877,
                    "tasks": {
                        "SCHEDULED": 0,
                        "RUNNING": 0,
                        "RECONCILING": 0,
                        "FINISHED": 1,
                        "DEPLOYING": 0,
                        "CREATED": 0,
                        "CANCELING": 0,
                        "FAILED": 0,
                        "CANCELED": 0
                    },
                    "metrics": {
                        "read-bytes": 0,
                        "read-bytes-complete": true,
                        "write-bytes": 0,
                        "write-bytes-complete": true,
                        "read-records": 0,
                        "read-records-complete": true,
                        "write-records": 1,
                        "write-records-complete": true
                    }
                },
                {
                    "id": "c9235a26195589826000b27f7d761f13",
                    "name": "Map -> where: (AND(LIKE(CAR_BRAND, _UTF-16LE'audi%'), <(CAR_PRICE, 30))), select: (CAR_ID, CAR_OWNER, CAR_BRAND, CAR_PRICE) -> to: Tuple2 -> Flat Map",
                    "parallelism": 1,
                    "status": "RUNNING",
                    "start-time": 1578904505141,
                    "end-time": -1,
                    "duration": 499569,
                    "tasks": {
                        "SCHEDULED": 0,
                        "RUNNING": 1,
                        "RECONCILING": 0,
                        "FINISHED": 0,
                        "DEPLOYING": 0,
                        "CREATED": 0,
                        "CANCELING": 0,
                        "FAILED": 0,
                        "CANCELED": 0
                    },
                    "metrics": {
                        "read-bytes": 1495,
                        "read-bytes-complete": true,
                        "write-bytes": 0,
                        "write-bytes-complete": true,
                        "read-records": 50,
                        "read-records-complete": true,
                        "write-records": 49,
                        "write-records-complete": true
                    },
                    "backpressure-level": "ok"
                },
                {
                    "id": "15262ed2e480542a546ce9514170c8bf",
                    "name": "Sink: AUDI_CHEAPER_THAN_30W",
                    "parallelism": 1,
                    "status": "RUNNING",
                    "start-time": 1578904505276,
                    "end-time": -1,
                    "duration": 499434,
                    "tasks": {
                        "SCHEDULED": 0,
                        "RUNNING": 1,
                        "RECONCILING": 0,
                        "FINISHED": 0,
                        "DEPLOYING": 0,
                        "CREATED": 0,
                        "CANCELING": 0,
                        "FAILED": 0,
                        "CANCELED": 0
                    },
                    "metrics": {
                        "read-bytes": 2695,
                        "read-bytes-complete": true,
                        "write-bytes": 0,
                        "write-bytes-complete": true,
                        "read-records": 49,
                        "read-records-complete": true,
                        "write-records": 0,
                        "write-records-complete": true
                    },
                    "backpressure-level": "ok"
                },
                {
                    "id": "6a739966c5220e4a0f256fe41d02793b",
                    "name": "Sink: CAR_INFO_DATA",
                    "parallelism": 1,
                    "status": "FINISHED",
                    "start-time": 1578904505277,
                    "end-time": 1578904506843,
                    "duration": 1566,
                    "tasks": {
                        "SCHEDULED": 0,
                        "RUNNING": 0,
                        "RECONCILING": 0,
                        "FINISHED": 1,
                        "DEPLOYING": 0,
                        "CREATED": 0,
                        "CANCELING": 0,
                        "FAILED": 0,
                        "CANCELED": 0
                    },
                    "metrics": {
                        "read-bytes": 56,
                        "read-bytes-complete": true,
                        "write-bytes": 0,
                        "write-bytes-complete": true,
                        "read-records": 1,
                        "read-records-complete": true,
                        "write-records": 0,
                        "write-records-complete": true
                    }
                },
                {
                    "id": "ac1799ab18d143a12ca3550fb1dfc3a5",
                    "name": "Sink: CAR_INFO_DATA",
                    "parallelism": 1,
                    "status": "FINISHED",
                    "start-time": 1578904505279,
                    "end-time": 1578904506711,
                    "duration": 1432,
                    "tasks": {
                        "SCHEDULED": 0,
                        "RUNNING": 0,
                        "RECONCILING": 0,
                        "FINISHED": 1,
                        "DEPLOYING": 0,
                        "CREATED": 0,
                        "CANCELING": 0,
                        "FAILED": 0,
                        "CANCELED": 0
                    },
                    "metrics": {
                        "read-bytes": 59,
                        "read-bytes-complete": true,
                        "write-bytes": 0,
                        "write-bytes-complete": true,
                        "read-records": 1,
                        "read-records-complete": true,
                        "write-records": 0,
                        "write-records-complete": true
                    }
                }
            ],
            "status-counts": {
                "SCHEDULED": 0,
                "RUNNING": 3,
                "RECONCILING": 0,
                "FINISHED": 4,
                "DEPLOYING": 0,
                "CREATED": 0,
                "CANCELING": 0,
                "FAILED": 0,
                "CANCELED": 0
            },
            "jmx-metric-port": -1,
            "plan": {
                "jid": "4e966f43f2c90b0e1bf3188ecf55504b",
                "name": "",
                "nodes": [
                    {
                        "id": "15262ed2e480542a546ce9514170c8bf",
                        "parallelism": 1,
                        "operator": "",
                        "operator_strategy": "",
                        "description": "Sink: AUDI_CHEAPER_THAN_30W",
                        "inputs": [
                            {
                                "num": 0,
                                "id": "c9235a26195589826000b27f7d761f13",
                                "ship_strategy": "FORWARD",
                                "exchange": "pipelined_bounded"
                            }
                        ],
                        "optimizer_properties": {}
                    },
                    {
                        "id": "c9235a26195589826000b27f7d761f13",
                        "parallelism": 1,
                        "operator": "",
                        "operator_strategy": "",
                        "description": "Map -&gt; where: (AND(LIKE(CAR_BRAND, _UTF-16LE'audi%'), &lt;(CAR_PRICE, 30))), select: (CAR_ID, CAR_OWNER, CAR_BRAND, CAR_PRICE) -&gt; to: Tuple2 -&gt; Flat Map",
                        "inputs": [
                            {
                                "num": 0,
                                "id": "bc764cd8ddf7a0cff126f51c16239658",
                                "ship_strategy": "FORWARD",
                                "exchange": "pipelined_bounded"
                            }
                        ],
                        "optimizer_properties": {}
                    },
                    {
                        "id": "bc764cd8ddf7a0cff126f51c16239658",
                        "parallelism": 1,
                        "operator": "",
                        "operator_strategy": "",
                        "description": "Source: DIS_128_CAR_INFOS",
                        "optimizer_properties": {}
                    },
                    {
                        "id": "6a739966c5220e4a0f256fe41d02793b",
                        "parallelism": 1,
                        "operator": "",
                        "operator_strategy": "",
                        "description": "Sink: CAR_INFO_DATA",
                        "inputs": [
                            {
                                "num": 0,
                                "id": "6cdc5bb954874d922eaee11a8e7b5dd5",
                                "ship_strategy": "FORWARD",
                                "exchange": "pipelined_bounded"
                            }
                        ],
                        "optimizer_properties": {}
                    },
                    {
                        "id": "6cdc5bb954874d922eaee11a8e7b5dd5",
                        "parallelism": 1,
                        "operator": "",
                        "operator_strategy": "",
                        "description": "Source: Custom Source -&gt; select: (_UTF-16LE'1' AS CAR_ID, _UTF-16LE'lilei' AS CAR_OWNER, _UTF-16LE'bmw320i' AS CAR_BRAND, 28 AS CAR_PRICE) -&gt; to: Tuple2 -&gt; Flat Map",
                        "optimizer_properties": {}
                    },
                    {
                        "id": "ac1799ab18d143a12ca3550fb1dfc3a5",
                        "parallelism": 1,
                        "operator": "",
                        "operator_strategy": "",
                        "description": "Sink: CAR_INFO_DATA",
                        "inputs": [
                            {
                                "num": 0,
                                "id": "2963852293169ba90d9d1e7d6308db5c",
                                "ship_strategy": "FORWARD",
                                "exchange": "pipelined_bounded"
                            }
                        ],
                        "optimizer_properties": {}
                    },
                    {
                        "id": "2963852293169ba90d9d1e7d6308db5c",
                        "parallelism": 1,
                        "operator": "",
                        "operator_strategy": "",
                        "description": "Source: Custom Source -&gt; select: (_UTF-16LE'2' AS CAR_ID, _UTF-16LE'hanmeimei' AS CAR_OWNER, _UTF-16LE'audia4' AS CAR_BRAND, 27 AS CAR_PRICE) -&gt; to: Tuple2 -&gt; Flat Map",
                        "optimizer_properties": {}
                    }
                ]
            }
        }
    }

Status Codes

Table 4 Status codes

Status Code

Description

200

Querying the job execution plan succeeds.

400

The input parameter is invalid.

Error Codes

If an error occurs when this API is invoked, the system does not return the result similar to the preceding example, but returns the error code and error information. For details, see Error Code.