zhuzhurk commented on a change in pull request #10232: [FLINK-14314][runtime]
Allocate shared slot resources respecting the resources of all vertices in the
group
URL: https://github.com/apache/flink/pull/10232#discussion_r348523040
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/SlotProfile.java
##########
@@ -129,18 +116,47 @@ public static SlotProfile noLocality(ResourceProfile
resourceProfile) {
* @param preferredLocations specifying the preferred locations
* @return Slot profile with the given resource profile and preferred
locations
*/
- public static SlotProfile preferredLocality(ResourceProfile
resourceProfile, Collection<TaskManagerLocation> preferredLocations) {
- return new SlotProfile(resourceProfile, preferredLocations,
Collections.emptyList());
+ @VisibleForTesting
+ public static SlotProfile preferredLocality(
+ final ResourceProfile resourceProfile,
+ final Collection<TaskManagerLocation>
preferredLocations) {
+
+ return priorAllocation(resourceProfile, preferredLocations,
Collections.emptyList());
}
/**
* Returns a slot profile for the given resource profile and the prior
allocations.
*
* @param resourceProfile specifying the slot requirements
+ * @param preferredLocations specifying the preferred locations
* @param priorAllocations specifying the prior allocations
- * @return Slot profile with the given resource profile and prior
allocations
+ * @return Slot profile with the given resource profile, preferred
locations and prior allocations
*/
- public static SlotProfile priorAllocation(ResourceProfile
resourceProfile, Collection<AllocationID> priorAllocations) {
- return new SlotProfile(resourceProfile,
Collections.emptyList(), priorAllocations);
+ @VisibleForTesting
+ public static SlotProfile priorAllocation(
Review comment:
Ah yes! Didn't noticed that it can be package private.
It is used a few times in `PreviousAllocationSlotSelectionStrategyTest` for
testing purpose. I think we can just remove it and refactor its usages to the
other `priorAllocation(...)` method.
----------------------------------------------------------------
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