You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "huwh (via GitHub)" <gi...@apache.org> on 2023/03/23 07:11:42 UTC

[GitHub] [flink] huwh commented on a diff in pull request #22176: [FLINK-31441][runtime]FineGrainedSlotManager support evenly slot selection.

huwh commented on code in PR #22176:
URL: https://github.com/apache/flink/pull/22176#discussion_r1145768167


##########
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotMatchingStrategy.java:
##########
@@ -41,4 +42,18 @@ <T extends TaskManagerSlotInformation> Optional<T> findMatchingSlot(
             ResourceProfile requestedProfile,
             Collection<T> freeSlots,
             Function<InstanceID, Integer> numberRegisteredSlotsLookup);
+
+    /**
+     * Finds a matching resource instance for the request {@link ResourceProfile} given the
+     * collection of available instances.
+     *
+     * @param resourceMatchingPredicate Predicate of whether instance resource is matching
+     * @param availableInstances collection of available instances
+     * @param instanceResourceInfoLookup lookup for the current resource info of instance
+     * @return Returns a matching instance or {@link Optional#empty()} if there is none
+     */
+    Optional<InstanceID> findMatchingResource(
+            Predicate<InstanceID> resourceMatchingPredicate,
+            Collection<InstanceID> availableInstances,
+            Function<InstanceID, TaskManagerResourceInfoSnapshot> instanceResourceInfoLookup);

Review Comment:
   Good suggestion



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org