Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 199 additions & 4 deletions docs/layouts/shortcodes/generated/rest_v1_dispatcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,72 @@
"properties" : {
"plan" : {
"type" : "object",
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:RawJson"
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:Plan",
Copy link
Copy Markdown
Contributor

@akalash akalash Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you been able to check if the result json looks the same? I mean, we should be sure that the old client can safely read the json that is created by this new version

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. the returned response doesn't change (except null fields which are added)
I updated the description with example, wdyt?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it looks good. Two new fields should not be a problem. It's important that the old fields remain the same, and they do.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akalash @Efrat19 thanks for the explanations. From the discussion - this seems reasonable. I am curious as to what the 2 new null fields mean, do we gain anything from them? I am thinking we can now differentiate between a field that does not exist an one that exists but has a null value. Do we have tests that can drive each of these cases? Or is this not an important aspect to this - as they are effectively treated the same?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For nulls, should we mark the fields with @JsonInclude(Include.NON_NULL) (I guess that should hide them if they're null)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Addressed in a followup PR #26488

"properties" : {
"jid" : {
"type" : "string"
},
"name" : {
"type" : "string"
},
"nodes" : {
"type" : "array",
"items" : {
"type" : "object",
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:Plan:Node",
"properties" : {
"description" : {
"type" : "string"
},
"id" : {
"type" : "string"
},
"inputs" : {
"type" : "array",
"items" : {
"type" : "object",
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:Plan:Node:Input",
"properties" : {
"caching" : {
"type" : "string"
},
"exchange" : {
"type" : "string"
},
"id" : {
"type" : "string"
},
"local_strategy" : {
"type" : "string"
},
"num" : {
"type" : "integer"
},
"ship_strategy" : {
"type" : "string"
}
}
}
},
"operator" : {
"type" : "string"
},
"operator_strategy" : {
"type" : "string"
},
"optimizer_properties" : {
"type" : "string"
},
"parallelism" : {
"type" : "integer"
}
}
}
},
"type" : {
"type" : "string"
}
}
}
}
}</code></pre>
Expand Down Expand Up @@ -1126,7 +1191,72 @@
},
"plan" : {
"type" : "object",
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:RawJson"
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:Plan",
"properties" : {
"jid" : {
"type" : "string"
},
"name" : {
"type" : "string"
},
"nodes" : {
"type" : "array",
"items" : {
"type" : "object",
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:Plan:Node",
"properties" : {
"description" : {
"type" : "string"
},
"id" : {
"type" : "string"
},
"inputs" : {
"type" : "array",
"items" : {
"type" : "object",
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:Plan:Node:Input",
"properties" : {
"caching" : {
"type" : "string"
},
"exchange" : {
"type" : "string"
},
"id" : {
"type" : "string"
},
"local_strategy" : {
"type" : "string"
},
"num" : {
"type" : "integer"
},
"ship_strategy" : {
"type" : "string"
}
}
}
},
"operator" : {
"type" : "string"
},
"operator_strategy" : {
"type" : "string"
},
"optimizer_properties" : {
"type" : "string"
},
"parallelism" : {
"type" : "integer"
}
}
}
},
"type" : {
"type" : "string"
}
}
},
"start-time" : {
"type" : "integer"
Expand All @@ -1143,7 +1273,7 @@
},
"stream-graph" : {
"type" : "object",
"$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:RawJson"
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:RawJson"
},
"timestamps" : {
"type" : "object",
Expand Down Expand Up @@ -2879,7 +3009,72 @@
"properties" : {
"plan" : {
"type" : "object",
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:RawJson"
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:Plan",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see there are still several open questions(cc. @davidradl ):

this appears to be an issue with the open api and rest docs - that are not generating correctly.

Kind of, the RawJson didn't generate the proper docs and rest_api indeed looked unreadable with RawJson

the fix seems to be to change the way we do job serialization

Yes, indeed we used to serialize it manually but right now Jackson does it for us based on POJO class but in fact, the serialization remains the same(it's still Jackson) but it just happens in different time/place

on the face of it this seems a large change to a core part of Flink, that could introduce other considerations for example how are existing job serializations effected.

It doesn't look like a big change since, as we discussed in (https://github.com/apache/flink/pull/26320/files#r2022598714), the result JSON hasn't changed. So the only change is the internal representation changed from String to Object and the documentation has more details now.

@Efrat19 maybe you have something to add.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

"properties" : {
"jid" : {
"type" : "string"
},
"name" : {
"type" : "string"
},
"nodes" : {
"type" : "array",
"items" : {
"type" : "object",
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:Plan:Node",
"properties" : {
"description" : {
"type" : "string"
},
"id" : {
"type" : "string"
},
"inputs" : {
"type" : "array",
"items" : {
"type" : "object",
"id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo:Plan:Node:Input",
"properties" : {
"caching" : {
"type" : "string"
},
"exchange" : {
"type" : "string"
},
"id" : {
"type" : "string"
},
"local_strategy" : {
"type" : "string"
},
"num" : {
"type" : "integer"
},
"ship_strategy" : {
"type" : "string"
}
}
}
},
"operator" : {
"type" : "string"
},
"operator_strategy" : {
"type" : "string"
},
"optimizer_properties" : {
"type" : "string"
},
"parallelism" : {
"type" : "integer"
}
}
}
},
"type" : {
"type" : "string"
}
}
}
}
}</code></pre>
Expand Down
55 changes: 52 additions & 3 deletions docs/static/generated/rest_v1_dispatcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ info:
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: v1/2.0-SNAPSHOT
version: v1/2.1-SNAPSHOT
paths:
/cluster:
delete:
Expand Down Expand Up @@ -2149,6 +2149,22 @@ components:
enum:
- IN_PROGRESS
- COMPLETED
Input:
type: object
properties:
caching:
type: string
exchange:
type: string
id:
type: string
local_strategy:
type: string
num:
type: integer
format: int64
ship_strategy:
type: string
IntermediateDataSetID:
pattern: "[0-9a-f]{32}"
type: string
Expand Down Expand Up @@ -2337,7 +2353,7 @@ components:
type: integer
format: int32
plan:
$ref: '#/components/schemas/RawJson'
$ref: '#/components/schemas/Plan'
start-time:
type: integer
format: int64
Expand Down Expand Up @@ -2436,7 +2452,7 @@ components:
type: object
properties:
plan:
$ref: '#/components/schemas/RawJson'
$ref: '#/components/schemas/Plan'
JobResourceRequirementsBody:
type: object
additionalProperties:
Expand Down Expand Up @@ -2663,6 +2679,39 @@ components:
type: object
allOf:
- $ref: '#/components/schemas/SubtaskCheckpointStatistics'
Plan:
type: object
properties:
jid:
type: string
name:
type: string
nodes:
type: array
items:
$ref: '#/components/schemas/PlanNode'
type:
type: string
PlanNode:
type: object
properties:
description:
type: string
id:
type: string
inputs:
type: array
items:
$ref: '#/components/schemas/Input'
operator:
type: string
operator_strategy:
type: string
optimizer_properties:
type: string
parallelism:
type: integer
format: int64
ProcessingMode:
type: string
enum:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ void testJobDetailsContainsSlotSharingGroupId() throws Exception {
Collections.singletonMap(JobStatus.RUNNING, 1L),
jobVertexDetailsInfos,
Collections.singletonMap(ExecutionState.RUNNING, 1),
new JobPlanInfo.RawJson("{\"id\":\"1234\"}"),
new JobPlanInfo.Plan("1243", "", "", new ArrayList<>()),
new JobPlanInfo.RawJson("{\"id\":\"1234\"}"),
0);
final TestJobDetailsInfoHandler jobDetailsInfoHandler =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void testJarSubmission(@TempDir File uploadDir, @TempDir File temporaryFolder)
final JobPlanInfo planResponse = showPlan(planHandler, storedJarName, restfulGateway);
// we're only interested in the core functionality so checking for a small detail is
// sufficient
assertThat(planResponse.getJsonPlan()).contains("\"name\":\"Flink Streaming Job\"");
assertThat(planResponse.getPlan().getName()).isEqualTo("Flink Streaming Job");

runJar(runHandler, storedJarName, restfulGateway);

Expand Down
Loading