slfan1989 commented on code in PR #4738: URL: https://github.com/apache/hadoop/pull/4738#discussion_r948295097
########## 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: ########## @@ -203,53 +213,58 @@ public AddApplicationHomeSubClusterResponse addApplicationHomeSubCluster( FederationStateStoreUtils.logAndThrowStoreException(LOG, errMsg); } SubClusterId newSubClusterId = - request.getApplicationHomeSubCluster().getHomeSubCluster(); + request.getApplicationHomeSubCluster().getHomeSubCluster(); putApp(appId, newSubClusterId, true); + + opDurations.addUpdateAppHomeSubClusterDuration(clock.getTime() - start); return UpdateApplicationHomeSubClusterResponse.newInstance(); } @Override public GetApplicationHomeSubClusterResponse getApplicationHomeSubCluster( - GetApplicationHomeSubClusterRequest request) throws YarnException { + GetApplicationHomeSubClusterRequest request) throws YarnException { + long start = clock.getTime(); FederationApplicationHomeSubClusterStoreInputValidator.validate(request); ApplicationId appId = request.getApplicationId(); SubClusterId homeSubCluster = getApp(appId); if (homeSubCluster == null) { String errMsg = "Application " + appId + " does not exist"; FederationStateStoreUtils.logAndThrowStoreException(LOG, errMsg); } + opDurations.addGetAppHomeSubClusterDuration(clock.getTime() - start); return GetApplicationHomeSubClusterResponse.newInstance( Review Comment: Your suggestion is reasonable, I will modify the code. -- 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: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org