Skip to content

Commit e03793c

Browse files
RocMarshalXCompWeiZhong94ferenc-csaky
committed
[FLINK-38893][runtime/rest] Introduce the /jobs/:jobid/rescales/overview endpoint in the REST API
Co-authored-by: XComp <mpohl@confluent.io> Co-authored-by: WeiZhong94 <weizhong0618@gmail.com> Co-authored-by: ferenc-csaky <fcsaky@apache.org>
1 parent f37bcd9 commit e03793c

7 files changed

Lines changed: 859 additions & 0 deletions

File tree

docs/layouts/shortcodes/generated/rest_v1_dispatcher.html

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4025,6 +4025,233 @@
40254025
</tr>
40264026
</tbody>
40274027
</table>
4028+
<table class="rest-api table table-bordered">
4029+
<tbody>
4030+
<tr>
4031+
<td class="text-left" colspan="2"><h5><strong>/jobs/:jobid/rescales/overview</strong></h5></td>
4032+
</tr>
4033+
<tr>
4034+
<td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
4035+
<td class="text-left">Response code: <code>200 OK</code></td>
4036+
</tr>
4037+
<tr>
4038+
<td colspan="2">Return job rescales overview.</td>
4039+
</tr>
4040+
<tr>
4041+
<td colspan="2">Path parameters</td>
4042+
</tr>
4043+
<tr>
4044+
<td colspan="2">
4045+
<ul>
4046+
<li><code>jobid</code> - 32-character hexadecimal string value that identifies a job.</li>
4047+
</ul>
4048+
</td>
4049+
</tr>
4050+
<tr>
4051+
<td colspan="2">
4052+
<label>
4053+
<details>
4054+
<summary>Request</summary>
4055+
<pre><code>{}</code></pre>
4056+
</label>
4057+
</td>
4058+
</tr>
4059+
<tr>
4060+
<td colspan="2">
4061+
<label>
4062+
<details>
4063+
<summary>Response</summary>
4064+
<pre><code>{
4065+
"type" : "object",
4066+
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:rescales:JobRescalesOverview",
4067+
"properties" : {
4068+
"latest" : {
4069+
"type" : "object",
4070+
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:rescales:JobRescalesOverview:LatestRescales",
4071+
"properties" : {
4072+
"completed" : {
4073+
"type" : "object",
4074+
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:rescales:JobRescaleDetails",
4075+
"properties" : {
4076+
"endTimestampInMillis" : {
4077+
"type" : "integer"
4078+
},
4079+
"rescaleAttemptId" : {
4080+
"type" : "integer"
4081+
},
4082+
"rescaleUuid" : {
4083+
"type" : "string"
4084+
},
4085+
"resourceRequirementsUuid" : {
4086+
"type" : "string"
4087+
},
4088+
"schedulerStates" : {
4089+
"type" : "array",
4090+
"items" : {
4091+
"type" : "object",
4092+
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:rescales:SchedulerStateSpan",
4093+
"properties" : {
4094+
"durationInMillis" : {
4095+
"type" : "integer"
4096+
},
4097+
"enterTimestampInMillis" : {
4098+
"type" : "integer"
4099+
},
4100+
"leaveTimestampInMillis" : {
4101+
"type" : "integer"
4102+
},
4103+
"state" : {
4104+
"type" : "string"
4105+
},
4106+
"stringifiedException" : {
4107+
"type" : "string"
4108+
}
4109+
}
4110+
}
4111+
},
4112+
"slots" : {
4113+
"type" : "object",
4114+
"additionalProperties" : {
4115+
"type" : "object",
4116+
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:rescales:JobRescaleDetails:SlotSharingGroupRescaleInfo",
4117+
"properties" : {
4118+
"acquiredResourceProfile" : {
4119+
"type" : "object",
4120+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:ResourceProfileInfo"
4121+
},
4122+
"desiredSlots" : {
4123+
"type" : "integer"
4124+
},
4125+
"minimalRequiredSlots" : {
4126+
"type" : "integer"
4127+
},
4128+
"postRescaleSlots" : {
4129+
"type" : "integer"
4130+
},
4131+
"preRescaleSlots" : {
4132+
"type" : "integer"
4133+
},
4134+
"requestResourceProfile" : {
4135+
"type" : "object",
4136+
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:ResourceProfileInfo",
4137+
"properties" : {
4138+
"cpuCores" : {
4139+
"type" : "number"
4140+
},
4141+
"extendedResources" : {
4142+
"type" : "object",
4143+
"additionalProperties" : {
4144+
"type" : "number"
4145+
}
4146+
},
4147+
"managedMemory" : {
4148+
"type" : "integer"
4149+
},
4150+
"networkMemory" : {
4151+
"type" : "integer"
4152+
},
4153+
"taskHeapMemory" : {
4154+
"type" : "integer"
4155+
},
4156+
"taskOffHeapMemory" : {
4157+
"type" : "integer"
4158+
}
4159+
}
4160+
},
4161+
"slotSharingGroupId" : {
4162+
"type" : "any"
4163+
},
4164+
"slotSharingGroupName" : {
4165+
"type" : "string"
4166+
}
4167+
}
4168+
}
4169+
},
4170+
"startTimestampInMillis" : {
4171+
"type" : "integer"
4172+
},
4173+
"terminalState" : {
4174+
"type" : "string",
4175+
"enum" : [ "COMPLETED", "FAILED", "IGNORED" ]
4176+
},
4177+
"terminatedReason" : {
4178+
"type" : "string",
4179+
"enum" : [ "SUCCEEDED", "EXCEPTION_OCCURRED", "RESOURCE_REQUIREMENTS_UPDATED", "NO_RESOURCES_OR_PARALLELISMS_CHANGE", "JOB_FINISHED", "JOB_FAILED", "JOB_CANCELED", "JOB_FAILOVER_RESTARTING" ]
4180+
},
4181+
"triggerCause" : {
4182+
"type" : "string",
4183+
"enum" : [ "INITIAL_SCHEDULE", "UPDATE_REQUIREMENT", "NEW_RESOURCE_AVAILABLE", "RECOVERABLE_FAILOVER" ]
4184+
},
4185+
"vertices" : {
4186+
"type" : "object",
4187+
"additionalProperties" : {
4188+
"type" : "object",
4189+
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:rescales:JobRescaleDetails:VertexParallelismRescaleInfo",
4190+
"properties" : {
4191+
"desiredParallelism" : {
4192+
"type" : "integer"
4193+
},
4194+
"jobVertexId" : {
4195+
"type" : "any"
4196+
},
4197+
"jobVertexName" : {
4198+
"type" : "string"
4199+
},
4200+
"postRescaleParallelism" : {
4201+
"type" : "integer"
4202+
},
4203+
"preRescaleParallelism" : {
4204+
"type" : "integer"
4205+
},
4206+
"slotSharingGroupId" : {
4207+
"type" : "any"
4208+
},
4209+
"slotSharingGroupName" : {
4210+
"type" : "string"
4211+
},
4212+
"sufficientParallelism" : {
4213+
"type" : "integer"
4214+
}
4215+
}
4216+
}
4217+
}
4218+
}
4219+
},
4220+
"failed" : {
4221+
"type" : "object",
4222+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:rescales:JobRescaleDetails"
4223+
},
4224+
"ignored" : {
4225+
"type" : "object",
4226+
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:rescales:JobRescaleDetails"
4227+
}
4228+
}
4229+
},
4230+
"rescalesCounts" : {
4231+
"type" : "object",
4232+
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:rescales:JobRescalesOverview:RescalesCounts",
4233+
"properties" : {
4234+
"completed" : {
4235+
"type" : "integer"
4236+
},
4237+
"failed" : {
4238+
"type" : "integer"
4239+
},
4240+
"ignored" : {
4241+
"type" : "integer"
4242+
},
4243+
"inProgress" : {
4244+
"type" : "integer"
4245+
}
4246+
}
4247+
}
4248+
}
4249+
}</code></pre>
4250+
</label>
4251+
</td>
4252+
</tr>
4253+
</tbody>
4254+
</table>
40284255
<table class="rest-api table table-bordered">
40294256
<tbody>
40304257
<tr>

