ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [44/50] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: concatenation in debug messages, unnecessary toString calls
Date Mon, 12 Jun 2017 16:45:51 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/metadata/CachedRoleCommandOrderProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metadata/CachedRoleCommandOrderProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/metadata/CachedRoleCommandOrderProvider.java
index a874f99..c6315a7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metadata/CachedRoleCommandOrderProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metadata/CachedRoleCommandOrderProvider.java
@@ -38,7 +38,7 @@ import com.google.inject.Injector;
  */
 public class CachedRoleCommandOrderProvider implements RoleCommandOrderProvider {
 
-  private static Logger LOG = LoggerFactory.getLogger(CachedRoleCommandOrderProvider.class);
+  private static final Logger LOG = LoggerFactory.getLogger(CachedRoleCommandOrderProvider.class);
 
   @Inject
   private Injector injector;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java b/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java
index fc6c124..ef2c9a9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java
@@ -274,8 +274,7 @@ public class RoleCommandOrder implements Cloneable {
           }
 
           if (LOG.isDebugEnabled()) {
-            LOG.debug("Adding dependency for " + restartPair + ", " +
-              "dependencies => " + roleCommandDeps);
+            LOG.debug("Adding dependency for {}, dependencies => {}", restartPair, roleCommandDeps);
           }
           missingDependencies.put(restartPair, roleCommandDeps);
         }
