diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/FederationInterceptorREST.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/FederationInterceptorREST.java index cfabc5c9687..23ca079a1d9 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/FederationInterceptorREST.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/FederationInterceptorREST.java @@ -591,8 +591,7 @@ public AppInfo getApp(HttpServletRequest hsr, String appId, } /** - * The YARN Router will forward to the respective YARN RM in which the AM is - * running. + * The YARN Router will forward to all sub clusters. *
* Possible failures and behaviors: *
@@ -625,11 +624,11 @@ public Response updateAppState(AppState targetState, HttpServletRequest hsr,
}
SubClusterInfo subClusterInfo = null;
- SubClusterId subClusterId = null;
+ SubClusterId homeSubClusterId = null;
try {
- subClusterId =
+ homeSubClusterId =
federationFacade.getApplicationHomeSubCluster(applicationId);
- subClusterInfo = federationFacade.getSubCluster(subClusterId);
+ subClusterInfo = federationFacade.getSubCluster(homeSubClusterId);
} catch (YarnException e) {
routerMetrics.incrAppsFailedKilled();
return Response
@@ -638,13 +637,53 @@ public Response updateAppState(AppState targetState, HttpServletRequest hsr,
.build();
}
- Response response = getOrCreateInterceptorForSubCluster(subClusterId,
+ Response response = getOrCreateInterceptorForSubCluster(homeSubClusterId,
subClusterInfo.getRMWebServiceAddress()).updateAppState(targetState,
hsr, appId);
long stopTime = clock.getTime();
routerMetrics.succeededAppsRetrieved(stopTime - startTime);
+ Map