ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rle...@apache.org
Subject [06/11] ambari git commit: AMBARI-19149. Code cleanup: concatenation in debug messages, unnecessary toString calls
Date Mon, 12 Jun 2017 16:34:30 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AppCookieManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AppCookieManager.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AppCookieManager.java
index 7904593..4c63d1e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AppCookieManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AppCookieManager.java
@@ -24,8 +24,6 @@ import java.security.Principal;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.http.Header;
 import org.apache.http.HeaderElement;
 import org.apache.http.HttpEntity;
@@ -40,6 +38,8 @@ import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.client.params.AuthPolicy;
 import org.apache.http.impl.auth.SPNegoSchemeFactory;
 import org.apache.http.impl.client.DefaultHttpClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Handles SPNego authentication as a client of hadoop service, caches
@@ -57,7 +57,7 @@ public class AppCookieManager {
   private static final EmptyJaasCredentials EMPTY_JAAS_CREDENTIALS = new EmptyJaasCredentials();
 
   private Map<String, String> endpointCookieMap = new ConcurrentHashMap<>();
-  private static Log LOG = LogFactory.getLog(AppCookieManager.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AppCookieManager.class);
 
   /**
    * Utility method to exercise AppCookieManager directly
@@ -136,7 +136,7 @@ public class AppCookieManager {
     hadoopAuthCookie = HADOOP_AUTH_EQ + quote(hadoopAuthCookie);
     setAppCookie(endpoint, hadoopAuthCookie);
     if (LOG.isInfoEnabled()) {
-      LOG.info("Successful SPNego authentication to URL:" + uri.toString());
+      LOG.info("Successful SPNego authentication to URL:" + uri);
     }
     return hadoopAuthCookie;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java
index 8c68a12..135eefe 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java
@@ -309,10 +309,7 @@ public abstract class BaseProvider {
 
     if (contains) {
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Setting property for resource"
-            + ", resourceType=" + resource.getType()
-            + ", propertyId=" + propertyId
-            + ", value=" + value);
+        LOG.debug("Setting property for resource, resourceType={}, propertyId={}, value={}", resource.getType(), propertyId, value);
       }
 
       // If the value is a Map then set all of its entries as properties
@@ -335,10 +332,7 @@ public abstract class BaseProvider {
       }
 
       if (!contains && LOG.isDebugEnabled()) {
-        LOG.debug("Skipping property for resource as not in requestedIds"
-            + ", resourceType=" + resource.getType()
-            + ", propertyId=" + propertyId
-            + ", value=" + value);
+        LOG.debug("Skipping property for resource as not in requestedIds, resourceType={}, propertyId={}, value={}", resource.getType(), propertyId, value);
       }
     }
     return contains;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 7ebefdd..e93b2f7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -450,8 +450,7 @@ public class BlueprintConfigurationProcessor {
       String newValue = trimmingStrategy.trim(oldValue);
 
       if (!newValue.equals(oldValue)){
-        LOG.debug(String.format("Changing value for config %s property %s from [%s] to [%s]",
-          configType, propertyName, oldValue, newValue));
+        LOG.debug("Changing value for config {} property {} from [{}] to [{}]", configType, propertyName, oldValue, newValue);
         clusterConfig.setProperty(configType, propertyName, newValue);
       }
     }
@@ -2850,8 +2849,8 @@ public class BlueprintConfigurationProcessor {
             ensureProperty(configuration, "core-site", String.format(proxyUserGroups, user), "*", configTypesUpdated);
           }
         } else {
-          LOG.debug("setMissingConfigurations: no user configuration found for type = " + configType +
-                  ".  This may be caused by an error in the blueprint configuration.");
+          LOG.debug("setMissingConfigurations: no user configuration found for type = {}.  This may be caused by an error in the blueprint configuration.",
+            configType);
         }
 
       }
@@ -2908,7 +2907,7 @@ public class BlueprintConfigurationProcessor {
 
         Map<String, String> configProperties = stack.getConfigurationProperties(blueprintService, configType);
         for(Map.Entry<String, String> entry: configProperties.entrySet()) {
-          LOG.debug("ADD property " + configType + " " + entry.getKey() + " " + entry.getValue());
+          LOG.debug("ADD property {} {} {}", configType, entry.getKey(), entry.getValue());
           ensureProperty(configuration, configType, entry.getKey(), entry.getValue(), configTypesUpdated);
         }
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
index 181d323..21cf16c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
@@ -249,7 +249,7 @@ public class ClientConfigResourceProvider extends AbstractControllerResourceProv
           if (componentMap.size() == 1) {
             throw new SystemException("No configuration files defined for the component " + componentInfo.getName());
           } else {
-            LOG.debug(String.format("No configuration files defined for the component %s",componentInfo.getName()));
+            LOG.debug("No configuration files defined for the component {}", componentInfo.getName());
             continue;
           }
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
index 1949d06..c5c4ca1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
@@ -130,9 +130,7 @@ public class ClusterControllerImpl implements ClusterController {
 
     if (provider != null) {
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Using resource provider "
-            + provider.getClass().getName()
-            + " for request type " + type.toString());
+        LOG.debug("Using resource provider {} for request type {}", provider.getClass().getName(), type);
       }
       // make sure that the providers can satisfy the request
       checkProperties(type, request, predicate);

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
index cc3234b..265b89b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
@@ -272,8 +272,7 @@ public class ClusterResourceProvider extends AbstractControllerResourceProvider
 
     Set<Resource> resources = new HashSet<>();
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Found clusters matching getClusters request"
-          + ", clusterResponseCount=" + responses.size());
+      LOG.debug("Found clusters matching getClusters request, clusterResponseCount={}", responses.size());
     }
 
     // Allow internal call to bypass permissions check.
@@ -291,8 +290,7 @@ public class ClusterResourceProvider extends AbstractControllerResourceProvider
       setResourceProperty(resource, CLUSTER_VERSION_PROPERTY_ID, response.getDesiredStackVersion(), requestedIds);
 
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Adding ClusterResponse to resource"
-            + ", clusterResponse=" + response.toString());
+        LOG.debug("Adding ClusterResponse to resource, clusterResponse={}", response);
       }
 
       resources.add(resource);

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java
index 73696c7..f05ffbe 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java
@@ -165,7 +165,7 @@ public class CompatibleRepositoryVersionResourceProvider extends ReadOnlyResourc
           if (compatibleRepositoryVersionsMap.containsKey(repositoryVersionEntity.getId())) {
             compatibleRepositoryVersionsMap.get(repositoryVersionEntity.getId()).addUpgradePackType(up.getType());
             if (LOG.isDebugEnabled()) {
-              LOG.debug("Stack id: {} exists in map.  Appended new upgrade type {}" + repositoryVersionEntity.getId(), up.getType());
+              LOG.debug("Stack id: {} exists in map.  Appended new upgrade type {}{}", up.getType(), repositoryVersionEntity.getId());
             }
           } else {
             CompatibleRepositoryVersion compatibleRepositoryVersionEntity = new CompatibleRepositoryVersion(repositoryVersionEntity);

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
index 292761a..2df3b00 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
@@ -369,7 +369,7 @@ public class ComponentResourceProvider extends AbstractControllerResourceProvide
           stackId.getStackVersion(), s.getName(), request.getComponentName())) {
         throw new IllegalArgumentException("Unsupported or invalid component"
             + " in stack stackInfo=" + stackId.getStackId()
-            + " request=" + request.toString());
+            + " request=" + request);
       }
     }
 
@@ -412,7 +412,7 @@ public class ComponentResourceProvider extends AbstractControllerResourceProvide
                 stackId.getStackVersion(), s.getName(), request.getComponentName());
         if (componentInfo == null) {
             throw new AmbariException("Could not get component information from stack definition: Stack=" +
-                stackId.toString() + ", Service=" + s.getName() + ", Component=" + request.getComponentName());
+              stackId + ", Service=" + s.getName() + ", Component=" + request.getComponentName());
         }
         sc.setRecoveryEnabled(componentInfo.isRecoveryEnabled());
         LOG.info("Component: {}, recovery_enabled from stack definition:{}", componentInfo.getName(),
@@ -778,7 +778,7 @@ public class ComponentResourceProvider extends AbstractControllerResourceProvide
         throw new AmbariException("Found non removable host component when trying to delete service component." +
             " To remove host component, it must be in DISABLED/INIT/INSTALLED/INSTALL_FAILED/UNKNOWN" +
             "/UNINSTALLED/INSTALLING state."
-            + ", request=" + request.toString()
+            + ", request=" + request
             + ", current state=" + sc.getDesiredState() + ".");
 
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
index cc23177..c2b998c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
@@ -314,11 +314,8 @@ public class ConfigGroupResourceProvider extends
     Set<ConfigGroupResponse> responses = new HashSet<>();
     if (requests != null) {
       for (ConfigGroupRequest request : requests) {
-        LOG.debug("Received a Config group request with"
-          + ", clusterName = " + request.getClusterName()
-          + ", groupId = " + request.getId()
-          + ", groupName = " + request.getGroupName()
-          + ", tag = " + request.getTag());
+        LOG.debug("Received a Config group request with, clusterName = {}, groupId = {}, groupName = {}, tag = {}",
+          request.getClusterName(), request.getId(), request.getGroupName(), request.getTag());
 
         if (request.getClusterName() == null) {
           LOG.warn("Cluster name is a required field.");
@@ -485,9 +482,8 @@ public class ConfigGroupResourceProvider extends
       || request.getTag() == null
       || request.getTag().isEmpty()) {
 
-      LOG.debug("Received a config group request with cluster name = " +
-        request.getClusterName() + ", group name = " + request.getGroupName()
-        + ", tag = " + request.getTag());
+      LOG.debug("Received a config group request with cluster name = {}, group name = {}, tag = {}",
+        request.getClusterName(), request.getGroupName(), request.getTag());
 
       throw new IllegalArgumentException("Cluster name, group name and tag need to be provided.");
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java
index ba60239..f051651 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java
@@ -117,9 +117,7 @@ public class GroupResourceProvider extends AbstractControllerResourceProvider {
       }
     });
 
-    LOG.debug("Found group responses matching get group request"
-        + ", groupRequestSize=" + requests.size() + ", groupResponseSize="
-        + responses.size());
+    LOG.debug("Found group responses matching get group request, groupRequestSize={}, groupResponseSize={}", requests.size(), responses.size());
 
     Set<String>   requestedIds = getRequestPropertyIds(request, predicate);
     Set<Resource> resources    = new HashSet<>();

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
index 5166a07..aaf4656 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
@@ -554,7 +554,7 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
         // throw exception if desired state isn't a valid desired state (static check)
         if (!newState.isValidDesiredState()) {
           throw new IllegalArgumentException("Invalid arguments, invalid"
-              + " desired state, desiredState=" + newState.toString());
+              + " desired state, desiredState=" + newState);
         }
       }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
index a3216eb..4e2944f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
@@ -465,7 +465,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
       }
       throw new IllegalArgumentException("Invalid request contains"
           + " duplicate hostnames"
-          + ", hostnames=" + names.toString());
+          + ", hostnames=" + names);
     }
 
     if (!unknowns.isEmpty()) {
@@ -480,7 +480,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
       }
 
       throw new IllegalArgumentException("Attempted to add unknown hosts to a cluster.  " +
-          "These hosts have not been registered with the server: " + names.toString());
+          "These hosts have not been registered with the server: " + names);
     }
 
     Map<String, Set<String>> hostClustersMap = new HashMap<>();
@@ -516,9 +516,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
     }
 
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Received a createHost request"
-          + ", hostname=" + request.getHostname()
-          + ", request=" + request);
+      LOG.debug("Received a createHost request, hostname={}, request={}", request.getHostname(), request);
     }
 
     if (allHosts.contains(request.getHostname())) {
@@ -689,9 +687,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
 
     for (HostRequest request : requests) {
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Received an updateHost request"
-            + ", hostname=" + request.getHostname()
-            + ", request=" + request);
+        LOG.debug("Received an updateHost request, hostname={}, request={}", request.getHostname(), request);
       }
 
       Host host = clusters.getHost(request.getHostname());

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStatusHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStatusHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStatusHelper.java
index 11512c4..f94b979 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStatusHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStatusHelper.java
@@ -56,7 +56,7 @@ public class HostStatusHelper {
 
       componentHostResponse = hostComponents.size() == 1 ? hostComponents.iterator().next() : null;
     } catch (AmbariException e) {
-      LOG.debug("Error checking " + componentName + " server host component state: ", e);
+      LOG.debug("Error checking {} server host component state: ", componentName, e);
       return false;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java
index 2080e93..e70c367 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java
@@ -42,15 +42,15 @@ import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
 import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Resource provider for job resources.
  */
 public class JobResourceProvider extends
     AbstractJDBCResourceProvider<JobResourceProvider.JobFields> {
-  private static Log LOG = LogFactory.getLog(JobResourceProvider.class);
+  private static final Logger LOG = LoggerFactory.getLogger(JobResourceProvider.class);
 
   protected static final String JOB_CLUSTER_NAME_PROPERTY_ID = PropertyHelper
       .getPropertyId("Job", "cluster_name");
@@ -224,14 +224,14 @@ public class JobResourceProvider extends
       String fields = getDBFieldString(requestedIds);
       if (requestedIds.contains(JOB_ELAPSED_TIME_PROPERTY_ID)
           && !requestedIds.contains(JOB_SUBMIT_TIME_PROPERTY_ID))
-        fields += "," + getDBField(JOB_SUBMIT_TIME_PROPERTY_ID).toString();
+        fields += "," + getDBField(JOB_SUBMIT_TIME_PROPERTY_ID);
       if (jobId == null) {
         ps = db.prepareStatement("SELECT " + fields + " FROM " + JOB_TABLE_NAME
-            + " WHERE " + JobFields.WORKFLOWID.toString() + " = ?");
+            + " WHERE " + JobFields.WORKFLOWID + " = ?");
         ps.setString(1, workflowId);
       } else {
         ps = db.prepareStatement("SELECT " + fields + " FROM " + JOB_TABLE_NAME
-            + " WHERE " + JobFields.JOBID.toString() + " = ?");
+            + " WHERE " + JobFields.JOBID + " = ?");
         ps.setString(1, jobId);
       }
       return ps.executeQuery();

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
index 48a9b47..d9d56ee 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
@@ -119,9 +119,7 @@ public class MemberResourceProvider extends AbstractControllerResourceProvider {
       }
     });
 
