minni31 commented on a change in pull request #3760:
URL: https://github.com/apache/hadoop/pull/3760#discussion_r797324719



##########
File path: 
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/scheduler/ResourceRequestSetKey.java
##########
@@ -130,4 +137,43 @@ public String toString() {
         + (this.execType.equals(ExecutionType.GUARANTEED) ? " G"
             : " O" + " r:" + this.resource + "]");
   }
+
+  /**
+   * Extract the corresponding ResourceRequestSetKey for an allocated container
+   * from a given set. Return null if not found.
+   *
+   * @param container the allocated container
+   * @param keys the set of keys to look from
+   * @return ResourceRequestSetKey
+   */
+  public static ResourceRequestSetKey extractMatchingKey(Container container,
+      Set<ResourceRequestSetKey> keys) {
+    ResourceRequestSetKey key = new ResourceRequestSetKey(
+        container.getAllocationRequestId(), container.getPriority(),
+        container.getResource(), container.getExecutionType());
+    if (keys.contains(key)) {

Review comment:
       Yes, it does.




-- 
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to