[
https://issues.apache.org/jira/browse/YARN-11250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17580895#comment-17580895
]
ASF GitHub Bot commented on YARN-11250:
---------------------------------------
goiri commented on code in PR #4738:
URL: https://github.com/apache/hadoop/pull/4738#discussion_r948194089
##########
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:
##########
@@ -184,16 +193,17 @@ public AddApplicationHomeSubClusterResponse
addApplicationHomeSubCluster(
FederationStateStoreUtils.logAndThrowStoreException(LOG, errMsg);
}
- return AddApplicationHomeSubClusterResponse
- .newInstance(homeSubCluster);
+ opDurations.addAppHomeSubClusterDuration(clock.getTime() - start);
Review Comment:
No need to do this but one thing I was thinking about is the fact that we
keep doing the substraction in the call.
Would it look better to pass the start and the end time and do the
substraction inside?
##########
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:
##########
@@ -161,8 +169,9 @@ public void close() throws Exception {
@Override
public AddApplicationHomeSubClusterResponse addApplicationHomeSubCluster(
- AddApplicationHomeSubClusterRequest request) throws YarnException {
+ AddApplicationHomeSubClusterRequest request) throws YarnException {
Review Comment:
The old indentation was correct.
##########
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:
##########
@@ -336,14 +354,14 @@ public SubClusterHeartbeatResponse subClusterHeartbeat(
subClusterInfo.setCapability(request.getCapability());
putSubclusterInfo(subClusterId, subClusterInfo, true);
-
+ opDurations.addSubClusterHeartbeatDuration(clock.getTime() - start);
return SubClusterHeartbeatResponse.newInstance();
}
@Override
public GetSubClusterInfoResponse getSubCluster(
- GetSubClusterInfoRequest request) throws YarnException {
-
+ GetSubClusterInfoRequest request) throws YarnException {
Review Comment:
Indentation all over.
##########
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:
Indetation
##########
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:
Indentation
##########
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:
As this is all we do, would it make sense to have a:
```
GetApplicationHomeSubClusterResponse.newInstance(appId, homeSubCluster);
```
?
##########
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 =
Review Comment:
This indentation was correct earlier.
> 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]