docs/static/generated/rest_v1_dispatcher.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,24 @@ paths:
981981
type: boolean
982982
items:
983983
$ref: "#/components/schemas/JobRescaleDetails"
984+
/jobs/{jobid}/rescales/overview:
985+
get:
986+
description: Return job rescales overview.
987+
operationId: getJobRescalesOverview
988+
parameters:
989+
- name: jobid
990+
in: path
991+
description: 32-character hexadecimal string value that identifies a job.
992+
required: true
993+
schema:
994+
$ref: "#/components/schemas/JobID"
995+
responses:
996+
"200":
997+
description: The request was successful.
998+
content:
999+
application/json:
1000+
schema:
1001+
$ref: "#/components/schemas/JobRescalesOverview"
9841002
/jobs/{jobid}/rescaling:
9851003
patch:
9861004
description: Triggers the rescaling of a job. This async operation would return
@@ -2856,6 +2874,13 @@ components:
28562874
type: boolean
28572875
items:
28582876
$ref: "#/components/schemas/JobRescaleDetails"
2877+
JobRescalesOverview:
2878+
type: object
2879+
properties:
2880+
latest:
2881+
$ref: "#/components/schemas/LatestRescales"
2882+
rescalesCounts:
2883+
$ref: "#/components/schemas/RescalesCounts"
28592884
JobResourceRequirementsBody:
28602885
type: object
28612886
additionalProperties:
@@ -3017,6 +3042,15 @@ components:
30173042
$ref: "#/components/schemas/RestoredCheckpointStatistics"
30183043
savepoint:
30193044
$ref: "#/components/schemas/CompletedCheckpointStatistics"
3045+
LatestRescales:
3046+
type: object
3047+
properties:
3048+
completed:
3049+
$ref: "#/components/schemas/JobRescaleDetails"
3050+
failed:
3051+
$ref: "#/components/schemas/JobRescaleDetails"
3052+
ignored:
3053+
$ref: "#/components/schemas/JobRescaleDetails"
30203054
LogInfo:
30213055
type: object
30223056
properties:
@@ -3164,6 +3198,21 @@ components:
31643198
upperPart:
31653199
type: integer
31663200
format: int64
3201+
RescalesCounts:
3202+
type: object
3203+
properties:
3204+
completed:
3205+
type: integer
3206+
format: int64
3207+
failed:
3208+
type: integer
3209+
format: int64
3210+
ignored:
3211+
type: integer
3212+
format: int64
3213+
inProgress:
3214+
type: integer
3215+
format: int64
31673216
ResourceID:
31683217
pattern: "[0-9a-f]{32}"
31693218
type: string

0 commit comments

Comments
 (0)