zhuzhurk commented on a change in pull request #13284:
URL: https://github.com/apache/flink/pull/13284#discussion_r481013002



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java
##########
@@ -300,6 +305,32 @@ public int getNumberOfVertices() {
                return this.taskVertices.size();
        }
 
+       public Set<SlotSharingGroup> getSlotSharingGroups() {
+               final Set<SlotSharingGroup> slotSharingGroups = new HashSet<>();
+               for (JobVertex vertex : getVertices()) {
+                       final SlotSharingGroup slotSharingGroup = 
vertex.getSlotSharingGroup();
+                       checkNotNull(slotSharingGroup);
+
+                       slotSharingGroups.add(slotSharingGroup);
+               }
+               return Collections.unmodifiableSet(slotSharingGroups);
+       }
+
+       public Set<CoLocationGroupDesc> getCoLocationGroupDescriptors() {
+               final Set<CoLocationGroup> coLocationGroups = new HashSet<>();
+               for (JobVertex vertex : getVertices()) {
+                       CoLocationGroup coLocationGroup = 
vertex.getCoLocationGroup();
+                       if (coLocationGroup != null) {
+                               coLocationGroups.add(coLocationGroup);
+                       }
+               }
+               final Set<CoLocationGroupDesc> coLocationGroupDescs = 
coLocationGroups
+                       .stream()
+                       .map(CoLocationGroupDesc::from)
+                       .collect(Collectors.toSet());

Review comment:
       We cannot do this because `CoLocationGroupDesc` does not override 
`equals(...)`. And I'd like to avoid the equality comparison which may require 
to compare 2 lists.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to