This is an automated email from the ASF dual-hosted git repository.

slfan1989 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 2c4d6bf33da YARN-11465. Improved YarnClient Log Format (#5550)
2c4d6bf33da is described below

commit 2c4d6bf33da56a0538ca95047daeefc918e26c41
Author: yl09099 <33595968+yl09...@users.noreply.github.com>
AuthorDate: Mon Apr 17 09:27:52 2023 +0800

    YARN-11465. Improved YarnClient Log Format (#5550)
    
    Co-authored-by: yl09099 <shaq376260...@163.com>
    Reviewed-by: Shilun Fan <slfan1...@apache.org>
    Signed-off-by: Shilun Fan <slfan1...@apache.org>
---
 .../yarn/client/api/ContainerShellWebSocket.java   |  9 ++--
 .../client/api/async/impl/NMClientAsyncImpl.java   | 50 ++++++++---------
 .../yarn/client/api/impl/AMRMClientImpl.java       | 62 +++++++++++-----------
 .../hadoop/yarn/client/api/impl/NMClientImpl.java  | 10 ++--
 .../yarn/client/api/impl/YarnClientImpl.java       | 31 ++++++-----
 .../apache/hadoop/yarn/client/TestGetGroups.java   |  2 +-
 .../yarn/client/TestRMFailoverProxyProvider.java   |  1 +
 ...eManagerAdministrationProtocolPBClientImpl.java |  4 +-
 .../client/api/impl/TestSharedCacheClientImpl.java |  2 +-
 9 files changed, 82 insertions(+), 89 deletions(-)

diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/ContainerShellWebSocket.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/ContainerShellWebSocket.java
index 66a901fc36a..5656484fca1 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/ContainerShellWebSocket.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/ContainerShellWebSocket.java
@@ -69,17 +69,16 @@ public class ContainerShellWebSocket {
   @OnWebSocketConnect
   public void onConnect(Session s) {
     initTerminal(s);
-    LOG.info(s.getRemoteAddress().getHostString() + " connected!");
+    LOG.info("{} connected!", s.getRemoteAddress().getHostString());
   }
 
   @OnWebSocketClose
   public void onClose(Session session, int status, String reason) {
     if (status==1000) {
-      LOG.info(session.getRemoteAddress().getHostString() +
-          " closed, status: " + status);
+      LOG.info("{} closed, status: {}", 
session.getRemoteAddress().getHostString(), status);
     } else {
-      LOG.warn(session.getRemoteAddress().getHostString() +
-          " closed, status: " + status + " Reason: " + reason);
+      LOG.warn("{} closed, status:" +
+              " {} Reason: {}.", session.getRemoteAddress().getHostString(), 
status, reason);
     }
   }
 
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/impl/NMClientAsyncImpl.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/impl/NMClientAsyncImpl.java
index eb5b9b227fb..4a4c50607da 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/impl/NMClientAsyncImpl.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/impl/NMClientAsyncImpl.java
@@ -133,7 +133,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
     this.maxThreadPoolSize = conf.getInt(
         YarnConfiguration.NM_CLIENT_ASYNC_THREAD_POOL_MAX_SIZE,
         YarnConfiguration.DEFAULT_NM_CLIENT_ASYNC_THREAD_POOL_MAX_SIZE);
-    LOG.info("Upper bound of the thread pool size is " + maxThreadPoolSize);
+    LOG.info("Upper bound of the thread pool size is {}.", maxThreadPoolSize);
 
     client.init(conf);
     super.serviceInit(conf);
@@ -186,9 +186,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
               // always increasing the pool-size
               int newThreadPoolSize = Math.min(maxThreadPoolSize,
                   idealThreadPoolSize + INITIAL_THREAD_POOL_SIZE);
-              LOG.info("Set NMClientAsync thread pool size to " +
-                  newThreadPoolSize + " as the number of nodes to talk to is "
-                  + nodeNum);
+              LOG.info("Set NMClientAsync thread pool size to {} " +
+                  "as the number of nodes to talk to is {}.", 
newThreadPoolSize, nodeNum);
               threadPool.setCorePoolSize(newThreadPoolSize);
             }
           }
@@ -252,8 +251,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
     try {
       events.put(new StartContainerEvent(container, containerLaunchContext));
     } catch (InterruptedException e) {
-      LOG.warn("Exception when scheduling the event of starting Container " +
-          container.getId());
+      LOG.warn("Exception when scheduling the event of starting Container {}", 
container.getId());
       callbackHandler.onStartContainerError(container.getId(), e);
     }
   }