-    LOG.debug("Found member responses matching get members request"
-        + ", membersRequestSize=" + requests.size() + ", membersResponseSize="
-        + responses.size());
+    LOG.debug("Found member responses matching get members request, membersRequestSize={}, membersResponseSize={}", requests.size(), responses.size());
 
     Set<String>   requestedIds = getRequestPropertyIds(request, predicate);
     Set<Resource> resources    = new HashSet<>();

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
index 8f00456..ea8fb37 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
@@ -64,7 +64,7 @@ import com.google.inject.Provider;
  */
 @StaticallyInject
 public class PreUpgradeCheckResourceProvider extends ReadOnlyResourceProvider {
-  private static Logger LOG = LoggerFactory.getLogger(PreUpgradeCheckResourceProvider.class);
+  private static final Logger LOG = LoggerFactory.getLogger(PreUpgradeCheckResourceProvider.class);
 
   //----- Property ID constants ---------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
index f41eb26..deb0d7c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
@@ -453,7 +453,7 @@ public class RequestResourceProvider extends AbstractControllerResourceProvider
         resourceFilterList.addAll(parseRequestResourceFilter(resourceMap,
           (String) propertyMap.get(REQUEST_CLUSTER_NAME_PROPERTY_ID)));
       }
-      LOG.debug("RequestResourceFilters : " + resourceFilters);
+      LOG.debug("RequestResourceFilters : {}", resourceFilters);
     }
     // Extract operation level property
     RequestOperationLevel operationLevel = null;
