slfan1989 commented on code in PR #4711:
URL: https://github.com/apache/hadoop/pull/4711#discussion_r939449057


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/policies/router/AbstractRouterPolicy.java:
##########
@@ -98,7 +99,16 @@ protected Map<SubClusterId, SubClusterInfo> 
prefilterSubClusters(
 
     // if a reservation exists limit scope to the sub-cluster this
     // reservation is mapped to
-    // TODO: Implemented in YARN-11236
+    if (reservationId != null) {
+      // note this might throw YarnException if the reservation is
+      // unknown. This is to be expected, and should be handled by
+      // policy invoker.
+      SubClusterId resSubCluster = 
getPolicyContext().getFederationStateStoreFacade().

Review Comment:
   Thank you very much for your help reviewing the code, I will fix it.



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/policies/router/AbstractRouterPolicy.java:
##########
@@ -98,7 +99,16 @@ protected Map<SubClusterId, SubClusterInfo> 
prefilterSubClusters(
 
     // if a reservation exists limit scope to the sub-cluster this
     // reservation is mapped to
-    // TODO: Implemented in YARN-11236
+    if (reservationId != null) {
+      // note this might throw YarnException if the reservation is
+      // unknown. This is to be expected, and should be handled by
+      // policy invoker.
+      SubClusterId resSubCluster = 
getPolicyContext().getFederationStateStoreFacade().
+          getReservationHomeSubCluster(reservationId);
+
+      return Collections.singletonMap(resSubCluster, 
activeSubClusters.get(resSubCluster));

Review Comment:
    I will fix it.



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