@@ -338,9 +337,7 @@ public class RoleCommandOrder implements Cloneable {
       v1 = dependencies.get(roleCommandPairSetEntry.getKey());
       v2 = rco.dependencies.get(roleCommandPairSetEntry.getKey());
       if (!v1.equals(v2)) {
-        LOG.debug("different entry found for key ("
-          + roleCommandPairSetEntry.getKey().getRole().toString() + ", "
-          + roleCommandPairSetEntry.getKey().getCmd().toString() + ")" );
+        LOG.debug("different entry found for key ({}, {})", roleCommandPairSetEntry.getKey().getRole(), roleCommandPairSetEntry.getKey().getCmd());
         return 1;
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariPerformanceMonitor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariPerformanceMonitor.java b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariPerformanceMonitor.java
index 3453a22..58bcc6f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariPerformanceMonitor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariPerformanceMonitor.java
@@ -38,7 +38,7 @@ import com.google.inject.Singleton;
  */
 @Singleton
 public class AmbariPerformanceMonitor extends PerformanceMonitor {
-  private static Logger LOG = LoggerFactory.getLogger(AmbariPerformanceMonitor.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AmbariPerformanceMonitor.class);
   private boolean isInitialized = false;
   private DatabaseMetricsSource metricsSource;
   private static String entityPackagePrefix = "org.apache"; //Can be made into a set later if needed.
@@ -111,7 +111,7 @@ public class AmbariPerformanceMonitor extends PerformanceMonitor {
         init();
       }
       if (isInitialized) {
-        LOG.debug("Publishing " + metrics.size() + " metrics to sink.");
+        LOG.debug("Publishing {} metrics to sink.", metrics.size());
         metricsSource.publish(metrics);
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/DatabaseMetricsSource.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/DatabaseMetricsSource.java b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/DatabaseMetricsSource.java
index 7062af1..423b19f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/DatabaseMetricsSource.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/DatabaseMetricsSource.java
@@ -44,7 +44,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
  * and publishes to configured Metric Sink.
  **/
 public class DatabaseMetricsSource extends AbstractMetricsSource {
-  private static Logger LOG = LoggerFactory.getLogger(DatabaseMetricsSource.class);
+  private static final Logger LOG = LoggerFactory.getLogger(DatabaseMetricsSource.class);
   private static String dbMonitorPrefix = "monitor.";
   private ExecutorService executor;
   private MetricsConfiguration configuration;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/JvmMetricsSource.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/JvmMetricsSource.java b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/JvmMetricsSource.java
index 41229cc..348cc4f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/JvmMetricsSource.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/JvmMetricsSource.java
@@ -46,7 +46,7 @@ import com.codahale.metrics.jvm.ThreadStatesGaugeSet;
  */
 public class JvmMetricsSource extends AbstractMetricsSource {
   static final MetricRegistry registry = new MetricRegistry();
-  private static Logger LOG = LoggerFactory.getLogger(JvmMetricsSource.class);
+  private static final Logger LOG = LoggerFactory.getLogger(JvmMetricsSource.class);
   private ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
   private static String JVM_PREFIX = "jvm";
   private int interval = 10;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/MetricsConfiguration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/MetricsConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/MetricsConfiguration.java
index a940a68..28556f6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/MetricsConfiguration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/MetricsConfiguration.java
@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
 public class MetricsConfiguration {
   public static final String CONFIG_FILE = "metrics.properties";
 
-  private static Logger LOG = LoggerFactory.getLogger(MetricsConfiguration.class);
+  private static final Logger LOG = LoggerFactory.getLogger(MetricsConfiguration.class);
   private Properties properties;
 
   public static MetricsConfiguration getMetricsConfiguration() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/MetricsServiceImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/MetricsServiceImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/MetricsServiceImpl.java
index ac5b6c2..0172b1d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/MetricsServiceImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/MetricsServiceImpl.java
@@ -35,7 +35,7 @@ import com.google.inject.Singleton;
 
 @Singleton
 public class MetricsServiceImpl implements MetricsService {
-  private static Logger LOG = LoggerFactory.getLogger(MetricsServiceImpl.class);
+  private static final Logger LOG = LoggerFactory.getLogger(MetricsServiceImpl.class);
   private static Map<String, MetricsSource> sources = new HashMap<>();
   private static MetricsSink sink = null;
   private MetricsConfiguration configuration = null;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
index 3b07bc6..9077362 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java
@@ -1299,7 +1299,7 @@ public class DBAccessorImpl implements DBAccessor {
     Object dbValue = databasePlatform.convertToDatabaseType(value);
     String valueString = value.toString();
     if (dbValue instanceof String) {
-      valueString = "'" + value.toString() + "'";
+      valueString = "'" + value + "'";
     }
 
     return valueString;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java
index 297aef4..d71429c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java
@@ -54,7 +54,7 @@ public class AlertDefinitionDAO {
   /**
    * Logger.
    */
-  private static Logger LOG = LoggerFactory.getLogger(AlertDefinitionDAO.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AlertDefinitionDAO.class);
 
   /**
    * JPA entity manager

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java
index e7c9763..9198686 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java
@@ -82,7 +82,7 @@ import com.google.inject.Provider;
 })
 @StaticallyInject
 public class RepositoryVersionEntity {
-  private static Logger LOG = LoggerFactory.getLogger(RepositoryVersionEntity.class);
+  private static final Logger LOG = LoggerFactory.getLogger(RepositoryVersionEntity.class);
 
   @Inject
   private static Provider<RepositoryVersionHelper> repositoryVersionHelperProvider;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java
index 7e3092d..afa4ac7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java
@@ -120,7 +120,7 @@ public class GenericDbmsHelper implements DbmsHelper {
       // no writing to file
     }
 
-    builder.append(writer.toString());
+    builder.append(writer);
 
     return builder;
   }
@@ -435,7 +435,7 @@ public class GenericDbmsHelper implements DbmsHelper {
     Object dbValue = databasePlatform.convertToDatabaseType(value);
     String valueString = value.toString();
     if (dbValue instanceof String || dbValue instanceof Enum) {
-      valueString = "'" + value.toString() + "'";
+      valueString = "'" + value + "'";
     }
 
     return valueString;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/resources/ResourceManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/resources/ResourceManager.java b/ambari-server/src/main/java/org/apache/ambari/server/resources/ResourceManager.java
index 627af41..8fa0f1f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/resources/ResourceManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/resources/ResourceManager.java
@@ -20,8 +20,8 @@ package org.apache.ambari.server.resources;
 import java.io.File;
 
 import org.apache.ambari.server.configuration.Configuration;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
@@ -31,7 +31,7 @@ import com.google.inject.Singleton;
  */
 @Singleton
 public class ResourceManager {
-  private static Log LOG = LogFactory.getLog(ResourceManager.class);
+  private static final Logger LOG = LoggerFactory.getLogger(ResourceManager.class);
 
   @Inject Configuration configs;
   /**
@@ -44,10 +44,7 @@ public class ResourceManager {
     String resourcePathIndep = resourcePath.replace("/", File.separator);
     File resourceFile = new File(resDir + File.separator + resourcePathIndep);
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Resource requested from ResourceManager"
-          + ", resourceDir=" + resDir
-          + ", resourcePath=" + resourcePathIndep
-          + ", fileExists=" + resourceFile.exists());
+      LOG.debug("Resource requested from ResourceManager, resourceDir={}, resourcePath={}, fileExists={}", resDir, resourcePathIndep, resourceFile.exists());
     }
     return resourceFile;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/resources/api/rest/GetResource.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/resources/api/rest/GetResource.java b/ambari-server/src/main/java/org/apache/ambari/server/resources/api/rest/GetResource.java
index 53266c2..f81c13a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/resources/api/rest/GetResource.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/resources/api/rest/GetResource.java
@@ -32,8 +32,8 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.apache.ambari.server.resources.ResourceManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 
@@ -42,7 +42,7 @@ import com.google.inject.Inject;
  */
 @Path("/")
 public class GetResource {
-  private static Log LOG = LogFactory.getLog(GetResource.class);
+  private static final Logger LOG = LoggerFactory.getLogger(GetResource.class);
 
   private static ResourceManager resourceManager;
 
@@ -59,8 +59,7 @@ public class GetResource {
   public Response getResource(@PathParam("resourcePath") String resourcePath,
       @Context HttpServletRequest req) {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Received a resource request from agent"
-          + ", resourcePath=" + resourcePath);
+      LOG.debug("Received a resource request from agent, resourcePath={}", resourcePath);
     }
     File resourceFile = resourceManager.getResource(resourcePath);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/scheduler/AbstractLinearExecutionJob.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/scheduler/AbstractLinearExecutionJob.java b/ambari-server/src/main/java/org/apache/ambari/server/scheduler/AbstractLinearExecutionJob.java
index 0e6fc7b..4599dfa 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/scheduler/AbstractLinearExecutionJob.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/scheduler/AbstractLinearExecutionJob.java
@@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory;
  * and then it schedules the follow-up job.
  */
 public abstract class AbstractLinearExecutionJob implements ExecutionJob {
-  private static Logger LOG = LoggerFactory.getLogger(AbstractLinearExecutionJob.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AbstractLinearExecutionJob.class);
   protected ExecutionScheduleManager executionScheduleManager;
 
   public AbstractLinearExecutionJob(ExecutionScheduleManager executionScheduleManager) {
@@ -69,7 +69,7 @@ public abstract class AbstractLinearExecutionJob implements ExecutionJob {
   @Override
   public void execute(JobExecutionContext context) throws JobExecutionException {
     JobKey jobKey = context.getJobDetail().getKey();
-    LOG.debug("Executing linear job: " + jobKey);
+    LOG.debug("Executing linear job: {}", jobKey);
     JobDataMap jobDataMap = context.getMergedJobDataMap();
 
     if (!executionScheduleManager.continueOnMisfire(context)) {
@@ -109,7 +109,7 @@ public abstract class AbstractLinearExecutionJob implements ExecutionJob {
       }
     }
 
-    LOG.debug("Finished linear job: " + jobKey);
+    LOG.debug("Finished linear job: {}", jobKey);
 
     String nextJobName = jobDataMap.getString(NEXT_EXECUTION_JOB_NAME_KEY);
     String nextJobGroup = jobDataMap.getString(NEXT_EXECUTION_JOB_GROUP_KEY);

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionScheduleManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionScheduleManager.java b/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionScheduleManager.java
index 91f642e..f3b3c41 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionScheduleManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionScheduleManager.java
@@ -243,7 +243,7 @@ public class ExecutionScheduleManager {
    * @param trigger
    */
   public void scheduleJob(Trigger trigger) {
-    LOG.debug("Scheduling job: " + trigger.getJobKey());
+    LOG.debug("Scheduling job: {}", trigger.getJobKey());
     if (isSchedulerAvailable()) {
       try {
         executionScheduler.scheduleJob(trigger);
@@ -334,7 +334,7 @@ public class ExecutionScheduleManager {
 
       try {
         executionScheduler.scheduleJob(trigger);
-        LOG.debug("Scheduled trigger next fire time: " + trigger.getNextFireTime());
+        LOG.debug("Scheduled trigger next fire time: {}", trigger.getNextFireTime());
       } catch (SchedulerException e) {
         LOG.error("Unable to schedule request execution.", e);
         throw new AmbariException(e.getMessage());
@@ -352,7 +352,7 @@ public class ExecutionScheduleManager {
 
       try {
         executionScheduler.scheduleJob(trigger);
-        LOG.debug("Scheduled trigger next fire time: " + trigger.getNextFireTime());
+        LOG.debug("Scheduled trigger next fire time: {}", trigger.getNextFireTime());
       } catch (SchedulerException e) {
         LOG.error("Unable to schedule request execution.", e);
         throw new AmbariException(e.getMessage());
@@ -412,8 +412,8 @@ public class ExecutionScheduleManager {
   }
 
   protected String getJobName(Long executionId, Long orderId) {
-    return BATCH_REQUEST_JOB_PREFIX + "-" + executionId.toString() + "-" +
-      orderId.toString();
+    return BATCH_REQUEST_JOB_PREFIX + "-" + executionId + "-" +
+      orderId;
   }
 
   /**
@@ -492,7 +492,7 @@ public class ExecutionScheduleManager {
           String jobName = getJobName(requestExecution.getId(),
             batchRequest.getOrderId());
 
-          LOG.debug("Deleting Job, jobName = " + jobName);
+          LOG.debug("Deleting Job, jobName = {}", jobName);
 
           try {
             executionScheduler.deleteJob(JobKey.jobKey(jobName,

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java
index 6dae349..18c7390 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java
@@ -69,7 +69,7 @@ public class ExecutionSchedulerImpl implements ExecutionScheduler {
       sf.initialize(properties);
     } catch (SchedulerException e) {
       LOG.warn("Failed to initialize Request Execution Scheduler properties !");
-      LOG.debug("Scheduler properties: \n" + properties);
+      LOG.debug("Scheduler properties: \n{}", properties);
       e.printStackTrace();
       return;
     }
@@ -125,7 +125,7 @@ public class ExecutionSchedulerImpl implements ExecutionScheduler {
     // Skip update check
     properties.setProperty("org.quartz.scheduler.skipUpdateCheck", "true");
 
-    LOG.debug("Using quartz properties: " + properties);
+    LOG.debug("Using quartz properties: {}", properties);
     return properties;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/security/CertificateManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/CertificateManager.java b/ambari-server/src/main/java/org/apache/ambari/server/security/CertificateManager.java
index 60d7a52..532c749 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/CertificateManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/CertificateManager.java
@@ -90,9 +90,9 @@ public class CertificateManager {
     String srvrKstrDir = configsMap.get(Configuration.SRVR_KSTR_DIR.getKey());
     String srvrCrtName = configsMap.get(Configuration.SRVR_CRT_NAME.getKey());
     File certFile = new File(srvrKstrDir + File.separator + srvrCrtName);
-    LOG.debug("srvrKstrDir = " + srvrKstrDir);
-    LOG.debug("srvrCrtName = " + srvrCrtName);
-    LOG.debug("certFile = " + certFile.getAbsolutePath());
+    LOG.debug("srvrKstrDir = {}", srvrKstrDir);
+    LOG.debug("srvrCrtName = {}", srvrCrtName);
+    LOG.debug("certFile = {}", certFile.getAbsolutePath());
 
     return certFile.exists();
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/security/SecurityFilter.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/SecurityFilter.java b/ambari-server/src/main/java/org/apache/ambari/server/security/SecurityFilter.java
index f2f4d4f..a1befa7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/SecurityFilter.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/SecurityFilter.java
@@ -31,8 +31,8 @@ import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.ambari.server.configuration.Configuration;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class SecurityFilter implements Filter {
 
@@ -40,7 +40,7 @@ public class SecurityFilter implements Filter {
   private static String CA = "/ca";
 
   private static Configuration config;
-  private final static Log LOG = LogFactory.getLog(SecurityFilter.class);
+  private final static Logger LOG = LoggerFactory.getLogger(SecurityFilter.class);
 
   @Override
   public void destroy() {
@@ -53,7 +53,7 @@ public class SecurityFilter implements Filter {
     HttpServletRequest req = (HttpServletRequest) serReq;
     String reqUrl = req.getRequestURL().toString();
 
-    LOG.debug("Filtering " + reqUrl + " for security purposes");
+    LOG.debug("Filtering {} for security purposes", reqUrl);
     if (serReq.getLocalPort() != config.getTwoWayAuthPort()) {
       if (isRequestAllowed(reqUrl)) {
         filtCh.doFilter(serReq, serResp);
@@ -63,7 +63,7 @@ public class SecurityFilter implements Filter {
       }
     }
 	  else {
-      LOG.debug("Request can continue on secure port " + serReq.getLocalPort());
+      LOG.debug("Request can continue on secure port {}", serReq.getLocalPort());
       filtCh.doFilter(serReq, serResp);
     }
   }
@@ -98,7 +98,7 @@ public class SecurityFilter implements Filter {
 
     } catch (Exception e) {
       LOG.warn("Exception while validating if request is secure " +
-        e.toString());
+        e);
     }
     LOG.warn("Request " + reqUrl + " doesn't match any pattern.");
     return false;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java
index a6ffa81..54cc978 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java
@@ -155,7 +155,7 @@ public class AmbariLdapBindAuthenticator extends AbstractLdapAuthenticator {
       throw new BadCredentialsException("The user search facility has not been set.");
     } else {
       if (LOG.isTraceEnabled()) {
-        LOG.trace("Searching for user with username {}: {}", username, userSearch.toString());
+        LOG.trace("Searching for user with username {}: {}", username, userSearch);
       }
 
       // Find the user data where the supplied username matches the value of the configured LDAP

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariPamAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariPamAuthenticationProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariPamAuthenticationProvider.java
index 0fff8c8..373552e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariPamAuthenticationProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariPamAuthenticationProvider.java
@@ -55,7 +55,7 @@ public class AmbariPamAuthenticationProvider implements AuthenticationProvider {
   @Inject
   protected GroupDAO groupDAO;
 
-  private static Logger LOG = LoggerFactory.getLogger(AmbariPamAuthenticationProvider.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AmbariPamAuthenticationProvider.class);
 
   private final Configuration configuration;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/jwt/JwtAuthenticationFilter.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/jwt/JwtAuthenticationFilter.java b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/jwt/JwtAuthenticationFilter.java
index 258e9da..e27afdb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/jwt/JwtAuthenticationFilter.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/jwt/JwtAuthenticationFilter.java
@@ -265,7 +265,7 @@ public class JwtAuthenticationFilter implements AmbariAuthenticationFilter {
     }
     String loginURL = authenticationProviderUrl + delimiter
         + originalUrlQueryParam + "="
-        + request.getRequestURL().toString();
+        + request.getRequestURL();
     return loginURL;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/MasterKeyServiceImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/MasterKeyServiceImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/MasterKeyServiceImpl.java
index 4763cc2..3b38856 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/MasterKeyServiceImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/MasterKeyServiceImpl.java
@@ -34,12 +34,12 @@ import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.utils.AmbariPath;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.commons.net.ntp.TimeStamp;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class MasterKeyServiceImpl implements MasterKeyService {
-  private static final Log LOG = LogFactory.getLog(MasterKeyServiceImpl.class);
+  private static final Logger LOG = LoggerFactory.getLogger(MasterKeyServiceImpl.class);
   private static final String MASTER_PASSPHRASE = "masterpassphrase";
   private static final String MASTER_PERSISTENCE_TAG_PREFIX = "#1.0# ";
   private static final AESEncryptor aes = new AESEncryptor(MASTER_PASSPHRASE);
@@ -138,7 +138,7 @@ public class MasterKeyServiceImpl implements MasterKeyService {
    * @return true if the master key was written to the specified file; otherwise false
    */
   public static boolean initializeMasterKeyFile(File masterKeyFile, String masterKey) {
-    LOG.debug(String.format("Persisting master key into %s", masterKeyFile.getAbsolutePath()));
+    LOG.debug("Persisting master key into {}", masterKeyFile.getAbsolutePath());
 
     EncryptionResult atom = null;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/CertificateDownload.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/CertificateDownload.java b/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/CertificateDownload.java
index b1ad05f..eddc6bb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/CertificateDownload.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/CertificateDownload.java
@@ -24,14 +24,14 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 
 import org.apache.ambari.server.security.CertificateManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 
 @Path("/cert/ca")
 public class CertificateDownload {
-  private static Log LOG = LogFactory.getLog(CertificateDownload.class);
+  private static final Logger LOG = LoggerFactory.getLogger(CertificateDownload.class);
   private static CertificateManager certMan;
 
   @Inject

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/CertificateSign.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/CertificateSign.java b/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/CertificateSign.java
index 9f4cdd5..5e2d45a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/CertificateSign.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/CertificateSign.java
@@ -30,13 +30,13 @@ import javax.ws.rs.core.MediaType;
 import org.apache.ambari.server.security.CertificateManager;
 import org.apache.ambari.server.security.SignCertResponse;
 import org.apache.ambari.server.security.SignMessage;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 @Path("/certs")
 public class CertificateSign {
-  private static Log LOG = LogFactory.getLog(CertificateSign.class);
+  private static final Logger LOG = LoggerFactory.getLogger(CertificateSign.class);
   private static CertificateManager certMan;
 
   @Inject

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/ConnectionInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/ConnectionInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/ConnectionInfo.java
index 6bce0b9..ac2e536 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/ConnectionInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/unsecured/rest/ConnectionInfo.java
@@ -26,15 +26,15 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 
 import org.apache.ambari.server.configuration.Configuration;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
 
 
 @Path("/connection_info")
 public class ConnectionInfo {
-    private static Log LOG = LogFactory.getLog(ConnectionInfo.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ConnectionInfo.class);
     private static HashMap<String,String> response= new HashMap<>();
     private static Configuration conf;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java
index 8903fa1..f7d6060 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java
@@ -54,13 +54,13 @@ import org.apache.ambari.server.security.InternalSSLSocketFactoryTrusting;
 import org.apache.ambari.server.security.credential.PrincipalKeyCredential;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.Velocity;
 import org.apache.velocity.exception.MethodInvocationException;
 import org.apache.velocity.exception.ParseErrorException;
 import org.apache.velocity.exception.ResourceNotFoundException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.reflect.TypeToken;
 import com.google.gson.Gson;
@@ -71,7 +71,7 @@ import com.google.inject.Inject;
  */
 public class ADKerberosOperationHandler extends KerberosOperationHandler {
 
-  private static Log LOG = LogFactory.getLog(ADKerberosOperationHandler.class);
+  private static final Logger LOG = LoggerFactory.getLogger(ADKerberosOperationHandler.class);
 
   private static final String LDAP_CONTEXT_FACTORY_CLASS = "com.sun.jndi.ldap.LdapCtxFactory";
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java
index 9ee5f11..a23ab5d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java
@@ -288,7 +288,7 @@ public class CreateKeytabFilesServerAction extends KerberosServerAction {
                 commandReport = createCommandReport(1, HostRoleStatus.FAILED, "{}", actionLog.getStdOut(), actionLog.getStdErr());
               }
             } else {
-              LOG.debug(String.format("Skipping previously processed keytab for %s on host %s", evaluatedPrincipal, hostName));
+              LOG.debug("Skipping previously processed keytab for {} on host {}", evaluatedPrincipal, hostName);
             }
           }
         }
@@ -320,7 +320,7 @@ public class CreateKeytabFilesServerAction extends KerberosServerAction {
   public Keytab createKeytab(String principal, String password, Integer keyNumber,
                              KerberosOperationHandler operationHandler, boolean checkCache,
                              boolean canCache, ActionLog actionLog) throws AmbariException {
-    LOG.debug("Creating keytab for " + principal + " with kvno " + keyNumber);
+    LOG.debug("Creating keytab for {} with kvno {}", principal, keyNumber);
     Keytab keytab = null;
 
     // Possibly get the keytab from the cache
@@ -366,7 +366,7 @@ public class CreateKeytabFilesServerAction extends KerberosServerAction {
 
             if (previousCachedFilePath != null) {
               if (!new File(previousCachedFilePath).delete()) {
-                LOG.debug(String.format("Failed to remove orphaned cache file %s", previousCachedFilePath));
+                LOG.debug("Failed to remove orphaned cache file {}", previousCachedFilePath);
               }
             }
           }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java
index fc2de99..2b3a0ca 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java
@@ -133,7 +133,7 @@ public class DestroyPrincipalsServerAction extends KerberosServerAction {
             // If a cached  keytabs file exists for this principal, delete it.
             if (cachedKeytabPath != null) {
               if (!new File(cachedKeytabPath).delete()) {
-                LOG.debug(String.format("Failed to remove cached keytab for %s", evaluatedPrincipal));
+                LOG.debug("Failed to remove cached keytab for {}", evaluatedPrincipal);
               }
             }
           }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/IPAKerberosOperationHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/IPAKerberosOperationHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/IPAKerberosOperationHandler.java
index 54b4cd3..9a6a07e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/IPAKerberosOperationHandler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/IPAKerberosOperationHandler.java
@@ -405,7 +405,7 @@ public class IPAKerberosOperationHandler extends KerberosOperationHandler {
       ShellCommandUtil.Result result = invokeIpa(String.format("service-show %s", principal));
       // ignore the keytab but set the password for this principal
       if (result.isSuccessful() && result.getStdout().contains("Keytab: False")) {
-        LOG.debug("Found service principal " + principal + " without password/keytab. Setting one");
+        LOG.debug("Found service principal {} without password/keytab. Setting one", principal);
         createKeytab(principal, password, 0);
       }
     }
@@ -505,7 +505,7 @@ public class IPAKerberosOperationHandler extends KerberosOperationHandler {
           stderr.read(err_data);
           err.append(err_data);
         }
-        throw new KerberosOperationException("No answer data available from stdin stream. STDERR: " + err.toString());
+        throw new KerberosOperationException("No answer data available from stdin stream. STDERR: " + err);
       }
       count++;
     }
@@ -534,12 +534,12 @@ public class IPAKerberosOperationHandler extends KerberosOperationHandler {
     BufferedReader stderr = null;
     OutputStreamWriter out = null;
 
-    LOG.debug("Updating password for: " + principal);
+    LOG.debug("Updating password for: {}", principal);
 
     UUID uuid = UUID.randomUUID();
     String fileName = System.getProperty("java.io.tmpdir") +
             File.pathSeparator +
-            "krb5cc_" + uuid.toString();
+            "krb5cc_" + uuid;
 
     try {
       ShellCommandUtil.Result result = invokeIpa(String.format("user-mod %s --random", principal));
@@ -665,7 +665,7 @@ public class IPAKerberosOperationHandler extends KerberosOperationHandler {
     command.add(query);
 
     if (LOG.isDebugEnabled()) {
-      LOG.debug(String.format("Executing: %s", createCleanCommand(command)));
+      LOG.debug("Executing: {}", createCleanCommand(command));
     }
 
     List<String> fixedCommand = fixCommandList(command);
@@ -962,7 +962,7 @@ public class IPAKerberosOperationHandler extends KerberosOperationHandler {
     UUID uuid = UUID.randomUUID();
     String fileName = System.getProperty("java.io.tmpdir") +
             File.pathSeparator +
-            "ambari." + uuid.toString();
+            "ambari." + uuid;
 
     // TODO: add ciphers
     List<String> command = new ArrayList<>();
@@ -1007,7 +1007,7 @@ public class IPAKerberosOperationHandler extends KerberosOperationHandler {
       UUID uuid = UUID.randomUUID();
       fileName = System.getProperty("java.io.tmpdir") +
               File.pathSeparator +
-              "krb5cc_" + uuid.toString();
+              "krb5cc_" + uuid;
       env.put("KRB5CCNAME", String.format("FILE:%s", fileName));
 
       init(credentials, fileName);
@@ -1049,7 +1049,7 @@ public class IPAKerberosOperationHandler extends KerberosOperationHandler {
       try {
         String credentialsCache = String.format("FILE:%s", fileName);
 
-        LOG.debug("start subprocess " + executableKinit + " " + credentials.getPrincipal());
+        LOG.debug("start subprocess {} {}", executableKinit, credentials.getPrincipal());
         process = Runtime.getRuntime().exec(new String[]{executableKinit, "-c", credentialsCache, credentials.getPrincipal()});
         reader = new BufferedReader(new InputStreamReader(process.getInputStream(), StandardCharsets.UTF_8));
         osw = new OutputStreamWriter(process.getOutputStream());
@@ -1073,7 +1073,7 @@ public class IPAKerberosOperationHandler extends KerberosOperationHandler {
         }
 
         String line = sb.toString();
-        LOG.debug("Reading a line: " + line);
+        LOG.debug("Reading a line: {}", line);
         if (!line.startsWith("Password")) {
           throw new KerberosOperationException("Unexpected response from kinit while trying to get ticket for "
                   + credentials.getPrincipal() + " got: " + line);

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandler.java
index 55d7366..0997f65 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandler.java
@@ -454,7 +454,7 @@ public class MITKerberosOperationHandler extends KerberosOperationHandler {
     command.add(query);
 
     if (LOG.isDebugEnabled()) {
-      LOG.debug(String.format("Executing: %s", command));
+      LOG.debug("Executing: {}", command);
     }
 
     int retryCount = configuration.getKerberosOperationRetries();

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
index 17bb3f8..ec4d383 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
@@ -86,7 +86,7 @@ import com.google.inject.Provider;
  */
 public class ConfigureAction extends AbstractUpgradeServerAction {
 
-  private static Logger LOG = LoggerFactory.getLogger(ConfigureAction.class);
+  private static final Logger LOG = LoggerFactory.getLogger(ConfigureAction.class);
 
   /**
    * Used to lookup the cluster.

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
index db0da9c..3c2dbd6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
@@ -319,7 +319,7 @@ public class FinalizeUpgradeAction extends AbstractUpgradeServerAction {
     } catch (Exception e) {
       StringWriter sw = new StringWriter();
       e.printStackTrace(new PrintWriter(sw));
-      errSB.append(sw.toString());
+      errSB.append(sw);
 
       return createCommandReport(-1, HostRoleStatus.FAILED, "{}", outSB.toString(), errSB.toString());
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/UpdateDesiredStackAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/UpdateDesiredStackAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/UpdateDesiredStackAction.java
index f55ffd0..8a4820d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/UpdateDesiredStackAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/UpdateDesiredStackAction.java
@@ -181,7 +181,7 @@ public class UpdateDesiredStackAction extends AbstractUpgradeServerAction {
     } catch (Exception e) {
       StringWriter sw = new StringWriter();
       e.printStackTrace(new PrintWriter(sw));
-      err.append(sw.toString());
+      err.append(sw);
 
       return createCommandReport(-1, HostRoleStatus.FAILED, "{}", out.toString(), err.toString());
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionDirectory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionDirectory.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionDirectory.java
index 1f6ce2c..131318b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionDirectory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionDirectory.java
@@ -133,7 +133,7 @@ public class ExtensionDirectory extends StackDefinitionDirectory {
     //todo: is it ok for this file not to exist?
     if (extensionMetaInfoFile.exists()) {
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Reading extension version metainfo from file " + extensionMetaInfoFile.getAbsolutePath());
+        LOG.debug("Reading extension version metainfo from file {}", extensionMetaInfoFile.getAbsolutePath());
       }
 
       try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java
index ee4245a..409cfe6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java
@@ -379,9 +379,7 @@ public class ExtensionModule extends BaseModule<ExtensionModule, ExtensionInfo>
 
     id = String.format("%s:%s", extensionInfo.getName(), extensionInfo.getVersion());
 
-    LOG.debug("Adding new extension to known extensions"
-        + ", extensionName = " + extensionInfo.getName()
-        + ", extensionVersion = " + extensionInfo.getVersion());
+    LOG.debug("Adding new extension to known extensions, extensionName = {}, extensionVersion = {}", extensionInfo.getName(), extensionInfo.getVersion());
 
 
     //todo: give additional thought on handling missing metainfo.xml

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java
index d38e4a3..427a5f5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java
@@ -52,7 +52,7 @@ import com.google.common.reflect.TypeToken;
 
 public class MasterHostResolver {
 
-  private static Logger LOG = LoggerFactory.getLogger(MasterHostResolver.class);
+  private static final Logger LOG = LoggerFactory.getLogger(MasterHostResolver.class);
 
   private final UpgradeContext m_upgradeContext;
   private final Cluster m_cluster;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceDirectory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceDirectory.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceDirectory.java
index e4dd853..abad7ed 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceDirectory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceDirectory.java
@@ -421,7 +421,7 @@ public abstract class ServiceDirectory extends StackDefinitionDirectory {
       roleCommandOrder = new StackRoleCommandOrder(result);
 
       if (LOG.isDebugEnabled() && rcoFile != null) {
-        LOG.debug("Role Command Order for " + rcoFile.getAbsolutePath());
+        LOG.debug("Role Command Order for {}", rcoFile.getAbsolutePath());
         roleCommandOrder.printRoleCommandOrder(LOG);
       }
     } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
index 7dbc639..e41d3b2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
@@ -629,9 +629,9 @@ public class ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implem
    * Ensure that all default type attributes are set.
    */
   private void finalizeConfiguration() {
-    LOG.debug(String.format("Finalize config, number of configuration modules %s", configurationModules.size()));
+    LOG.debug("Finalize config, number of configuration modules {}", configurationModules.size());
     hasConfigs = !(configurationModules.isEmpty());
-    LOG.debug(String.format("Finalize config, hasConfigs %s", hasConfigs));
+    LOG.debug("Finalize config, hasConfigs {}", hasConfigs);
 
     for (ConfigurationModule config : configurationModules.values()) {
       ConfigurationInfo configInfo = config.getModuleInfo();

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java
index 16c8fd6..23fd0a9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java
@@ -286,8 +286,7 @@ public class StackDirectory extends StackDefinitionDirectory {
       hooksDir = getStackDirName() + File.separator + getName() +
           File.separator + HOOKS_FOLDER_NAME;
     } else {
-      LOG.debug("Hooks folder " + getAbsolutePath() + File.separator +
-          HOOKS_FOLDER_NAME + " does not exist");
+      LOG.debug("Hooks folder {}{}" + HOOKS_FOLDER_NAME + " does not exist", getAbsolutePath(), File.separator);
     }
 
     if (subDirs.contains(AmbariMetaInfo.RCO_FILE_NAME)) {
@@ -342,7 +341,7 @@ public class StackDirectory extends StackDefinitionDirectory {
     //todo: is it ok for this file not to exist?
     if (stackMetaInfoFile.exists()) {
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Reading stack version metainfo from file " + stackMetaInfoFile.getAbsolutePath());
+        LOG.debug("Reading stack version metainfo from file {}", stackMetaInfoFile.getAbsolutePath());
       }
 
       try {
@@ -492,7 +491,7 @@ public class StackDirectory extends StackDefinitionDirectory {
       }
       roleCommandOrder = new StackRoleCommandOrder(result);
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Role Command Order for " + rcoFilePath);
+        LOG.debug("Role Command Order for {}", rcoFilePath);
         roleCommandOrder.printRoleCommandOrder(LOG);
       }
     } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
index d9649b9..57f7cb4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
@@ -465,8 +465,7 @@ public class StackManager {
 
       String commonServicesRootAbsolutePath = commonServicesRoot.getAbsolutePath();
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Loading common services information"
-            + ", commonServicesRoot = " + commonServicesRootAbsolutePath);
+        LOG.debug("Loading common services information, commonServicesRoot = {}", commonServicesRootAbsolutePath);
       }
 
       if (!commonServicesRoot.isDirectory() && !commonServicesRoot.exists()) {
@@ -488,8 +487,7 @@ public class StackManager {
 
     String stackRootAbsPath = stackRoot.getAbsolutePath();
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Loading stack information"
-          + ", stackRoot = " + stackRootAbsPath);
+      LOG.debug("Loading stack information, stackRoot = {}", stackRootAbsPath);
     }
 
     if (!stackRoot.isDirectory() && !stackRoot.exists()) {
@@ -544,8 +542,7 @@ public class StackManager {
 
     String extensionRootAbsPath = extensionRoot.getAbsolutePath();
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Loading extension information"
-          + ", extensionRoot = " + extensionRootAbsPath);
+      LOG.debug("Loading extension information, extensionRoot = {}", extensionRootAbsPath);
     }
 
     //For backwards compatibility extension directory may not exist

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
index 5dd7656..c4fab99 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
@@ -554,9 +554,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
 
     id = String.format("%s:%s", stackInfo.getName(), stackInfo.getVersion());
 
-    LOG.debug("Adding new stack to known stacks"
-        + ", stackName = " + stackInfo.getName()
-        + ", stackVersion = " + stackInfo.getVersion());
+    LOG.debug("Adding new stack to known stacks, stackName = {}, stackVersion = {}", stackInfo.getName(), stackInfo.getVersion());
 
     //todo: give additional thought on handling missing metainfo.xml
     StackMetainfoXml smx = stackDirectory.getMetaInfoFile();
@@ -1014,7 +1012,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
         String name = groups.get(index).name;
         if (name.equals(group.addAfterGroup)) {
           groups.add(index + 1, group);
-          LOG.debug("Added group/after: " + group.name + "/" + group.addAfterGroup);
+          LOG.debug("Added group/after: {}/{}", group.name, group.addAfterGroup);
           return true;
         }
       }
@@ -1126,10 +1124,8 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
     if (null != rxml) {
       stackInfo.setRepositoryXml(rxml);
 
-      LOG.debug("Adding repositories to stack" +
-          ", stackName=" + stackInfo.getName() +
-          ", stackVersion=" + stackInfo.getVersion() +
-          ", repoFolder=" + stackDirectory.getRepoDir());
+      LOG.debug("Adding repositories to stack, stackName={}, stackVersion={}, repoFolder={}",
+        stackInfo.getName(), stackInfo.getVersion(), stackDirectory.getRepoDir());
 
       stackRepos = rxml.getRepositories();
 
@@ -1265,8 +1261,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
     }
 
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Adding repo to stack"
-          + ", repoInfo=" + ri.toString());
+      LOG.debug("Adding repo to stack, repoInfo={}", ri);
     }
     return ri;
   }
@@ -1293,8 +1288,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
 
     stackInfo.getRoleCommandOrder().merge(service.getModuleInfo().getRoleCommandOrder(), true);
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Role Command Order for " + stackInfo.getName() + "-" + stackInfo.getVersion() +
-        " service " + service.getModuleInfo().getName());
+      LOG.debug("Role Command Order for {}-{} service {}", stackInfo.getName(), stackInfo.getVersion(), service.getModuleInfo().getName());
       stackInfo.getRoleCommandOrder().printRoleCommandOrder(LOG);
     }
   }
@@ -1306,7 +1300,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
   private void validateBulkCommandComponents(Map<String, StackModule> allStacks){
     if (null != stackInfo) {
       String currentStackId = stackInfo.getName() + StackManager.PATH_DELIMITER + stackInfo.getVersion();
-      LOG.debug("Validate bulk command components for: " + currentStackId);
+      LOG.debug("Validate bulk command components for: {}", currentStackId);
       StackModule currentStack = allStacks.get(currentStackId);
       if (null != currentStack){
         for (ServiceModule serviceModule : currentStack.getServiceModules().values()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java b/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
index d6d26c9..b508cd7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
@@ -42,7 +42,7 @@ import com.google.inject.assistedinject.AssistedInject;
 
 public class RoleGraph {
 
-  private static Logger LOG = LoggerFactory.getLogger(RoleGraph.class);
+  private static final Logger LOG = LoggerFactory.getLogger(RoleGraph.class);
 
   Map<String, RoleGraphNode> graph = null;
   private RoleCommandOrder roleDependencies;

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java
index f3fbc63..8cf3afd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java
@@ -50,7 +50,7 @@ public class CheckHelper {
   /**
    * Log.
    */
-  private static Logger LOG = LoggerFactory.getLogger(CheckHelper.class);
+  private static final Logger LOG = LoggerFactory.getLogger(CheckHelper.class);
 
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
index a2af9ec..5f85e38 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
@@ -225,11 +225,8 @@ public class ServiceComponentImpl implements ServiceComponent {
   @Override
   public void setRecoveryEnabled(boolean recoveryEnabled) {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Setting RecoveryEnabled of Component" + ", clusterName="
-          + service.getCluster().getClusterName() + ", clusterId="
-          + service.getCluster().getClusterId() + ", serviceName=" + service.getName()
-          + ", componentName=" + getName() + ", oldRecoveryEnabled=" + isRecoveryEnabled()
-          + ", newRecoveryEnabled=" + recoveryEnabled);
+      LOG.debug("Setting RecoveryEnabled of Component, clusterName={}, clusterId={}, serviceName={}, componentName={}, oldRecoveryEnabled={}, newRecoveryEnabled={}",
+        service.getCluster().getClusterName(), service.getCluster().getClusterId(), service.getName(), getName(), isRecoveryEnabled(), recoveryEnabled);
     }
 
     ServiceComponentDesiredStateEntity desiredStateEntity = serviceComponentDesiredStateDAO.findById(
@@ -289,11 +286,8 @@ public class ServiceComponentImpl implements ServiceComponent {
       // TODO validation
       // TODO ensure host belongs to cluster
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Adding a ServiceComponentHost to ServiceComponent" + ", clusterName="
-            + service.getCluster().getClusterName() + ", clusterId="
-            + service.getCluster().getClusterId() + ", serviceName=" + service.getName()
-            + ", serviceComponentName=" + getName() + ", hostname=" + hostComponent.getHostName()
-            + ", recoveryEnabled=" + isRecoveryEnabled());
+        LOG.debug("Adding a ServiceComponentHost to ServiceComponent, clusterName={}, clusterId={}, serviceName={}, serviceComponentName={}, hostname={}, recoveryEnabled={}",
+          service.getCluster().getClusterName(), service.getCluster().getClusterId(), service.getName(), getName(), hostComponent.getHostName(), isRecoveryEnabled());
       }
 
       if (hostComponents.containsKey(hostComponent.getHostName())) {
@@ -350,11 +344,8 @@ public class ServiceComponentImpl implements ServiceComponent {
   @Override
   public void setDesiredState(State state) {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Setting DesiredState of Service" + ", clusterName="
-          + service.getCluster().getClusterName() + ", clusterId="
-          + service.getCluster().getClusterId() + ", serviceName=" + service.getName()
-          + ", serviceComponentName=" + getName() + ", oldDesiredState=" + getDesiredState()
-          + ", newDesiredState=" + state);
+      LOG.debug("Setting DesiredState of Service, clusterName={}, clusterId={}, serviceName={}, serviceComponentName={}, oldDesiredState={}, newDesiredState={}",
+        service.getCluster().getClusterName(), service.getCluster().getClusterId(), service.getName(), getName(), getDesiredState(), state);
     }
 
     ServiceComponentDesiredStateEntity desiredStateEntity = serviceComponentDesiredStateDAO.findById(

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java
index fe37a93..da1702d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java
@@ -266,11 +266,8 @@ public class ServiceImpl implements Service {
   @Override
   public void setDesiredState(State state) {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Setting DesiredState of Service" + ", clusterName="
-          + cluster.getClusterName() + ", clusterId="
-          + cluster.getClusterId() + ", serviceName=" + getName()
-          + ", oldDesiredState=" + getDesiredState() + ", newDesiredState="
-          + state);
+      LOG.debug("Setting DesiredState of Service, clusterName={}, clusterId={}, serviceName={}, oldDesiredState={}, newDesiredState={}",
+        cluster.getClusterName(), cluster.getClusterId(), getName(), getDesiredState(), state);
     }
 
     ServiceDesiredStateEntity serviceDesiredStateEntity = getServiceDesiredStateEntity();
@@ -291,11 +288,8 @@ public class ServiceImpl implements Service {
     }
 
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Setting DesiredSecurityState of Service" + ", clusterName="
-          + cluster.getClusterName() + ", clusterId="
-          + cluster.getClusterId() + ", serviceName=" + getName()
-          + ", oldDesiredSecurityState=" + getSecurityState()
-          + ", newDesiredSecurityState=" + securityState);
+      LOG.debug("Setting DesiredSecurityState of Service, clusterName={}, clusterId={}, serviceName={}, oldDesiredSecurityState={}, newDesiredSecurityState={}",
+        cluster.getClusterName(), cluster.getClusterId(), getName(), getSecurityState(), securityState);
     }
     ServiceDesiredStateEntity serviceDesiredStateEntity = getServiceDesiredStateEntity();
     serviceDesiredStateEntity.setSecurityState(securityState);
@@ -429,11 +423,8 @@ public class ServiceImpl implements Service {
   @Override
   public void setCredentialStoreEnabled(boolean credentialStoreEnabled) {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Setting CredentialStoreEnabled of Service" + ", clusterName="
-              + cluster.getClusterName() + ", clusterId="
-              + cluster.getClusterId() + ", serviceName=" + getName()
-              + ", oldCredentialStoreEnabled=" + isCredentialStoreEnabled()
-              + ", newCredentialStoreEnabled=" + credentialStoreEnabled);
+      LOG.debug("Setting CredentialStoreEnabled of Service, clusterName={}, clusterId={}, serviceName={}, oldCredentialStoreEnabled={}, newCredentialStoreEnabled={}",
+        cluster.getClusterName(), cluster.getClusterId(), getName(), isCredentialStoreEnabled(), credentialStoreEnabled);
     }
 
     ServiceDesiredStateEntity desiredStateEntity = getServiceDesiredStateEntity();

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
index ca7794e..1494488 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
@@ -295,7 +295,7 @@ public class StackInfo implements Comparable<StackInfo>, Validable {
       sb.append("\n\t\tRepositories:");
       for (RepositoryInfo repository : repositories) {
         sb.append("\t\t");
-        sb.append(repository.toString());
+        sb.append(repository);
       }
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/state/action/ActionImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/action/ActionImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/action/ActionImpl.java
index b42a0b6..35b559e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/action/ActionImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/action/ActionImpl.java
@@ -26,12 +26,12 @@ import org.apache.ambari.server.state.fsm.InvalidStateTransitionException;
 import org.apache.ambari.server.state.fsm.SingleArcTransition;
 import org.apache.ambari.server.state.fsm.StateMachine;
 import org.apache.ambari.server.state.fsm.StateMachineFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ActionImpl implements Action {
 
-  private static final Log LOG = LogFactory.getLog(ActionImpl.class);
+  private static final Logger LOG = LoggerFactory.getLogger(ActionImpl.class);
 
   private final Lock readLock;
   private final Lock writeLock;
@@ -125,10 +125,8 @@ public class ActionImpl implements Action {
       ActionProgressUpdateEvent e = (ActionProgressUpdateEvent) event;
       action.setLastUpdateTime(e.getProgressUpdateTime());
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Progress update for Action"
-            + ", actionId=" + action.getId()
-            + ", startTime=" + action.getStartTime()
-            + ", lastUpdateTime=" + action.getLastUpdateTime());
+        LOG.debug("Progress update for Action, actionId={}, startTime={}, lastUpdateTime={}",
+          action.getId(), action.getStartTime(), action.getLastUpdateTime());
       }
     }
   }
@@ -193,8 +191,7 @@ public class ActionImpl implements Action {
   public void handleEvent(ActionEvent event)
       throws InvalidStateTransitionException {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Handling Action event, eventType=" + event.getType().name()
-          + ", event=" + event.toString());
+      LOG.debug("Handling Action event, eventType={}, event={}", event.getType().name(), event);
     }
     ActionState oldState = getState();
     try {
@@ -215,12 +212,8 @@ public class ActionImpl implements Action {
     }
     if (oldState != getState()) {
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Action transitioned to a new state"
-            + ", actionId=" + this.getId()
-            + ", oldState=" + oldState
-            + ", currentState=" + getState()
-            + ", eventType=" + event.getType().name()
-            + ", event=" + event);
+        LOG.debug("Action transitioned to a new state, actionId={}, oldState={}, currentState={}, eventType={}, event={}",
+          getId(), oldState, getState(), event.getType().name(), event);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 8f33f1a..a4bf815 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -465,16 +465,13 @@ public class ClusterImpl implements Cluster {
       }
     }
 
-    LOG.debug("Adding a new Config group" + ", clusterName = "
-      + getClusterName() + ", groupName = " + configGroup.getName()
-      + ", tag = " + configGroup.getTag() + " with hosts " + hostList);
+    LOG.debug("Adding a new Config group, clusterName = {}, groupName = {}, tag = {} with hosts {}",
+      getClusterName(), configGroup.getName(), configGroup.getTag(), hostList);
 
     if (clusterConfigGroups.containsKey(configGroup.getId())) {
       // The loadConfigGroups will load all groups to memory
-      LOG.debug("Config group already exists" + ", clusterName = "
-          + getClusterName() + ", groupName = " + configGroup.getName()
-          + ", groupId = " + configGroup.getId() + ", tag = "
-          + configGroup.getTag());
+      LOG.debug("Config group already exists, clusterName = {}, groupName = {}, groupId = {}, tag = {}",
+        getClusterName(), configGroup.getName(), configGroup.getId(), configGroup.getTag());
     } else {
       clusterConfigGroups.put(configGroup.getId(), configGroup);
     }
@@ -509,9 +506,8 @@ public class ClusterImpl implements Cluster {
         + requestExecution.getId() + ", description = " + requestExecution.getDescription());
 
     if (requestExecutions.containsKey(requestExecution.getId())) {
-      LOG.debug(
-          "Request schedule already exists" + ", clusterName = " + getClusterName() + ", id = "
-              + requestExecution.getId() + ", description = " + requestExecution.getDescription());
+      LOG.debug("Request schedule already exists, clusterName = {}, id = {}, description = {}",
+        getClusterName(), requestExecution.getId(), requestExecution.getDescription());
     } else {
       requestExecutions.put(requestExecution.getId(), requestExecution);
     }
@@ -542,9 +538,8 @@ public class ClusterImpl implements Cluster {
       throw new ConfigGroupNotFoundException(getClusterName(), id.toString());
     }
 
-    LOG.debug("Deleting Config group" + ", clusterName = " + getClusterName()
-        + ", groupName = " + configGroup.getName() + ", groupId = "
-        + configGroup.getId() + ", tag = " + configGroup.getTag());
+    LOG.debug("Deleting Config group, clusterName = {}, groupName = {}, groupId = {}, tag = {}",
+      getClusterName(), configGroup.getName(), configGroup.getId(), configGroup.getTag());
 
     configGroup.delete();
     clusterConfigGroups.remove(id);
@@ -666,10 +661,8 @@ public class ClusterImpl implements Cluster {
     }
 
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Adding a new ServiceComponentHost" + ", clusterName="
-          + getClusterName() + ", clusterId=" + getClusterId()
-          + ", serviceName=" + serviceName + ", serviceComponentName"
-          + componentName + ", hostname= " + hostname);
+      LOG.debug("Adding a new ServiceComponentHost, clusterName={}, clusterId={}, serviceName={}, serviceComponentName{}, hostname= {}",
+        getClusterName(), getClusterId(), serviceName, componentName, hostname);
     }
 
     serviceComponentHosts.get(serviceName).get(componentName).put(hostname,
@@ -742,10 +735,8 @@ public class ClusterImpl implements Cluster {
     }
 
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Removing a ServiceComponentHost" + ", clusterName="
-          + getClusterName() + ", clusterId=" + getClusterId()
-          + ", serviceName=" + serviceName + ", serviceComponentName"
-          + componentName + ", hostname= " + hostname);
+      LOG.debug("Removing a ServiceComponentHost, clusterName={}, clusterId={}, serviceName={}, serviceComponentName{}, hostname= {}",
+        getClusterName(), getClusterId(), serviceName, componentName, hostname);
     }
 
     serviceComponentHosts.get(serviceName).get(componentName).remove(hostname);
@@ -830,8 +821,7 @@ public class ClusterImpl implements Cluster {
   @Override
   public void addService(Service service) {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Adding a new Service" + ", clusterName=" + getClusterName() + ", clusterId="
-          + getClusterId() + ", serviceName=" + service.getName());
+      LOG.debug("Adding a new Service, clusterName={}, clusterId={}, serviceName={}", getClusterName(), getClusterId(), service.getName());
     }
     services.put(service.getName(), service);
   }
@@ -894,10 +884,8 @@ public class ClusterImpl implements Cluster {
     clusterGlobalLock.writeLock().lock();
     try {
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Changing DesiredStackVersion of Cluster" + ", clusterName="
-            + getClusterName() + ", clusterId=" + getClusterId()
-            + ", currentDesiredStackVersion=" + desiredStackVersion
-            + ", newDesiredStackVersion=" + stackId);
+        LOG.debug("Changing DesiredStackVersion of Cluster, clusterName={}, clusterId={}, currentDesiredStackVersion={}, newDesiredStackVersion={}",
+          getClusterName(), getClusterId(), desiredStackVersion, stackId);
       }
 
       desiredStackVersion = stackId;
@@ -2376,7 +2364,8 @@ public class ClusterImpl implements Cluster {
 
         LOG.info("Setting {} with version tag {} created on {} to selected for stack {}",
             entity.getType(), entity.getTag(), new Date(entity.getTimestamp()),
-            stackId.toString());
+          stackId
+        );
       }
 
       // since the entities which were modified came from the cluster entity's

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
index 5f1e934..595ce4a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
@@ -305,9 +305,7 @@ public class ClustersImpl implements Clusters {
       throw new HostNotFoundException(hostname);
     }
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Looking up clusters for hostname"
-          + ", hostname=" + hostname
-          + ", mappedClusters=" + clusters.size());
+      LOG.debug("Looking up clusters for hostname, hostname={}, mappedClusters={}", hostname, clusters.size());
     }
     return Collections.unmodifiableSet(clusters);
 
@@ -397,7 +395,7 @@ public class ClustersImpl implements Clusters {
         Collections.newSetFromMap(new ConcurrentHashMap<Cluster, Boolean>()));
 
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Adding a host to Clusters" + ", hostname=" + hostname);
+      LOG.debug("Adding a host to Clusters, hostname={}", hostname);
     }
 
     // publish the event

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
index 04aba31..aa87f7d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
@@ -327,7 +327,7 @@ public class HostImpl implements Host {
         agentVersion = e.agentVersion.getVersion();
       }
       LOG.info("Received host registration, host="
-        + e.hostInfo.toString()
+        + e.hostInfo
         + ", registrationTime=" + e.registrationTime
         + ", agentVersion=" + agentVersion);
 
@@ -355,9 +355,7 @@ public class HostImpl implements Host {
     public void transition(HostImpl host, HostEvent event) {
       HostStatusUpdatesReceivedEvent e = (HostStatusUpdatesReceivedEvent)event;
       // TODO Audit logs
-      LOG.debug("Host transition to host status updates received state"
-          + ", host=" + e.getHostName()
-          + ", heartbeatTime=" + e.getTimestamp());
+      LOG.debug("Host transition to host status updates received state, host={}, heartbeatTime={}", e.getHostName(), e.getTimestamp());
       host.setHealthStatus(new HostHealthStatus(HealthStatus.HEALTHY,
         host.getHealthStatus().getHealthReport()));
     }
@@ -404,9 +402,7 @@ public class HostImpl implements Host {
       HostHealthyHeartbeatEvent e = (HostHealthyHeartbeatEvent) event;
       host.setLastHeartbeatTime(e.getHeartbeatTime());
       // TODO Audit logs
-      LOG.debug("Host transitioned to a healthy state"
-              + ", host=" + e.getHostName()
-              + ", heartbeatTime=" + e.getHeartbeatTime());
+      LOG.debug("Host transitioned to a healthy state, host={}, heartbeatTime={}", e.getHostName(), e.getHeartbeatTime());
       host.setHealthStatus(new HostHealthStatus(HealthStatus.HEALTHY, host.getHealthStatus().getHealthReport()));
     }
   }
@@ -419,10 +415,8 @@ public class HostImpl implements Host {
       HostUnhealthyHeartbeatEvent e = (HostUnhealthyHeartbeatEvent) event;
       host.setLastHeartbeatTime(e.getHeartbeatTime());
       // TODO Audit logs
-      LOG.debug("Host transitioned to an unhealthy state"
-          + ", host=" + e.getHostName()
-          + ", heartbeatTime=" + e.getHeartbeatTime()
-          + ", healthStatus=" + e.getHealthStatus());
+      LOG.debug("Host transitioned to an unhealthy state, host={}, heartbeatTime={}, healthStatus={}",
+        e.getHostName(), e.getHeartbeatTime(), e.getHealthStatus());
       host.setHealthStatus(e.getHealthStatus());
     }
   }
@@ -434,9 +428,7 @@ public class HostImpl implements Host {
     public void transition(HostImpl host, HostEvent event) {
       HostHeartbeatLostEvent e = (HostHeartbeatLostEvent) event;
       // TODO Audit logs
-      LOG.debug("Host transitioned to heartbeat lost state"
-          + ", host=" + e.getHostName()
-          + ", lastHeartbeatTime=" + host.getLastHeartbeatTime());
+      LOG.debug("Host transitioned to heartbeat lost state, host={}, lastHeartbeatTime={}", e.getHostName(), host.getLastHeartbeatTime());
       host.setHealthStatus(new HostHealthStatus(HealthStatus.UNKNOWN, host.getHealthStatus().getHealthReport()));
 
       host.topologyManager.onHostHeartBeatLost(host);
@@ -568,8 +560,7 @@ public class HostImpl implements Host {
   public void handleEvent(HostEvent event)
       throws InvalidStateTransitionException {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("Handling Host event, eventType=" + event.getType().name()
-          + ", event=" + event.toString());
+      LOG.debug("Handling Host event, eventType={}, event={}", event.getType().name(), event);
     }
     HostState oldState = getState();
     try {
@@ -590,12 +581,8 @@ public class HostImpl implements Host {
     }
     if (oldState != getState()) {
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Host transitioned to a new state"
-            + ", host=" + getHostName()
-            + ", oldState=" + oldState
-            + ", currentState=" + getState()
-            + ", eventType=" + event.getType().name()
-            + ", event=" + event);
+        LOG.debug("Host transitioned to a new state, host={}, oldState={}, currentState={}, eventType={}, event={}",
+          getHostName(), oldState, getState(), event.getType().name(), event);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/219f2234/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigUpgradePack.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigUpgradePack.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigUpgradePack.java
index c5a7e18..db02e95 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigUpgradePack.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigUpgradePack.java
@@ -58,7 +58,7 @@ public class ConfigUpgradePack {
    */
   private Map<String, ConfigUpgradeChangeDefinition> changesById;
 
-  private static Logger LOG = LoggerFactory.getLogger(ConfigUpgradePack.class);
+  private static final Logger LOG = LoggerFactory.getLogger(ConfigUpgradePack.class);
 
   /**
    * no-arg default constructor for JAXB


Mime
View raw message