2828import org .apache .flink .client .program .rest .RestClusterClient ;
2929import org .apache .flink .configuration .Configuration ;
3030import org .apache .flink .runtime .highavailability .nonha .standalone .StandaloneClientHAServices ;
31+ import org .apache .flink .runtime .jobgraph .JobType ;
3132import org .apache .flink .runtime .jobgraph .JobVertexID ;
3233import org .apache .flink .runtime .rest .messages .JobPlanInfo ;
3334import org .apache .flink .runtime .rest .messages .MessageHeaders ;
@@ -79,6 +80,7 @@ public void testJobTopologyParsingFromJobDetails() throws Exception {
7980 + " \" name\" : \" State machine job\" ,\n "
8081 + " \" isStoppable\" : false,\n "
8182 + " \" state\" : \" RUNNING\" ,\n "
83+ + " \" job-type\" : \" STREAMING\" ,\n "
8284 + " \" start-time\" : 1707893512027,\n "
8385 + " \" end-time\" : -1,\n "
8486 + " \" duration\" : 214716,\n "
@@ -237,6 +239,7 @@ public void testJobTopologyParsingThrowsNotReadyException() throws Exception {
237239 + " \" name\" : \" State machine job\" ,\n "
238240 + " \" isStoppable\" : false,\n "
239241 + " \" state\" : \" RUNNING\" ,\n "
242+ + " \" job-type\" : \" STREAMING\" ,\n "
240243 + " \" start-time\" : 1707893512027,\n "
241244 + " \" end-time\" : -1,\n "
242245 + " \" duration\" : 214716,\n "
@@ -357,7 +360,7 @@ public void testJobTopologyParsingThrowsNotReadyException() throws Exception {
357360 @ Test
358361 public void testJobTopologyParsingFromJobDetailsWithSlotSharingGroup () throws Exception {
359362 String s =
360- "{\" jid\" :\" a1b1b53c7c71e7199aa8c43bc703fe7f\" ,\" name\" :\" basic-example\" ,\" isStoppable\" :false,\" state\" :\" RUNNING\" ,\" start-time\" :1697114719143,\" end-time\" :-1,\" duration\" :60731,\" maxParallelism\" :-1,\" now\" :1697114779874,\" timestamps\" :{\" CANCELLING\" :0,\" INITIALIZING\" :1697114719143,\" RUNNING\" :1697114719743,\" CANCELED\" :0,\" FINISHED\" :0,\" FAILED\" :0,\" RESTARTING\" :0,\" FAILING\" :0,\" CREATED\" :1697114719343,\" SUSPENDED\" :0,\" RECONCILING\" :0},\" vertices\" :[{\" id\" :\" bc764cd8ddf7a0cff126f51c16239658\" ,\" slotSharingGroupId\" :\" a9c52ec4c7200ab4bd141cbae8022105\" ,\" name\" :\" Source: Events Generator Source\" ,\" maxParallelism\" :128,\" parallelism\" :2,\" status\" :\" RUNNING\" ,\" start-time\" :1697114724603,\" end-time\" :-1,\" duration\" :55271,\" tasks\" :{\" FAILED\" :0,\" CANCELED\" :0,\" SCHEDULED\" :0,\" FINISHED\" :0,\" CREATED\" :0,\" DEPLOYING\" :0,\" CANCELING\" :0,\" RECONCILING\" :0,\" INITIALIZING\" :0,\" RUNNING\" :2},\" metrics\" :{\" read-bytes\" :0,\" read-bytes-complete\" :true,\" write-bytes\" :1985978,\" write-bytes-complete\" :true,\" read-records\" :0,\" read-records-complete\" :true,\" write-records\" :92037,\" write-records-complete\" :true,\" accumulated-backpressured-time\" :0,\" accumulated-idle-time\" :78319,\" accumulated-busy-time\" :13347.0}},{\" id\" :\" 20ba6b65f97481d5570070de90e4e791\" ,\" slotSharingGroupId\" :\" a9c52ec4c7200ab4bd141cbae8022105\" ,\" name\" :\" Flat Map -> Sink: Print to Std. Out\" ,\" maxParallelism\" :128,\" parallelism\" :2,\" status\" :\" RUNNING\" ,\" start-time\" :1697114724639,\" end-time\" :-1,\" duration\" :55235,\" tasks\" :{\" FAILED\" :0,\" CANCELED\" :0,\" SCHEDULED\" :0,\" FINISHED\" :0,\" CREATED\" :0,\" DEPLOYING\" :0,\" CANCELING\" :0,\" RECONCILING\" :0,\" INITIALIZING\" :0,\" RUNNING\" :2},\" metrics\" :{\" read-bytes\" :2019044,\" read-bytes-complete\" :true,\" write-bytes\" :0,\" write-bytes-complete\" :true,\" read-records\" :91881,\" read-records-complete\" :true,\" write-records\" :0,\" write-records-complete\" :true,\" accumulated-backpressured-time\" :0,\" accumulated-idle-time\" :91352,\" accumulated-busy-time\" :273.0}}],\" status-counts\" :{\" FAILED\" :0,\" CANCELED\" :0,\" SCHEDULED\" :0,\" FINISHED\" :0,\" CREATED\" :0,\" DEPLOYING\" :0,\" CANCELING\" :0,\" RECONCILING\" :0,\" INITIALIZING\" :0,\" RUNNING\" :2},\" plan\" :{\" jid\" :\" a1b1b53c7c71e7199aa8c43bc703fe7f\" ,\" name\" :\" basic-example\" ,\" type\" :\" STREAMING\" ,\" nodes\" :[{\" id\" :\" 20ba6b65f97481d5570070de90e4e791\" ,\" parallelism\" :2,\" operator\" :\" \" ,\" operator_strategy\" :\" \" ,\" description\" :\" Flat Map<br/>+- Sink: Print to Std. Out<br/>\" ,\" operator_metadata\" :[{},{}],\" inputs\" :[{\" num\" :0,\" id\" :\" bc764cd8ddf7a0cff126f51c16239658\" ,\" ship_strategy\" :\" HASH\" ,\" exchange\" :\" pipelined_bounded\" }],\" optimizer_properties\" :{}},{\" id\" :\" bc764cd8ddf7a0cff126f51c16239658\" ,\" parallelism\" :2,\" operator\" :\" \" ,\" operator_strategy\" :\" \" ,\" description\" :\" Source: Events Generator Source<br/>\" ,\" operator_metadata\" :[{}],\" optimizer_properties\" :{}}]}}\n " ;
363+ "{\" jid\" :\" a1b1b53c7c71e7199aa8c43bc703fe7f\" ,\" name\" :\" basic-example\" ,\" isStoppable\" :false,\" state\" :\" RUNNING\" ,\" job-type\" :\" STREAMING\" ,\" start-time\" :1697114719143,\" end-time\" :-1,\" duration\" :60731,\" maxParallelism\" :-1,\" now\" :1697114779874,\" timestamps\" :{\" CANCELLING\" :0,\" INITIALIZING\" :1697114719143,\" RUNNING\" :1697114719743,\" CANCELED\" :0,\" FINISHED\" :0,\" FAILED\" :0,\" RESTARTING\" :0,\" FAILING\" :0,\" CREATED\" :1697114719343,\" SUSPENDED\" :0,\" RECONCILING\" :0},\" vertices\" :[{\" id\" :\" bc764cd8ddf7a0cff126f51c16239658\" ,\" slotSharingGroupId\" :\" a9c52ec4c7200ab4bd141cbae8022105\" ,\" name\" :\" Source: Events Generator Source\" ,\" maxParallelism\" :128,\" parallelism\" :2,\" status\" :\" RUNNING\" ,\" start-time\" :1697114724603,\" end-time\" :-1,\" duration\" :55271,\" tasks\" :{\" FAILED\" :0,\" CANCELED\" :0,\" SCHEDULED\" :0,\" FINISHED\" :0,\" CREATED\" :0,\" DEPLOYING\" :0,\" CANCELING\" :0,\" RECONCILING\" :0,\" INITIALIZING\" :0,\" RUNNING\" :2},\" metrics\" :{\" read-bytes\" :0,\" read-bytes-complete\" :true,\" write-bytes\" :1985978,\" write-bytes-complete\" :true,\" read-records\" :0,\" read-records-complete\" :true,\" write-records\" :92037,\" write-records-complete\" :true,\" accumulated-backpressured-time\" :0,\" accumulated-idle-time\" :78319,\" accumulated-busy-time\" :13347.0}},{\" id\" :\" 20ba6b65f97481d5570070de90e4e791\" ,\" slotSharingGroupId\" :\" a9c52ec4c7200ab4bd141cbae8022105\" ,\" name\" :\" Flat Map -> Sink: Print to Std. Out\" ,\" maxParallelism\" :128,\" parallelism\" :2,\" status\" :\" RUNNING\" ,\" start-time\" :1697114724639,\" end-time\" :-1,\" duration\" :55235,\" tasks\" :{\" FAILED\" :0,\" CANCELED\" :0,\" SCHEDULED\" :0,\" FINISHED\" :0,\" CREATED\" :0,\" DEPLOYING\" :0,\" CANCELING\" :0,\" RECONCILING\" :0,\" INITIALIZING\" :0,\" RUNNING\" :2},\" metrics\" :{\" read-bytes\" :2019044,\" read-bytes-complete\" :true,\" write-bytes\" :0,\" write-bytes-complete\" :true,\" read-records\" :91881,\" read-records-complete\" :true,\" write-records\" :0,\" write-records-complete\" :true,\" accumulated-backpressured-time\" :0,\" accumulated-idle-time\" :91352,\" accumulated-busy-time\" :273.0}}],\" status-counts\" :{\" FAILED\" :0,\" CANCELED\" :0,\" SCHEDULED\" :0,\" FINISHED\" :0,\" CREATED\" :0,\" DEPLOYING\" :0,\" CANCELING\" :0,\" RECONCILING\" :0,\" INITIALIZING\" :0,\" RUNNING\" :2},\" plan\" :{\" jid\" :\" a1b1b53c7c71e7199aa8c43bc703fe7f\" ,\" name\" :\" basic-example\" ,\" type\" :\" STREAMING\" ,\" nodes\" :[{\" id\" :\" 20ba6b65f97481d5570070de90e4e791\" ,\" parallelism\" :2,\" operator\" :\" \" ,\" operator_strategy\" :\" \" ,\" description\" :\" Flat Map<br/>+- Sink: Print to Std. Out<br/>\" ,\" operator_metadata\" :[{},{}],\" inputs\" :[{\" num\" :0,\" id\" :\" bc764cd8ddf7a0cff126f51c16239658\" ,\" ship_strategy\" :\" HASH\" ,\" exchange\" :\" pipelined_bounded\" }],\" optimizer_properties\" :{}},{\" id\" :\" bc764cd8ddf7a0cff126f51c16239658\" ,\" parallelism\" :2,\" operator\" :\" \" ,\" operator_strategy\" :\" \" ,\" description\" :\" Source: Events Generator Source<br/>\" ,\" operator_metadata\" :[{}],\" optimizer_properties\" :{}}]}}\n " ;
361364 JobDetailsInfo jobDetailsInfo = new ObjectMapper ().readValue (s , JobDetailsInfo .class );
362365
363366 var metricsCollector = new RestApiMetricsCollector ();
@@ -372,6 +375,7 @@ public void testJobUpdateTsLogic() {
372375 "" ,
373376 false ,
374377 org .apache .flink .api .common .JobStatus .RUNNING ,
378+ JobType .STREAMING ,
375379 0 ,
376380 0 ,
377381 0 ,
0 commit comments