slfan1989 commented on code in PR #5631:
URL: https://github.com/apache/hadoop/pull/5631#discussion_r1188140338
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/store/impl/ZookeeperFederationStateStore.java:
##########
@@ -379,14 +388,27 @@ public GetApplicationHomeSubClusterResponse
getApplicationHomeSubCluster(
long start = clock.getTime();
FederationApplicationHomeSubClusterStoreInputValidator.validate(request);
ApplicationId appId = request.getApplicationId();
- SubClusterId homeSubCluster = getApp(appId);
- if (homeSubCluster == null) {
+ ApplicationHomeSubCluster appHomeSubCluster = getApp(appId);
+ if (appHomeSubCluster == null) {
String errMsg = "Application " + appId + " does not exist";
FederationStateStoreUtils.logAndThrowStoreException(LOG, errMsg);
}
+
+ // Whether the returned result contains context
+ ApplicationSubmissionContext submissionContext =
+ appHomeSubCluster.getApplicationSubmissionContext();
+ boolean containsAppSubmissionContext =
request.getContainsAppSubmissionContext();
Review Comment:
Thanks for your question!
> Why do we need the contains?
`ApplicationSubmissionContext` contains a lot of information. For
performance reasons, if it is not necessary, we will not return this part of
the data. The currently known use of this data is described in YARN-8898 Fix
FederationInterceptor#allocate to set application priority in allocateResponse.
So by default, we do not return this data unless it is stated in the request
that this data is required.
> Wouldn't it just return null?
By default, we return null.
--
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]