RocXing commented on code in PR #22883:
URL: https://github.com/apache/flink/pull/22883#discussion_r1458672637
##########
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/allocator/SlotSharingSlotAllocator.java:
##########
@@ -274,4 +298,68 @@ public Collection<ExecutionVertexID>
getContainedExecutionVertices() {
return containedExecutionVertices;
}
}
+
+ private static class SlotSharingGroupMetaInfo {
+
+ private final int minLowerBound;
+ private final int maxUpperBound;
+ private final int maxLowerUpperBoundRange;
+
+ private SlotSharingGroupMetaInfo(
+ int minLowerBound, int maxUpperBound, int
maxLowerUpperBoundRange) {
+ this.minLowerBound = minLowerBound;
+ this.maxUpperBound = maxUpperBound;
+ this.maxLowerUpperBoundRange = maxLowerUpperBoundRange;
+ }
+
+ public int getMinLowerBound() {
+ return minLowerBound;
+ }
+
+ public int getMaxUpperBound() {
+ return maxUpperBound;
+ }
+
+ public int getMaxLowerUpperBoundRange() {
+ return maxLowerUpperBoundRange;
+ }
+
+ public static Map<SlotSharingGroupId, SlotSharingGroupMetaInfo> from(
+ Iterable<JobInformation.VertexInformation> vertices) {
+
+ return getPerSlotSharingGroups(
+ vertices,
+ vertexInformation ->
+ new SlotSharingGroupMetaInfo(
+ vertexInformation.getMinParallelism(),
+ vertexInformation.getParallelism(),
+ vertexInformation.getParallelism()
+ -
vertexInformation.getMinParallelism()),
+ (metaInfo1, metaInfo2) ->
+ new SlotSharingGroupMetaInfo(
+ Math.min(metaInfo1.getMinLowerBound(),
metaInfo2.minLowerBound),
Review Comment:
Hi Schepler! May you explain here why it's not
Math.**max**(metaInfo1.getMinLowerBound(), metaInfo2.minLowerBound) but min
here?
--
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]