zentol commented on a change in pull request #10200: [FLINK-14062][runtime]
Calculate managed memory fraction based on slot sharing groups
URL: https://github.com/apache/flink/pull/10200#discussion_r346882291
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGenerator.java
##########
@@ -684,6 +689,96 @@ private void setCoLocation() {
}
}
+ private void setManagedMemoryFraction() {
+ // all slot sharing groups in this job
+ final Set<SlotSharingGroup> slotSharingGroups =
Collections.newSetFromMap(new IdentityHashMap<>());
+ // maps a job vertex ID to its head operator ID
+ final Map<JobVertexID, Integer> vertexHeadOperators = new
HashMap<>();
+ // maps a job vertex ID to IDs of all operators in the vertex
+ final Map<JobVertexID, Set<Integer>> vertexOperators = new
HashMap<>();
+
+ for (Entry<Integer, JobVertex> entry : jobVertices.entrySet()) {
Review comment:
let's pass this map (and any other accessed collection) as an argument. We
may be able to make these methods static then. The StreamingJobGraphGenerator
is terrible because every method is mutating fields willy-nilly, making this a
tad more explicit is worth it in the long run...
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services