@@ -658,9 +658,7 @@ public class RequestResourceProvider extends AbstractControllerResourceProvider
         status = org.apache.ambari.server.actionmanager.RequestStatus.valueOf(requestStatus);
       }
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Received a Get Request Status request"
-            + ", requestId=null"
-            + ", requestStatus=" + status);
+        LOG.debug("Received a Get Request Status request, requestId=null, requestStatus={}", status);
       }
 
       maxResults = (maxResults != null) ? maxResults : BaseRequest.DEFAULT_PAGE_SIZE;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestStageContainer.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestStageContainer.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestStageContainer.java
index 476c3d4..1452c3c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestStageContainer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestStageContainer.java
@@ -218,7 +218,7 @@ public class RequestStageContainer {
 
       if (request != null && request.getStages()!= null && !request.getStages().isEmpty()) {
         if (LOG.isDebugEnabled()) {
-          LOG.debug(String.format("Triggering Action Manager, request=%s", request));
+          LOG.debug("Triggering Action Manager, request={}", request);
         }
         actionManager.sendActions(request, actionRequest);
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
index 0600159..c97caee 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
@@ -596,7 +596,7 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider
       LOG.info("Received a updateService request"
           + ", clusterName=" + request.getClusterName()
           + ", serviceName=" + request.getServiceName()
-          + ", request=" + request.toString());
+          + ", request=" + request);
 
       clusterNames.add(request.getClusterName());
 
@@ -677,10 +677,8 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider
 
       if (newState == null) {
         if (LOG.isDebugEnabled()) {
-          LOG.debug("Nothing to do for new updateService request"
-              + ", clusterName=" + request.getClusterName()
-              + ", serviceName=" + request.getServiceName()
-              + ", newDesiredState=null");
+          LOG.debug("Nothing to do for new updateService request, clusterName={}, serviceName={}, newDesiredState=null",
+            request.getClusterName(), request.getServiceName());
         }
         continue;
       }
@@ -799,12 +797,8 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider
         changedComps.get(newState).add(sc);
       }
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Handling update to ServiceComponent"
-            + ", clusterName=" + cluster.getClusterName()
-            + ", serviceName=" + service.getName()
-            + ", componentName=" + sc.getName()
-            + ", currentDesiredState=" + oldScState
-            + ", newDesiredState=" + newState);
+        LOG.debug("Handling update to ServiceComponent, clusterName={}, serviceName={}, componentName={}, currentDesiredState={}, newDesiredState={}",
+          cluster.getClusterName(), service.getName(), sc.getName(), oldScState, newState);
       }
 
       for (ServiceComponentHost sch : sc.getServiceComponentHosts().values()) {
@@ -812,13 +806,8 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider
         if (oldSchState == State.DISABLED || oldSchState == State.UNKNOWN) {
           //Ignore host components updates in this state
           if (LOG.isDebugEnabled()) {
-            LOG.debug("Ignoring ServiceComponentHost"
-                + ", clusterName=" + cluster.getClusterName()
-                + ", serviceName=" + service.getName()
-                + ", componentName=" + sc.getName()
-                + ", hostname=" + sch.getHostName()
-                + ", currentState=" + oldSchState
-                + ", newDesiredState=" + newState);
+            LOG.debug("Ignoring ServiceComponentHost, clusterName={}, serviceName={}, componentName={}, hostname={}, currentState={}, newDesiredState={}",
+              cluster.getClusterName(), service.getName(), sc.getName(), sch.getHostName(), oldSchState, newState);
           }
           continue;
         }
@@ -826,13 +815,8 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider
         if (newState == oldSchState) {
           ignoredScHosts.add(sch);
           if (LOG.isDebugEnabled()) {
-            LOG.debug("Ignoring ServiceComponentHost"
-                + ", clusterName=" + cluster.getClusterName()
-                + ", serviceName=" + service.getName()
-                + ", componentName=" + sc.getName()
-                + ", hostname=" + sch.getHostName()
-                + ", currentState=" + oldSchState
-                + ", newDesiredState=" + newState);
+            LOG.debug("Ignoring ServiceComponentHost, clusterName={}, serviceName={}, componentName={}, hostname={}, currentState={}, newDesiredState={}",
+              cluster.getClusterName(), service.getName(), sc.getName(), sch.getHostName(), oldSchState, newState);
           }
           continue;
         }
@@ -840,11 +824,8 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider
         if (! maintenanceStateHelper.isOperationAllowed(reqOpLvl, sch)) {
           ignoredScHosts.add(sch);
           if (LOG.isDebugEnabled()) {
-            LOG.debug("Ignoring ServiceComponentHost"
-                + ", clusterName=" + cluster.getClusterName()
-                + ", serviceName=" + service.getName()
-                + ", componentName=" + sc.getName()
-                + ", hostname=" + sch.getHostName());
+            LOG.debug("Ignoring ServiceComponentHost, clusterName={}, serviceName={}, componentName={}, hostname={}",
+              cluster.getClusterName(), service.getName(), sc.getName(), sch.getHostName());
           }
           continue;
         }
@@ -887,13 +868,8 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider
               new ArrayList<ServiceComponentHost>());
         }
         if (LOG.isDebugEnabled()) {
-          LOG.debug("Handling update to ServiceComponentHost"
-              + ", clusterName=" + cluster.getClusterName()
-              + ", serviceName=" + service.getName()
-              + ", componentName=" + sc.getName()
-              + ", hostname=" + sch.getHostName()
-              + ", currentState=" + oldSchState
-              + ", newDesiredState=" + newState);
+          LOG.debug("Handling update to ServiceComponentHost, clusterName={}, serviceName={}, componentName={}, hostname={}, currentState={}, newDesiredState={}",
+            cluster.getClusterName(), service.getName(), sc.getName(), sch.getHostName(), oldSchState, newState);
         }
         changedScHosts.get(sc.getName()).get(newState).add(sch);
       }