@@ -276,8 +274,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
     try {
       events.put(new UpdateContainerResourceEvent(container, true));
     } catch (InterruptedException e) {
-      LOG.warn("Exception when scheduling the event of increasing resource of "
-          + "Container " + container.getId());
+      LOG.warn("Exception when scheduling the event of increasing " +
+              "resource of Container {}", container.getId());
       handler.onIncreaseContainerResourceError(container.getId(), e);
     }
   }
@@ -300,8 +298,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
     try {
       events.put(new UpdateContainerResourceEvent(container, false));
     } catch (InterruptedException e) {
-      LOG.warn("Exception when scheduling the event of increasing resource of "
-          + "Container " + container.getId());
+      LOG.warn("Exception when scheduling the event of " +
+              "increasing resource of Container {}.", container.getId());
       handler.onUpdateContainerResourceError(container.getId(), e);
     }
   }
@@ -325,8 +323,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
           client.getNodeIdOfStartedContainer(containerId),
           containerLaunchContex, autoCommit));
     } catch (InterruptedException e) {
-      LOG.warn("Exception when scheduling the event of re-initializing of "
-          + "Container " + containerId);
+      LOG.warn("Exception when scheduling the event of " +
+              "re-initializing of Container {}", containerId);
       handler.onContainerReInitializeError(containerId, e);
     }
   }
@@ -349,8 +347,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
           client.getNodeIdOfStartedContainer(containerId),
           null, ContainerEventType.RESTART_CONTAINER));
     } catch (InterruptedException e) {
-      LOG.warn("Exception when scheduling the event of restart of "
-          + "Container " + containerId);
+      LOG.warn("Exception when scheduling the event of restart of Container 
{}", containerId);
       handler.onContainerRestartError(containerId, e);
     }
   }
@@ -373,8 +370,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
           client.getNodeIdOfStartedContainer(containerId),
           null, ContainerEventType.ROLLBACK_LAST_REINIT));
     } catch (InterruptedException e) {
-      LOG.warn("Exception when scheduling the event Rollback re-initialization"
-          + " of Container " + containerId);
+      LOG.warn("Exception when scheduling the event Rollback " +
+              "re-initialization of Container {}", containerId);
       handler.onRollbackLastReInitializationError(containerId, e);
     }
   }
@@ -397,8 +394,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
           client.getNodeIdOfStartedContainer(containerId),
           null, ContainerEventType.COMMIT_LAST_REINT));
     } catch (InterruptedException e) {
-      LOG.warn("Exception when scheduling the event Commit re-initialization"
-          + " of Container " + containerId);
+      LOG.warn("Exception when scheduling the event " +
+              "Commit re-initialization of Container {}", containerId);
       handler.onCommitLastReInitializationError(containerId, e);
     }
   }
@@ -413,8 +410,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
       events.put(new ContainerEvent(containerId, nodeId, null,
           ContainerEventType.STOP_CONTAINER));
     } catch (InterruptedException e) {
-      LOG.warn("Exception when scheduling the event of stopping Container " +
-          containerId);
+      LOG.warn("Exception when scheduling the event of stopping Container {}", 
containerId);
       callbackHandler.onStopContainerError(containerId, e);
     }
   }
@@ -424,8 +420,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
       events.put(new ContainerEvent(containerId, nodeId, null,
           ContainerEventType.QUERY_CONTAINER));
     } catch (InterruptedException e) {
-      LOG.warn("Exception when scheduling the event of querying the status" +
-          " of Container " + containerId);
+      LOG.warn("Exception when scheduling the event of querying " +
+              "the status of Container {}", containerId);
       callbackHandler.onGetContainerStatusError(containerId, e);
     }
   }
