You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by in...@apache.org on 2022/05/25 00:21:23 UTC
[hadoop] branch trunk updated: YARN-11137. Improve log message in FederationClientInterceptor (#4336)
This is an automated email from the ASF dual-hosted git repository.
inigoiri pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 678768035db YARN-11137. Improve log message in FederationClientInterceptor (#4336)
678768035db is described below
commit 678768035db633149d631eb661d12c40a92e4416
Author: slfan1989 <55...@users.noreply.github.com>
AuthorDate: Tue May 24 17:21:04 2022 -0700
YARN-11137. Improve log message in FederationClientInterceptor (#4336)
---
.../clientrm/FederationClientInterceptor.java | 36 ++++++++++------------
.../clientrm/TestFederationClientInterceptor.java | 4 +--
2 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java
index d46a2816fc9..71e3d2f1629 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java
@@ -416,8 +416,8 @@ public class FederationClientInterceptor
SubClusterId subClusterId = policyFacade.getHomeSubcluster(
request.getApplicationSubmissionContext(), blacklist);
- LOG.info("submitApplication appId" + applicationId + " try #" + i
- + " on SubCluster " + subClusterId);
+ LOG.info("submitApplication appId {} try #{} on SubCluster {}.", applicationId, i,
+ subClusterId);
ApplicationHomeSubCluster appHomeSubCluster =
ApplicationHomeSubCluster.newInstance(applicationId, subClusterId);
@@ -448,8 +448,8 @@ public class FederationClientInterceptor
SubClusterId subClusterIdInStateStore =
federationFacade.getApplicationHomeSubCluster(applicationId);
if (subClusterId == subClusterIdInStateStore) {
- LOG.info("Application " + applicationId
- + " already submitted on SubCluster " + subClusterId);
+ LOG.info("Application {} already submitted on SubCluster {}.", applicationId,
+ subClusterId);
} else {
routerMetrics.incrAppsFailedSubmitted();
RouterAuditLogger.logFailure(user.getShortUserName(),
@@ -467,14 +467,14 @@ public class FederationClientInterceptor
try {
response = clientRMProxy.submitApplication(request);
} catch (Exception e) {
- LOG.warn("Unable to submit the application " + applicationId
- + "to SubCluster " + subClusterId.getId(), e);
+ LOG.warn("Unable to submit the application {} to SubCluster {} error = {}.",
+ applicationId, subClusterId.getId(), e);
}
if (response != null) {
- LOG.info("Application "
- + request.getApplicationSubmissionContext().getApplicationName()
- + " with appId " + applicationId + " submitted on " + subClusterId);
+ LOG.info("Application {} with appId {} submitted on {}.",
+ request.getApplicationSubmissionContext().getApplicationName(),
+ applicationId, subClusterId);
long stopTime = clock.getTime();
routerMetrics.succeededAppsSubmitted(stopTime - startTime);
RouterAuditLogger.logSuccess(user.getShortUserName(),
@@ -549,8 +549,7 @@ public class FederationClientInterceptor
KillApplicationResponse response = null;
try {
- LOG.info("forceKillApplication " + applicationId + " on SubCluster "
- + subClusterId);
+ LOG.info("forceKillApplication {} on SubCluster {}.", applicationId, subClusterId);
response = clientRMProxy.forceKillApplication(request);
} catch (Exception e) {
routerMetrics.incrAppsFailedKilled();
@@ -640,8 +639,8 @@ public class FederationClientInterceptor
if (response == null) {
LOG.error("No response when attempting to retrieve the report of "
- + "the application " + request.getApplicationId() + " to SubCluster "
- + subClusterId.getId());
+ + "the application {} to SubCluster {}.",
+ request.getApplicationId(), subClusterId.getId());
}
long stopTime = clock.getTime();
@@ -1019,17 +1018,16 @@ public class FederationClientInterceptor
response = clientRMProxy.getApplicationAttemptReport(request);
} catch (Exception e) {
routerMetrics.incrAppAttemptsFailedRetrieved();
- LOG.error("Unable to get the applicationAttempt report for "
- + request.getApplicationAttemptId() + "to SubCluster "
- + subClusterId.getId(), e);
+ LOG.error("Unable to get the applicationAttempt report for {} "
+ + "to SubCluster {}, error = {}.",
+ request.getApplicationAttemptId(), subClusterId.getId(), e);
throw e;
}
if (response == null) {
LOG.error("No response when attempting to retrieve the report of "
- + "the applicationAttempt "
- + request.getApplicationAttemptId() + " to SubCluster "
- + subClusterId.getId());
+ + "the applicationAttempt {} to SubCluster {}.",
+ request.getApplicationAttemptId(), subClusterId.getId());
}
long stopTime = clock.getTime();
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/clientrm/TestFederationClientInterceptor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/clientrm/TestFederationClientInterceptor.java
index 11af313ecff..02ebdbdd6c0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/clientrm/TestFederationClientInterceptor.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/clientrm/TestFederationClientInterceptor.java
@@ -175,7 +175,7 @@ public class TestFederationClientInterceptor extends BaseRouterClientRMTest {
*/
@Test
public void testSubmitApplication()
- throws YarnException, IOException, InterruptedException {
+ throws YarnException, IOException {
LOG.info("Test FederationClientInterceptor: Submit Application");
ApplicationId appId = ApplicationId.newInstance(System.currentTimeMillis(),
@@ -623,7 +623,7 @@ public class TestFederationClientInterceptor extends BaseRouterClientRMTest {
* with given YarnApplicationState does not exist.
*/
@Test
- public void testGetApplicationsApplicationStateNotExists() throws Exception{
+ public void testGetApplicationsApplicationStateNotExists() throws Exception {
LOG.info("Test FederationClientInterceptor:" +
" Application with state does not exist");
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org