[ 
https://issues.apache.org/jira/browse/YARN-11250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17580945#comment-17580945
 ] 

ASF GitHub Bot commented on YARN-11250:
---------------------------------------

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


##########
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(
-        ApplicationHomeSubCluster.newInstance(appId, homeSubCluster));
+            ApplicationHomeSubCluster.newInstance(appId, homeSubCluster));

Review Comment:
   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/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(
-        ApplicationHomeSubCluster.newInstance(appId, homeSubCluster));
+            ApplicationHomeSubCluster.newInstance(appId, homeSubCluster));
   }
 
   @Override
   public GetApplicationsHomeSubClusterResponse getApplicationsHomeSubCluster(
-      GetApplicationsHomeSubClusterRequest request) throws YarnException {
+          GetApplicationsHomeSubClusterRequest request) throws YarnException {

Review Comment:
   I will fix it.





> Capture the Performance Metrics of ZookeeperFederationStateStore
> ----------------------------------------------------------------
>
>                 Key: YARN-11250
>                 URL: https://issues.apache.org/jira/browse/YARN-11250
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: federation
>    Affects Versions: 3.4.0, 3.3.4
>            Reporter: fanshilun
>            Assignee: fanshilun
>            Priority: Major
>              Labels: pull-request-available
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to