@@ -730,7 +726,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
           switch(containerEvent.getType()) {
           case REINITIALIZE_CONTAINER:
             if (!(containerEvent instanceof ReInitializeContainerEvevnt)) {
-              LOG.error("Unexpected Event.. [" +containerEvent.getType() + 
"]");
+              LOG.error("Unexpected Event.. [{}]", containerEvent.getType());
               return ContainerState.FAILED;
             }
             ReInitializeContainerEvevnt rEvent =
@@ -771,8 +767,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
             }
             break;
           default:
-            LOG.warn("Event of type [" + containerEvent.getType() + "] not" +
-                " expected here..");
+            LOG.warn("Event of type [{}] not" +
+                " expected here..", containerEvent.getType());
             break;
           }
           if (handlerError != null) {
@@ -942,7 +938,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
     @Override
     public void run() {
       ContainerId containerId = event.getContainerId();
-      LOG.info("Processing Event " + event + " for Container " + containerId);
+      LOG.info("Processing Event {} for Container {}", event, containerId);
       if (event.getType() == ContainerEventType.QUERY_CONTAINER) {
         try {
           ContainerStatus containerStatus = client.getContainerStatus(
@@ -962,7 +958,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
       } else {
         StatefulContainer container = containers.get(containerId);
         if (container == null) {
-          LOG.info("Container " + containerId + " is already stopped or 
failed");
+          LOG.info("Container {} is already stopped or failed", containerId);
         } else {
           container.handle(event);
           if (isCompletelyDone(container)) {
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java
index 274920f7e1b..0a450b532af 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java
@@ -478,11 +478,12 @@ public class AMRMClientImpl<T extends ContainerRequest> 
extends AMRMClient<T> {
         continue;
       }
       if (LOG.isDebugEnabled()) {
-        LOG.debug("RM has confirmed changed resource allocation for "
-            + "container " + containerId + ". Current resource allocation:"
-            + changedContainer.getContainer().getResource()
-            + ". Remove pending change request:"
-            + pendingChange.get(containerId).getValue());
+        LOG.debug("RM has confirmed changed resource allocation for container 
{}. " +
+                "Current resource allocation:{}. " +
+                "Remove pending change request:{}",
+                containerId,
+                changedContainer.getContainer().getResource(),
+                pendingChange.get(containerId).getValue());
       }
       pendingChange.remove(containerId);
     }
@@ -495,9 +496,9 @@ public class AMRMClientImpl<T extends ContainerRequest> 
extends AMRMClient<T> {
       String nodeId = token.getNodeId().toString();
       if (LOG.isDebugEnabled()) {
         if (getNMTokenCache().containsToken(nodeId)) {
-          LOG.debug("Replacing token for : " + nodeId);
+          LOG.debug("Replacing token for : {}", nodeId);
         } else {
-          LOG.debug("Received new token for : " + nodeId);
+          LOG.debug("Received new token for : {}", nodeId);
         }
       }
       getNMTokenCache().setToken(nodeId, token.getToken());
@@ -544,8 +545,7 @@ public class AMRMClientImpl<T extends ContainerRequest> 
extends AMRMClient<T> {
       dedupedRacks.addAll(req.getRacks());
       if(req.getRacks().size() != dedupedRacks.size()) {
         Joiner joiner = Joiner.on(',');
-        LOG.warn("ContainerRequest has duplicate racks: "
-            + joiner.join(req.getRacks()));
+        LOG.warn("ContainerRequest has duplicate racks: {}", 
joiner.join(req.getRacks()));
       }
     }
     Set<String> inferredRacks = resolveRacks(req.getNodes());
@@ -573,8 +573,7 @@ public class AMRMClientImpl<T extends ContainerRequest> 
extends AMRMClient<T> {
       HashSet<String> dedupedNodes = new HashSet<String>(req.getNodes());
       if(dedupedNodes.size() != req.getNodes().size()) {
         Joiner joiner = Joiner.on(',');
-        LOG.warn("ContainerRequest has duplicate nodes: "
-            + joiner.join(req.getNodes()));        
+        LOG.warn("ContainerRequest has duplicate nodes: {}", 
joiner.join(req.getNodes()));
       }
       for (String node : dedupedNodes) {
         addResourceRequest(req.getPriority(), node,
@@ -636,11 +635,12 @@ public class AMRMClientImpl<T extends ContainerRequest> 
extends AMRMClient<T> {
     Preconditions.checkNotNull(container, "Container cannot be null!!");
     Preconditions.checkNotNull(updateContainerRequest,
         "UpdateContainerRequest cannot be null!!");
-    LOG.info("Requesting Container update : " +
-        "container=" + container + ", " +
-        "updateType=" + updateContainerRequest.getContainerUpdateType() + ", " 
+
-        "targetCapability=" + updateContainerRequest.getCapability() + ", " +
-        "targetExecType=" + updateContainerRequest.getExecutionType());
+    LOG.info("Requesting Container update : container={}, updateType={}," +
+                    " targetCapability={}, targetExecType={}",
+            container,
+            updateContainerRequest.getContainerUpdateType(),
+            updateContainerRequest.getCapability(),
+            updateContainerRequest.getExecutionType());
     if (updateContainerRequest.getCapability() != null &&
         updateContainerRequest.getExecutionType() == null) {
       validateContainerResourceChangeRequest(
@@ -770,7 +770,7 @@ public class AMRMClientImpl<T extends ContainerRequest> 
extends AMRMClient<T> {
         // Ensure node requests are accompanied by requests for
         // corresponding rack
         if (rack == null) {
-          LOG.warn("Failed to resolve rack for node " + node + ".");
+          LOG.warn("Failed to resolve rack for node {}.", node);
         } else {
           racks.add(rack);
         }
@@ -941,12 +941,13 @@ public class AMRMClientImpl<T extends ContainerRequest> 
extends AMRMClient<T> {
     addResourceRequestToAsk(resourceRequestInfo.remoteRequest);
 
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Adding request to ask " + resourceRequestInfo.remoteRequest);
-      LOG.debug("addResourceRequest:" + " applicationId="
-          + " priority=" + priority.getPriority()
-          + " resourceName=" + resourceName + " numContainers="
-          + resourceRequestInfo.remoteRequest.getNumContainers() 
-          + " #asks=" + ask.size());
+      LOG.debug("Adding request to ask {}", resourceRequestInfo.remoteRequest);
+      LOG.debug("addResourceRequest: applicationId= priority={}" +
+                      " resourceName={} numContainers={} #asks={}",
+              priority.getPriority(),
+              resourceName,
+              resourceRequestInfo.remoteRequest.getNumContainers(),
+              ask.size());
     }
   }
 
@@ -972,17 +973,16 @@ public class AMRMClientImpl<T extends ContainerRequest> 
extends AMRMClient<T> {
         }
 
         if (LOG.isDebugEnabled()) {
-          LOG.debug("AFTER decResourceRequest:"
-              + " allocationRequestId=" + req.getAllocationRequestId()
-              + " priority=" + priority.getPriority()
-              + " resourceName=" + resourceName + " numContainers="
-              + resourceRequestInfo.remoteRequest.getNumContainers()
-              + " #asks=" + ask.size());
+          LOG.debug("AFTER decResourceRequest: allocationRequestId={} " +
+                          "priority={} resourceName={} numContainers={} 
#asks={}",
+                  req.getAllocationRequestId(), priority.getPriority(),
+                  resourceName,
+                  resourceRequestInfo.remoteRequest.getNumContainers(), 
ask.size());
         }
       }
     } else {
-      LOG.info("No remoteRequestTable found with allocationRequestId="
-          + req.getAllocationRequestId());
+      LOG.info("No remoteRequestTable found with allocationRequestId={}",
+              req.getAllocationRequestId());
     }
   }
 
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/NMClientImpl.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/NMClientImpl.java
index 6b2cf46bfa9..e2d7b9f28ea 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/NMClientImpl.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/NMClientImpl.java
@@ -128,13 +128,11 @@ public class NMClientImpl extends NMClient {
         stopContainer(startedContainer.getContainerId(),
             startedContainer.getNodeId());
       } catch (YarnException e) {
-        LOG.error("Failed to stop Container " +
-            startedContainer.getContainerId() +
-            " when stopping NMClientImpl");
+        LOG.error("Failed to stop Container {} when stopping NMClientImpl",
+                startedContainer.getContainerId());
       } catch (IOException e) {
-        LOG.error("Failed to stop Container " +
-            startedContainer.getContainerId() +
-            " when stopping NMClientImpl");
+        LOG.error("Failed to stop Container {} when stopping NMClientImpl",
+                startedContainer.getContainerId());
       }
     }
   }
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/YarnClientImpl.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/YarnClientImpl.java
index 36a5b04ad11..19d03a7da73 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/YarnClientImpl.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/YarnClientImpl.java
@@ -353,7 +353,7 @@ public class YarnClientImpl extends YarnClient {
             throw new YarnException("Failed to submit " + applicationId + 
                 " to YARN : " + appReport.getDiagnostics());
           }
-          LOG.info("Submitted application " + applicationId);
+          LOG.info("Submitted application {}", applicationId);
           break;
         }
 
@@ -368,8 +368,9 @@ public class YarnClientImpl extends YarnClient {
         // is blocked here too long.
         if (++pollCount % 10 == 0) {
           LOG.info("Application submission is not finished, " +
-              "submitted application " + applicationId +
-              " is still in " + state);
+                          "submitted application {} is still in {}",
+                  applicationId,
+                  state);
         }
         try {
           Thread.sleep(submitPollIntervalMillis);
@@ -382,8 +383,8 @@ public class YarnClientImpl extends YarnClient {
       } catch (ApplicationNotFoundException ex) {
         // FailOver or RM restart happens before RMStateStore saves
         // ApplicationState
-        LOG.info("Re-submit application " + applicationId + "with the " +
-            "same ApplicationSubmissionContext");
+        LOG.info("Re-submit application {} with the" +
+                " same ApplicationSubmissionContext", applicationId);
         rmClient.submitApplication(request);
       }
     }
@@ -408,7 +409,7 @@ public class YarnClientImpl extends YarnClient {
       throw new IOException(
           "Can't get Master Kerberos principal for use as renewer");
     }
-    LOG.debug("Delegation Token Renewer: " + masterPrincipal);
+    LOG.debug("Delegation Token Renewer: {}", masterPrincipal);
 
     LogAggregationFileControllerFactory factory =
         new LogAggregationFileControllerFactory(conf);
@@ -421,8 +422,7 @@ public class YarnClientImpl extends YarnClient {
         fs.addDelegationTokens(masterPrincipal, credentials);
     if (finalTokens != null) {
       for (org.apache.hadoop.security.token.Token<?> token : finalTokens) {
-        LOG.info("Added delegation token for log aggregation path "
-            + remoteRootLogDir + "; "+token);
+        LOG.info("Added delegation token for log aggregation path {}; {}", 
remoteRootLogDir, token);
       }
     }
 
@@ -485,8 +485,7 @@ public class YarnClientImpl extends YarnClient {
       return timelineClient.getDelegationToken(timelineDTRenewer);
     } catch (Exception e) {
       if (timelineServiceBestEffort) {
-        LOG.warn("Failed to get delegation token from the timeline server: "
-            + e.getMessage());
+        LOG.warn("Failed to get delegation token from the timeline server: 
{}", e.getMessage());
         return null;
       }
       throw new IOException(e);
@@ -527,7 +526,7 @@ public class YarnClientImpl extends YarnClient {
   @Override
   public void failApplicationAttempt(ApplicationAttemptId attemptId)
       throws YarnException, IOException {
-    LOG.info("Failing application attempt " + attemptId);
+    LOG.info("Failing application attempt {}.", attemptId);
     FailApplicationAttemptRequest request =
         Records.newRecord(FailApplicationAttemptRequest.class);
     request.setApplicationAttemptId(attemptId);
@@ -560,7 +559,7 @@ public class YarnClientImpl extends YarnClient {
         KillApplicationResponse response =
             rmClient.forceKillApplication(request);
         if (response.getIsKillCompleted()) {
-          LOG.info("Killed application " + applicationId);
+          LOG.info("Killed application {}", applicationId);
           break;
         }
 
@@ -573,7 +572,7 @@ public class YarnClientImpl extends YarnClient {
 
         if (++pollCount % 10 == 0) {
           LOG.info(
-              "Waiting for application " + applicationId + " to be killed.");
+              "Waiting for application {} to be killed.", applicationId);
         }
         Thread.sleep(asyncApiPollIntervalMillis);
       }
@@ -1080,7 +1079,7 @@ public class YarnClientImpl extends YarnClient {
   public void signalToContainer(ContainerId containerId,
       SignalContainerCommand command)
           throws YarnException, IOException {
-    LOG.info("Signalling container " + containerId + " with command " + 
command);
+    LOG.info("Signalling container {} with command {}", containerId, command);
     SignalContainerRequest request =
         SignalContainerRequest.newInstance(containerId, command);
     rmClient.signalToContainer(request);
@@ -1186,9 +1185,9 @@ public class YarnClientImpl extends YarnClient {
         client.stop();
       }
     } catch (WebSocketException e) {
-      LOG.debug("Websocket exception: " + e.getMessage());
+      LOG.debug("Websocket exception: {}", e.getMessage());
     } catch (Throwable t) {
-      LOG.error("Fail to shell to container: " + t.getMessage());
+      LOG.error("Fail to shell to container: {}", t.getMessage());
     }
   }
 }
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestGetGroups.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestGetGroups.java
index 51b522ae392..d11ea78607c 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestGetGroups.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestGetGroups.java
@@ -79,7 +79,7 @@ public class TestGetGroups extends GetGroupsTestBase {
     boolean rmStarted = rmStartedSignal.await(60000L, TimeUnit.MILLISECONDS);
     Assert.assertTrue("ResourceManager failed to start up.", rmStarted);
 
-    LOG.info("ResourceManager RMAdmin address: " +
+    LOG.info("ResourceManager RMAdmin address: {}.",
         conf.get(YarnConfiguration.RM_ADMIN_ADDRESS));
   }
   
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailoverProxyProvider.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailoverProxyProvider.java
index ce9af23744f..b4fd175fae8 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailoverProxyProvider.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailoverProxyProvider.java
@@ -189,6 +189,7 @@ public class TestRMFailoverProxyProvider {
    * and {@link AutoRefreshRMFailoverProxyProvider#performFailover(Object)}
    * gets called.
    */
+  @SuppressWarnings("unchecked")
   @Test
   public void testAutoRefreshFailoverChange() throws Exception {
     conf.setClass(YarnConfiguration.CLIENT_FAILOVER_NO_HA_PROXY_PROVIDER,
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestResourceManagerAdministrationProtocolPBClientImpl.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestResourceManagerAdministrationProtocolPBClientImpl.java
index dfc2a0fc4b7..08a6e0c78ec 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestResourceManagerAdministrationProtocolPBClientImpl.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestResourceManagerAdministrationProtocolPBClientImpl.java
@@ -106,8 +106,8 @@ public class 
TestResourceManagerAdministrationProtocolPBClientImpl {
     boolean rmStarted = rmStartedSignal.await(60000L, TimeUnit.MILLISECONDS);
     Assert.assertTrue("ResourceManager failed to start up.", rmStarted);
 
-    LOG.info("ResourceManager RMAdmin address: "
-            + configuration.get(YarnConfiguration.RM_ADMIN_ADDRESS));
+    LOG.info("ResourceManager RMAdmin address: {}.",
+            configuration.get(YarnConfiguration.RM_ADMIN_ADDRESS));
 
     client = new ResourceManagerAdministrationProtocolPBClientImpl(1L,
             getProtocolAddress(configuration), configuration);
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestSharedCacheClientImpl.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestSharedCacheClientImpl.java
index b297d926c05..1b179b138a9 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestSharedCacheClientImpl.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestSharedCacheClientImpl.java
@@ -76,7 +76,7 @@ public class TestSharedCacheClientImpl {
         localFs.close();
       }
     } catch (IOException ioe) {
-      LOG.info("IO exception in closing file system)");
+      LOG.info("IO exception in closing file system");
       ioe.printStackTrace();
     }
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to