davidradl commented on code in PR #25798:
URL: https://github.com/apache/flink/pull/25798#discussion_r1890448648
##########
flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/jsonplan/JsonPlanGenerator.java:
##########
@@ -170,4 +174,54 @@ public static String generatePlan(
throw new RuntimeException("Failed to generate plan", e);
}
}
+
+ public static String generateStreamGraphJson(
+ StreamGraph sg, Map<Integer, JobVertexID> jobVertexIdMap) {
+ try (final StringWriter writer = new StringWriter(1024)) {
+ try (final JsonGenerator gen = new
JsonFactory().createGenerator(writer)) {
+ // start of everything
+ gen.writeStartObject();
+
+ gen.writeArrayFieldStart("nodes");
+
+ // info per vertex
+ for (StreamNode node : sg.getStreamNodes()) {
+ gen.writeStartObject();
+ gen.writeStringField("id", String.valueOf(node.getId()));
Review Comment:
can we not just deserialize a node (or a cutdown version) of the node object
using Jackson or the like; rather than manually constructing json keys and
values?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]