Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YARN-11137. Improve log message in FederationClientInterceptor #4336

Merged
merged 6 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,8 @@ public SubmitApplicationResponse submitApplication(

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);
Expand Down Expand Up @@ -448,8 +448,8 @@ public SubmitApplicationResponse submitApplication(
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(),
Expand All @@ -467,14 +467,14 @@ public SubmitApplicationResponse submitApplication(
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(),
Expand Down Expand Up @@ -549,8 +549,7 @@ public KillApplicationResponse forceKillApplication(

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();
Expand Down Expand Up @@ -640,8 +639,8 @@ public GetApplicationReportResponse getApplicationReport(

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();
Expand Down Expand Up @@ -1019,17 +1018,16 @@ public GetApplicationAttemptReportResponse getApplicationAttemptReport(
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void testGetNewApplication()
*/
@Test
public void testSubmitApplication()
throws YarnException, IOException, InterruptedException {
throws YarnException, IOException {
LOG.info("Test FederationClientInterceptor: Submit Application");

ApplicationId appId = ApplicationId.newInstance(System.currentTimeMillis(),
Expand Down Expand Up @@ -623,7 +623,7 @@ public void testGetApplicationsApplicationTypeNotExists() throws Exception{
* 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");

Expand Down