@@ -1048,8 +1024,7 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider
       Validate.notEmpty(serviceName, "Service name should be provided when creating a service");
 
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Received a createService request"
-                + ", clusterName=" + clusterName + ", serviceName=" + serviceName + ", request=" + request);
+        LOG.debug("Received a createService request, clusterName={}, serviceName={}, request={}", clusterName, serviceName, request);
       }
 
       if(!AuthorizationHelper.isAuthorized(ResourceType.CLUSTER, getClusterResourceId(clusterName), RoleAuthorization.SERVICE_ADD_DELETE_SERVICES)) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/TaskAttemptResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/TaskAttemptResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/TaskAttemptResourceProvider.java
index 2165fc7..3af7bb1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/TaskAttemptResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/TaskAttemptResourceProvider.java
@@ -42,15 +42,15 @@ import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
 import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Resource provider for task attempt resources.
  */
 public class TaskAttemptResourceProvider extends
     AbstractJDBCResourceProvider<TaskAttemptResourceProvider.TaskAttemptFields> {
-  private static Log LOG = LogFactory.getLog(TaskAttemptResourceProvider.class);
+  private static final Logger LOG = LoggerFactory.getLogger(TaskAttemptResourceProvider.class);
 
   protected static final String TASK_ATTEMPT_CLUSTER_NAME_PROPERTY_ID = PropertyHelper
       .getPropertyId("TaskAttempt", "cluster_name");

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java
index ff36d9b..d1e9349 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java
@@ -38,9 +38,9 @@ import javax.net.ssl.TrustManagerFactory;
 import org.apache.ambari.server.configuration.ComponentSSLConfiguration;
 import org.apache.ambari.server.controller.utilities.StreamProvider;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.http.HttpStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * URL based implementation of a stream provider.
@@ -50,7 +50,7 @@ public class URLStreamProvider implements StreamProvider {
   public static final String COOKIE = "Cookie";
   private static final String WWW_AUTHENTICATE = "WWW-Authenticate";
   private static final String NEGOTIATE = "Negotiate";
-  private static Log LOG = LogFactory.getLog(URLStreamProvider.class);
+  private static final Logger LOG = LoggerFactory.getLogger(URLStreamProvider.class);
 
   private boolean setupTruststoreForHttps;
   private final int connTimeout;
@@ -175,7 +175,7 @@ public class URLStreamProvider implements StreamProvider {
   public HttpURLConnection processURL(String spec, String requestMethod, byte[] body, Map<String, List<String>> headers)
           throws IOException {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("readFrom spec:" + spec);
+      LOG.debug("readFrom spec:{}", spec);
     }
 
     HttpURLConnection connection = (spec.startsWith("https") && this.setupTruststoreForHttps) ?
@@ -185,7 +185,7 @@ public class URLStreamProvider implements StreamProvider {
 
     String appCookie = appCookieManager.getCachedAppCookie(spec);
     if (appCookie != null) {
-      LOG.debug("Using cached app cookie for URL:" + spec);
+      LOG.debug("Using cached app cookie for URL:{}", spec);
 
       // allow for additional passed in cookies
       if (headers == null || headers.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java
index 2ec63db..c5c36e9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java
@@ -119,9 +119,7 @@ public class UserResourceProvider extends AbstractControllerResourceProvider imp
     });
 
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Found user responses matching get user request"
-          + ", userRequestSize=" + requests.size()
-          + ", userResponseSize=" + responses.size());
+      LOG.debug("Found user responses matching get user request, userRequestSize={}, userResponseSize={}", requests.size(), responses.size());
     }
 
     Set<String>   requestedIds = getRequestPropertyIds(request, predicate);

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
index 494f32b..2c5ab2b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
@@ -170,7 +170,7 @@ public class WidgetLayoutResourceProvider extends AbstractControllerResourceProv
             long id = Integer.parseInt(widget.get("id").toString());
             WidgetEntity widgetEntity = widgetDAO.findById(id);
             if (widgetEntity == null) {
-              throw new AmbariException("Widget with id " + widget.get("id").toString() + " does not exists");
+              throw new AmbariException("Widget with id " + widget.get("id") + " does not exists");
             }
             WidgetLayoutUserWidgetEntity widgetLayoutUserWidgetEntity = new WidgetLayoutUserWidgetEntity();
 
@@ -308,7 +308,7 @@ public class WidgetLayoutResourceProvider extends AbstractControllerResourceProv
               long id = Integer.parseInt(widget.get("id").toString());
               WidgetEntity widgetEntity = widgetDAO.findById(id);
               if (widgetEntity == null) {
-                throw new AmbariException("Widget with id " + widget.get("id").toString() + " does not exists");
+                throw new AmbariException("Widget with id " + widget.get("id") + " does not exists");
               }
               WidgetLayoutUserWidgetEntity widgetLayoutUserWidgetEntity = new WidgetLayoutUserWidgetEntity();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java
index e3935bb..13cb8a4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java
@@ -42,15 +42,15 @@ import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
 import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Resource provider for workflow resources.
  */
 public class WorkflowResourceProvider extends
     AbstractJDBCResourceProvider<WorkflowResourceProvider.WorkflowFields> {
-  private static Log LOG = LogFactory.getLog(WorkflowResourceProvider.class);
+  private static final Logger LOG = LoggerFactory.getLogger(WorkflowResourceProvider.class);
 
   protected static final String WORKFLOW_CLUSTER_NAME_PROPERTY_ID = PropertyHelper
       .getPropertyId("Workflow", "cluster_name");

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
index 5347919..81d72fb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
@@ -42,7 +42,7 @@ public final class JMXMetricHolder {
 
     for (Map<String, Object> map : beans) {
       for (Map.Entry<String, Object> entry : map.entrySet()) {
-        stringBuilder.append("    ").append(entry.toString()).append("\n");
+        stringBuilder.append("    ").append(entry).append("\n");
       }
     }
     return stringBuilder.toString();

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogSearchDataRetrievalService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogSearchDataRetrievalService.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogSearchDataRetrievalService.java
index 4370cfc..498b636 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogSearchDataRetrievalService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogSearchDataRetrievalService.java
@@ -68,7 +68,7 @@ import com.google.inject.Injector;
 @AmbariService
 public class LogSearchDataRetrievalService extends AbstractService {
 
-  private static Logger LOG = LoggerFactory.getLogger(LogSearchDataRetrievalService.class);
+  private static final Logger LOG = LoggerFactory.getLogger(LogSearchDataRetrievalService.class);
 
   /**
    * Maximum number of failed attempts that the LogSearch integration code will attempt for
@@ -147,7 +147,7 @@ public class LogSearchDataRetrievalService extends AbstractService {
     final int maxTimeoutForCacheInHours =
       ambariServerConfiguration.getLogSearchMetadataCacheExpireTimeout();
 
-    LOG.debug("Caches configured with a max expire timeout of " + maxTimeoutForCacheInHours + " hours.");
+    LOG.debug("Caches configured with a max expire timeout of {} hours.", maxTimeoutForCacheInHours);
 
     // initialize the log file name cache
     logFileNameCache = CacheBuilder.newBuilder().expireAfterWrite(maxTimeoutForCacheInHours, TimeUnit.HOURS).build();

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java
index 7e7656d..ff44b0f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java
@@ -70,7 +70,7 @@ import org.slf4j.LoggerFactory;
  */
 public class LoggingRequestHelperImpl implements LoggingRequestHelper {
 
-  private static Logger LOG = LoggerFactory.getLogger(LoggingRequestHelperImpl.class);
+  private static final Logger LOG = LoggerFactory.getLogger(LoggingRequestHelperImpl.class);
 
   private static final String LOGSEARCH_ADMIN_JSON_CONFIG_TYPE_NAME = "logsearch-admin-json";
 
@@ -156,7 +156,7 @@ public class LoggingRequestHelperImpl implements LoggingRequestHelper {
     try {
       // use the Apache builder to create the correct URI
       URI logSearchURI = createLogSearchQueryURI(protocol, queryParameters);
-      LOG.debug("Attempting to connect to LogSearch server at " + logSearchURI);
+      LOG.debug("Attempting to connect to LogSearch server at {}", logSearchURI);
       HttpURLConnection httpURLConnection  = (HttpURLConnection) logSearchURI.toURL().openConnection();
       secure(httpURLConnection, protocol);
       httpURLConnection.setRequestMethod("GET");
@@ -313,7 +313,7 @@ public class LoggingRequestHelperImpl implements LoggingRequestHelper {
       LogLineResult lineOne = response.getListOfResults().get(0);
       // this assumes that each component has only one associated log file,
       // which may not always hold true
-      LOG.debug("For componentName = " + componentName + ", log file name is = " + lineOne.getLogFilePath());
+      LOG.debug("For componentName = {}, log file name is = {}", componentName, lineOne.getLogFilePath());
       return Collections.singleton(lineOne.getLogFilePath());
 
     }
@@ -326,7 +326,7 @@ public class LoggingRequestHelperImpl implements LoggingRequestHelper {
     try {
       // use the Apache builder to create the correct URI
       URI logLevelQueryURI = createLogLevelQueryURI(protocol, componentName, hostName);
-      LOG.debug("Attempting to connect to LogSearch server at " + logLevelQueryURI);
+      LOG.debug("Attempting to connect to LogSearch server at {}", logLevelQueryURI);
 
       HttpURLConnection httpURLConnection  = (HttpURLConnection) logLevelQueryURI.toURL().openConnection();
       secure(httpURLConnection, protocol);
@@ -446,7 +446,8 @@ public class LoggingRequestHelperImpl implements LoggingRequestHelper {
       if (credential == null) {
         LOG.debug("LogSearch credentials could not be obtained from store.");
       } else {
-        LOG.debug("LogSearch credentials were not of the correct type, this is likely an error in configuration, credential type is = " + credential.getClass().getName());
+        LOG.debug("LogSearch credentials were not of the correct type, this is likely an error in configuration, credential type is = {}",
+          credential.getClass().getName());
       }
     } catch (AmbariException ambariException) {
       LOG.debug("Error encountered while trying to obtain LogSearch admin credentials.", ambariException);
@@ -488,7 +489,7 @@ public class LoggingRequestHelperImpl implements LoggingRequestHelper {
         // read in the response from LogSearch
         resultStream = httpURLConnection.getInputStream();
         BufferedReader reader = new BufferedReader(new InputStreamReader(resultStream));
-        LOG.debug("Response code from LogSearch Service is = " + httpURLConnection.getResponseCode());
+        LOG.debug("Response code from LogSearch Service is = {}", httpURLConnection.getResponseCode());
 
 
         String line = reader.readLine();
@@ -498,7 +499,7 @@ public class LoggingRequestHelperImpl implements LoggingRequestHelper {
           line = reader.readLine();
         }
 
-        LOG.debug("Sucessfully retrieved response from server, response = " + buffer);
+        LOG.debug("Sucessfully retrieved response from server, response = {}", buffer);
 
         return buffer;
       } finally {

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
index 05fbc5a..64261b3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
@@ -85,9 +85,9 @@ public class LoggingSearchPropertyProvider implements PropertyProvider {
       // Test to see if the authenticated user is authorized to view this data... if not, skip it.
       if(!AuthorizationHelper.isAuthorized(ResourceType.CLUSTER, getClusterResourceID(clusterName), REQUIRED_AUTHORIZATIONS)) {
         if(LOG.isDebugEnabled()) {
-          LOG.debug(String.format("The authenticated user (%s) is not authorized to access LogSearch data for the cluster named %s",
+          LOG.debug("The authenticated user ({}) is not authorized to access LogSearch data for the cluster named {}",
               AuthorizationHelper.getAuthenticatedName(),
-              clusterName));
+              clusterName);
         }
         continue;
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAManager.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAManager.java
index b1dfed9..f107aab 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsCollectorHAManager.java
@@ -84,7 +84,7 @@ public class MetricsCollectorHAManager {
   @Subscribe
   public void onMetricsCollectorHostDownEvent(MetricsCollectorHostDownEvent event) {
 
-    LOG.debug("MetricsCollectorHostDownEvent caught, Down collector : " + event.getCollectorHost());
+    LOG.debug("MetricsCollectorHostDownEvent caught, Down collector : {}", event.getCollectorHost());
 
     String clusterName = event.getClusterName();
     MetricsCollectorHAClusterState collectorHAClusterState = clusterCollectorHAState.get(clusterName);

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethod.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethod.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethod.java
index 8044c7b..5994f16 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethod.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethod.java
@@ -40,9 +40,8 @@ public abstract class MetricsDownsamplingMethod {
         && timestamp <= temporalInfo.getEndTimeMillis();
 
     if (!retVal && LOG.isTraceEnabled()) {
-      LOG.trace("Ignoring out of band metric with ts: " + timestamp + ", "
-        + "temporalInfo: startTime = " + temporalInfo.getStartTimeMillis() + ","
-        + " endTime = " + temporalInfo.getEndTimeMillis());
+      LOG.trace("Ignoring out of band metric with ts: {}, temporalInfo: startTime = {}, endTime = {}",
+        timestamp, temporalInfo.getStartTimeMillis(), temporalInfo.getEndTimeMillis());
     }
 
     return retVal;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
index b1ab855..6d859fa 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
@@ -716,7 +716,7 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
   private String preprocessPropertyId(String propertyId, String componentName) {
     if (propertyId.startsWith("jvm") && JVM_PROCESS_NAMES.keySet().contains(componentName)) {
       String newPropertyId = propertyId.replace("jvm.", "jvm." + JVM_PROCESS_NAMES.get(componentName));
-      LOG.debug("Pre-process: " + propertyId + ", to: " + newPropertyId);
+      LOG.debug("Pre-process: {}, to: {}", propertyId, newPropertyId);
       return newPropertyId;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java
index efb9d2d..87a4634 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java
@@ -71,7 +71,7 @@ public class MetricsRequestHelper {
   }
 
   public TimelineMetrics fetchTimelineMetrics(URIBuilder uriBuilder, Long startTime, Long endTime) throws IOException {
-    LOG.debug("Metrics request url = " + uriBuilder.toString());
+    LOG.debug("Metrics request url = {}", uriBuilder);
     BufferedReader reader = null;
     TimelineMetrics timelineMetrics = null;
     try {
@@ -83,7 +83,7 @@ public class MetricsRequestHelper {
         //Try one more time with higher precision
         String higherPrecision = getHigherPrecision(uriBuilder, startTime, endTime);
         if (higherPrecision != null) {
-          LOG.debug("Requesting metrics with higher precision : " + higherPrecision);
+          LOG.debug("Requesting metrics with higher precision : {}", higherPrecision);
           uriBuilder.setParameter("precision", higherPrecision);
           String newSpec = uriBuilder.toString();
           connection = streamProvider.processURL(newSpec, HttpMethod.GET, (String) null,
@@ -102,13 +102,9 @@ public class MetricsRequestHelper {
 
       if (LOG.isTraceEnabled()) {
         for (TimelineMetric metric : timelineMetrics.getMetrics()) {
-          LOG.trace("metric: " + metric.getMetricName() +
-            ", size = " + metric.getMetricValues().size() +
-            ", host = " + metric.getHostName() +
-            ", app = " + metric.getAppId() +
-            ", instance = " + metric.getInstanceId() +
-            ", time = " + metric.getTimestamp() +
-            ", startTime = " + new Date(metric.getStartTime()));
+          LOG.trace("metric: {}, size = {}, host = {}, app = {}, instance = {}, time = {}, startTime = {}",
+            metric.getMetricName(), metric.getMetricValues().size(), metric.getHostName(), metric.getAppId(), metric.getInstanceId(), metric.getTimestamp(),
+            new Date(metric.getStartTime()));
         }
       }
     } catch (IOException io) {
@@ -136,9 +132,9 @@ public class MetricsRequestHelper {
         } catch (IOException e) {
           if (LOG.isWarnEnabled()) {
             if (LOG.isDebugEnabled()) {
-              LOG.warn("Unable to close http input stream : spec=" + uriBuilder.toString(), e);
+              LOG.warn("Unable to close http input stream : spec=" + uriBuilder, e);
             } else {
-              LOG.warn("Unable to close http input stream : spec=" + uriBuilder.toString());
+              LOG.warn("Unable to close http input stream : spec=" + uriBuilder);
             }
           }
         }
@@ -155,7 +151,7 @@ public class MetricsRequestHelper {
       BufferedReader reader = new BufferedReader(new InputStreamReader(errorStream));
       String errorMessage = reader.readLine();
       if (errorMessage != null && errorMessage.contains("PrecisionLimitExceededException")) {
-        LOG.debug("Encountered Precision exception while requesting metrics : " + errorMessage);
+        LOG.debug("Encountered Precision exception while requesting metrics : {}", errorMessage);
         return false;
       } else {
         throw new IOException(errorMessage);

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCache.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCache.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCache.java
index 472e3ea..bfe8456 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCache.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCache.java
@@ -57,7 +57,7 @@ public class TimelineMetricCache extends UpdatingSelfPopulatingCache {
    */
   public TimelineMetrics getAppTimelineMetricsFromCache(TimelineAppMetricCacheKey key) throws IllegalArgumentException, IOException {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Fetching metrics with key: " + key);
+      LOG.debug("Fetching metrics with key: {}", key);
     }
 
     // Make sure key is valid
@@ -84,7 +84,7 @@ public class TimelineMetricCache extends UpdatingSelfPopulatingCache {
     if (element != null && element.getObjectValue() != null) {
       TimelineMetricsCacheValue value = (TimelineMetricsCacheValue) element.getObjectValue();
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Returning value from cache: " + value);
+        LOG.debug("Returning value from cache: {}", value);
       }
       timelineMetrics = value.getTimelineMetrics();
     }
@@ -93,14 +93,9 @@ public class TimelineMetricCache extends UpdatingSelfPopulatingCache {
       // Print stats every 100 calls - Note: Supported in debug mode only
       if (printCacheStatsCounter.getAndIncrement() == 0) {
         StatisticsGateway statistics = this.getStatistics();
-        LOG.debug("Metrics cache stats => \n" +
-          ", Evictions = " + statistics.cacheEvictedCount() +
-          ", Expired = " + statistics.cacheExpiredCount() +
-          ", Hits = " + statistics.cacheHitCount() +
-          ", Misses = " + statistics.cacheMissCount() +
-          ", Hit ratio = " + statistics.cacheHitRatio() +
-          ", Puts = " + statistics.cachePutCount() +
-          ", Size in MB = " + (statistics.getLocalHeapSizeInBytes() / 1048576));
+        LOG.debug("Metrics cache stats => \n, Evictions = {}, Expired = {}, Hits = {}, Misses = {}, Hit ratio = {}, Puts = {}, Size in MB = {}",
+          statistics.cacheEvictedCount(), statistics.cacheExpiredCount(), statistics.cacheHitCount(), statistics.cacheMissCount(), statistics.cacheHitRatio(),
+          statistics.cachePutCount(), statistics.getLocalHeapSizeInBytes() / 1048576);
       } else {
         printCacheStatsCounter.compareAndSet(100, 0);
       }
@@ -119,26 +114,23 @@ public class TimelineMetricCache extends UpdatingSelfPopulatingCache {
     Element element = this.getQuiet(key);
     if (element != null) {
       if (LOG.isTraceEnabled()) {
-        LOG.trace("key : " + element.getObjectKey());
-        LOG.trace("value : " + element.getObjectValue());
+        LOG.trace("key : {}", element.getObjectKey());
+        LOG.trace("value : {}", element.getObjectValue());
       }
 
       // Set new time boundaries on the key
       TimelineAppMetricCacheKey existingKey = (TimelineAppMetricCacheKey) element.getObjectKey();
 
-      LOG.debug("Existing temporal info: " + existingKey.getTemporalInfo() +
-        " for : " + existingKey.getMetricNames());
+      LOG.debug("Existing temporal info: {} for : {}", existingKey.getTemporalInfo(), existingKey.getMetricNames());
 
       TimelineAppMetricCacheKey newKey = (TimelineAppMetricCacheKey) key;
       existingKey.setTemporalInfo(newKey.getTemporalInfo());
 
-      LOG.debug("New temporal info: " + newKey.getTemporalInfo() +
-        " for : " + existingKey.getMetricNames());
+      LOG.debug("New temporal info: {} for : {}", newKey.getTemporalInfo(), existingKey.getMetricNames());
 
       if (existingKey.getSpec() == null || !existingKey.getSpec().equals(newKey.getSpec())) {
         existingKey.setSpec(newKey.getSpec());
-        LOG.debug("New spec: " + newKey.getSpec() +
-          " for : " + existingKey.getMetricNames());
+        LOG.debug("New spec: {} for : {}", newKey.getSpec(), existingKey.getMetricNames());
       }
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCacheEntryFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCacheEntryFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCacheEntryFactory.java
index b9f3e0f..343587b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCacheEntryFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCacheEntryFactory.java
@@ -75,7 +75,7 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
    */
   @Override
   public Object createEntry(Object key) throws Exception {
-    LOG.debug("Creating cache entry since none exists, key = " + key);
+    LOG.debug("Creating cache entry since none exists, key = {}", key);
     TimelineAppMetricCacheKey metricCacheKey = (TimelineAppMetricCacheKey) key;
 
     TimelineMetrics timelineMetrics = null;
@@ -85,7 +85,7 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
         metricCacheKey.getTemporalInfo().getStartTimeMillis(),
         metricCacheKey.getTemporalInfo().getEndTimeMillis());
     } catch (IOException io) {
-      LOG.debug("Caught IOException on fetching metrics. " + io.getMessage());
+      LOG.debug("Caught IOException on fetching metrics. {}", io.getMessage());
       throw io;
     }
 
@@ -100,7 +100,7 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
           metricCacheKey.getTemporalInfo().getEndTimeMillis()) //Initial Precision
       );
 
-      LOG.debug("Created cache entry: " + value);
+      LOG.debug("Created cache entry: {}", value);
     }
 
     return value;
@@ -120,7 +120,7 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
     TimelineAppMetricCacheKey metricCacheKey = (TimelineAppMetricCacheKey) key;
     TimelineMetricsCacheValue existingMetrics = (TimelineMetricsCacheValue) value;
 
-    LOG.debug("Updating cache entry, key: " + key + ", with value = " + value);
+    LOG.debug("Updating cache entry, key: {}, with value = {}", key, value);
 
     Long existingSeriesStartTime = existingMetrics.getStartTime();
     Long existingSeriesEndTime = existingMetrics.getEndTime();
@@ -139,12 +139,12 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
     Long newEndTime = null;
     if(!requestedPrecision.equals(currentPrecision)) {
       // Ignore cache entry. Get the entire data from the AMS and update the cache.
-      LOG.debug("Precision changed from " + currentPrecision + " to " + requestedPrecision);
+      LOG.debug("Precision changed from {} to {}", currentPrecision, requestedPrecision);
       newStartTime = requestedStartTime;
       newEndTime = requestedEndTime;
     } else {
       //Get only the metric values for the delta period from the cache.
-      LOG.debug("No change in precision " + currentPrecision);
+      LOG.debug("No change in precision {}", currentPrecision);
       newStartTime = getRefreshRequestStartTime(existingSeriesStartTime,
           existingSeriesEndTime, requestedStartTime);
       newEndTime = getRefreshRequestEndTime(existingSeriesStartTime,
@@ -157,13 +157,11 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
        !((newStartTime.equals(existingSeriesStartTime) &&
        newEndTime.equals(existingSeriesEndTime)) && requestedPrecision.equals(currentPrecision)) ) {
 
-      LOG.debug("Existing cached timeseries startTime = " +
-          new Date(getMillisecondsTime(existingSeriesStartTime)) + ", endTime = " +
-          new Date(getMillisecondsTime(existingSeriesEndTime)));
+      LOG.debug("Existing cached timeseries startTime = {}, endTime = {}",
+        new Date(getMillisecondsTime(existingSeriesStartTime)), new Date(getMillisecondsTime(existingSeriesEndTime)));
 
-      LOG.debug("Requested timeseries startTime = " +
-          new Date(getMillisecondsTime(newStartTime)) + ", endTime = " +
-          new Date(getMillisecondsTime(newEndTime)));
+      LOG.debug("Requested timeseries startTime = {}, endTime = {}",
+        new Date(getMillisecondsTime(newStartTime)), new Date(getMillisecondsTime(newEndTime)));
 
       // Update spec with new start and end time
       uriBuilder.setParameter("startTime", String.valueOf(newStartTime));
@@ -190,9 +188,8 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
         throw io;
       }
     } else {
-      LOG.debug("Skip updating cache with new startTime = " +
-        new Date(getMillisecondsTime(newStartTime)) +
-        ", new endTime = " + new Date(getMillisecondsTime(newEndTime)));
+      LOG.debug("Skip updating cache with new startTime = {}, new endTime = {}",
+        new Date(getMillisecondsTime(newStartTime)), new Date(getMillisecondsTime(newEndTime)));
     }
   }
 
@@ -214,9 +211,8 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
         if (LOG.isTraceEnabled()) {
           TreeMap<Long, Double> sortedMetrics = new TreeMap<>(timelineMetric.getMetricValues());
 
-          LOG.trace("New metric: " + timelineMetric.getMetricName() +
-            " # " + timelineMetric.getMetricValues().size() + ", startTime = " +
-            sortedMetrics.firstKey() + ", endTime = " + sortedMetrics.lastKey());
+          LOG.trace("New metric: {} # {}, startTime = {}, endTime = {}",
+            timelineMetric.getMetricName(), timelineMetric.getMetricValues().size(), sortedMetrics.firstKey(), sortedMetrics.lastKey());
         }
 
         TimelineMetric existingMetric = null;
@@ -233,9 +229,8 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
 
           if (LOG.isTraceEnabled()) {
             TreeMap<Long, Double> sortedMetrics = new TreeMap<>(existingMetric.getMetricValues());
-            LOG.trace("Merged metric: " + timelineMetric.getMetricName() + ", " +
-              "Final size: " + existingMetric.getMetricValues().size() + ", startTime = " +
-              sortedMetrics.firstKey() + ", endTime = " + sortedMetrics.lastKey());
+            LOG.trace("Merged metric: {}, Final size: {}, startTime = {}, endTime = {}",
+              timelineMetric.getMetricName(), existingMetric.getMetricValues().size(), sortedMetrics.firstKey(), sortedMetrics.lastKey());
           }
         } else {
           existingTimelineMetrics.getMetrics().add(timelineMetric);
@@ -253,8 +248,7 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
         existingMetric.setMetricValues(new TreeMap<Long, Double>());
       } else {
         TreeMap<Long, Double> existingMetricValues = existingMetric.getMetricValues();
-        LOG.trace("Existing metric: " + existingMetric.getMetricName() +
-          " # " + existingMetricValues.size());
+        LOG.trace("Existing metric: {} # {}", existingMetric.getMetricName(), existingMetricValues.size());
 
         // Retain only the values that are within the [requestStartTime, requestedEndTime] window
         existingMetricValues.headMap(requestedStartTime,false).clear();
@@ -281,8 +275,7 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
       startTime = getTimeShiftedStartTime(existingSeriesEndTime);
     }
 
-    LOG.trace("Requesting timeseries data with new startTime = " +
-      new Date(getMillisecondsTime(startTime)));
+    LOG.trace("Requesting timeseries data with new startTime = {}", new Date(getMillisecondsTime(startTime)));
 
     return startTime;
   }
@@ -303,8 +296,7 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
       endTime = existingSeriesStartTime;
     }
 
-    LOG.trace("Requesting timeseries data with new endTime = " +
-      new Date(getMillisecondsTime(endTime)));
+    LOG.trace("Requesting timeseries data with new endTime = {}", new Date(getMillisecondsTime(endTime)));
     return endTime;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricsCacheSizeOfEngine.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricsCacheSizeOfEngine.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricsCacheSizeOfEngine.java
index 1470da9..2401d75 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricsCacheSizeOfEngine.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricsCacheSizeOfEngine.java
@@ -124,7 +124,7 @@ public class TimelineMetricsCacheSizeOfEngine implements SizeOfEngine {
           timelineMetricPrimitivesApproximation += reflectionSizeOf.sizeOf(metric.getType());
           timelineMetricPrimitivesApproximation += 8; // Object overhead
 
-          LOG.debug("timelineMetricPrimitivesApproximation bytes = " + timelineMetricPrimitivesApproximation);
+          LOG.debug("timelineMetricPrimitivesApproximation bytes = {}", timelineMetricPrimitivesApproximation);
         }
         size += timelineMetricPrimitivesApproximation;
 
@@ -132,11 +132,11 @@ public class TimelineMetricsCacheSizeOfEngine implements SizeOfEngine {
         if (metricValues != null && !metricValues.isEmpty()) {
           // Numeric wrapper: 12 bytes + 8 bytes Data type + 4 bytes alignment = 48 (Long, Double)
           // Tree Map: 12 bytes for header + 20 bytes for 5 object fields : pointers + 1 byte for flag = 40
-         LOG.debug("Size of metric value: " + (sizeOfMapEntry + sizeOfMapEntryOverhead) * metricValues.size());
+          LOG.debug("Size of metric value: {}", (sizeOfMapEntry + sizeOfMapEntryOverhead) * metricValues.size());
           size += (sizeOfMapEntry + sizeOfMapEntryOverhead) * metricValues.size(); // Treemap size is O(1)
         }
       }
-      LOG.debug("Total Size of metric values in cache: " + size);
+      LOG.debug("Total Size of metric values in cache: {}", size);
     }
 
     return size;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/KerberosChecker.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/KerberosChecker.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/KerberosChecker.java
index 5097c09..b262c12 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/KerberosChecker.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/KerberosChecker.java
@@ -41,7 +41,7 @@ public class KerberosChecker {
   public static final String JAVA_SECURITY_AUTH_LOGIN_CONFIG =
       "java.security.auth.login.config";
 
-  private static Logger LOG = LoggerFactory.getLogger(KerberosChecker.class);
+  private static final Logger LOG = LoggerFactory.getLogger(KerberosChecker.class);
 
   @Inject
   static Configuration config;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/ServiceCalculatedStateFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/ServiceCalculatedStateFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/ServiceCalculatedStateFactory.java
index d95a753..935361c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/ServiceCalculatedStateFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/ServiceCalculatedStateFactory.java
@@ -51,7 +51,7 @@ public class ServiceCalculatedStateFactory {
     try {
       serviceType = Service.Type.valueOf(service);
     } catch (Exception e){
-      LOG.debug(String.format("Could not parse service name \"%s\", will use default state provider", service));
+      LOG.debug("Could not parse service name \"{}\", will use default state provider", service);
     }
 
     if (serviceType == null) {  // service is unknown, return default service state provider

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/credentialapi/CredentialUtil.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/credentialapi/CredentialUtil.java b/ambari-server/src/main/java/org/apache/ambari/server/credentialapi/CredentialUtil.java
index e6d7a37..52325d4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/credentialapi/CredentialUtil.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/credentialapi/CredentialUtil.java
@@ -424,7 +424,7 @@ public class CredentialUtil extends Configured implements Tool {
           // prompt the user to confirm or reject the overwrite
           overwrite = ToolRunner
                   .confirmPrompt("You are about to OVERWRITE the credential " +
-                          alias + " from CredentialProvider " + provider.toString() +
+                          alias + " from CredentialProvider " + provider +
                           ". Continue? ");
         }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionManager.java b/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionManager.java
index 9260993..1f2d26f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionManager.java
@@ -105,9 +105,9 @@ public class ActionDefinitionManager {
           continue;
         }
         for (ActionDefinitionSpec ad : adx.actionDefinitions()) {
-          LOG.debug("Read action definition = " + ad.toString());
+          LOG.debug("Read action definition = {}", ad);
           StringBuilder errorReason =
-              new StringBuilder("Error while parsing action definition. ").append(ad.toString()).append(" --- ");
+              new StringBuilder("Error while parsing action definition. ").append(ad).append(" --- ");
 
           TargetHostType targetType = safeValueOf(TargetHostType.class, ad.getTargetType(), errorReason);
           ActionType actionType = safeValueOf(ActionType.class, ad.getActionType(), errorReason);
@@ -121,7 +121,7 @@ public class ActionDefinitionManager {
             String actionName = ad.getActionName();
             if (actionDefinitionMap.containsKey(actionName)) {
               LOG.warn("Ignoring action definition as a different definition by that name already exists. "
-                  + ad.toString());
+                  + ad);
               continue;
             }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertHashInvalidationListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertHashInvalidationListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertHashInvalidationListener.java
index 2d37430..f418abb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertHashInvalidationListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertHashInvalidationListener.java
@@ -56,7 +56,7 @@ public class AlertHashInvalidationListener {
   /**
    * Logger.
    */
-  private static Logger LOG = LoggerFactory.getLogger(AlertHashInvalidationListener.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AlertHashInvalidationListener.class);
 
   /**
    * Invalidates hosts so that they can receive updated alert definition

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertLifecycleListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertLifecycleListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertLifecycleListener.java
index 31c2f4a..9dce45a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertLifecycleListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertLifecycleListener.java
@@ -53,7 +53,7 @@ public class AlertLifecycleListener {
   /**
    * Logger.
    */
-  private static Logger LOG = LoggerFactory.getLogger(AlertLifecycleListener.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AlertLifecycleListener.class);
 
   /**
    * Used for quick lookups of aggregate alerts.

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertMaintenanceModeListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertMaintenanceModeListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertMaintenanceModeListener.java
index 64372e0..f73d7c9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertMaintenanceModeListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertMaintenanceModeListener.java
@@ -54,7 +54,7 @@ public class AlertMaintenanceModeListener {
   /**
    * Logger.
    */
-  private static Logger LOG = LoggerFactory.getLogger(AlertMaintenanceModeListener.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AlertMaintenanceModeListener.class);
 
   /**
    * Publishes {@link AlertEvent} instances.

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceComponentHostListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceComponentHostListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceComponentHostListener.java
index ec61e8c..3563e99 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceComponentHostListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceComponentHostListener.java
@@ -38,7 +38,7 @@ public class AlertServiceComponentHostListener {
   /**
    * Logger.
    */
-  private static Logger LOG = LoggerFactory.getLogger(AlertServiceComponentHostListener.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AlertServiceComponentHostListener.class);
 
   /**
    * Used for deleting the alert notices when a definition is disabled.

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java
index 7a936fe..053fb54 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java
@@ -60,7 +60,7 @@ public class AlertServiceStateListener {
   /**
    * Logger.
    */
-  private static Logger LOG = LoggerFactory.getLogger(AlertServiceStateListener.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AlertServiceStateListener.class);
 
   /**
    * Services metainfo; injected lazily as a {@link Provider} since JPA is not

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java
index bc24b6d..d5dc530 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java
@@ -77,7 +77,7 @@ public class AlertStateChangedListener {
   /**
    * Logger.
    */
-  private static Logger LOG = LoggerFactory.getLogger(AlertStateChangedListener.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AlertStateChangedListener.class);
 
   /**
    * A logger that is only for logging alert state changes so that there is an


Mime
View raw message