Browse Source

AMBARI-2748. Misc logging changes. (smohanty)

Sumit Mohanty 12 years ago
parent
commit
a13f2324e1

+ 1 - 0
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java

@@ -325,6 +325,7 @@ class ActionScheduler implements Runnable {
               ServiceComponentHost svcCompHost =
               ServiceComponentHost svcCompHost =
                   svcComp.getServiceComponentHost(host);
                   svcComp.getServiceComponentHost(host);
               svcCompHost.handleEvent(timeoutEvent);
               svcCompHost.handleEvent(timeoutEvent);
+              LOG.warn("Operation timed out. Role: " + roleStr + ", host: " + host);
             } catch (ServiceComponentNotFoundException scnex) {
             } catch (ServiceComponentNotFoundException scnex) {
               LOG.debug("Not a service component, assuming its an action. Details: "
               LOG.debug("Not a service component, assuming its an action. Details: "
                   + scnex.getMessage());
                   + scnex.getMessage());

+ 2 - 0
ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java

@@ -223,6 +223,8 @@ public class HeartBeatHandler {
                   hostname, now));
                   hostname, now));
             }
             }
           } else if (report.getStatus().equals("FAILED")) {
           } else if (report.getStatus().equals("FAILED")) {
+            LOG.warn("Operation failed - may be retried. Service component host: "
+                + schName + ", host: " + hostname);
             scHost.handleEvent(new ServiceComponentHostOpFailedEvent(schName,
             scHost.handleEvent(new ServiceComponentHostOpFailedEvent(schName,
                 hostname, now));
                 hostname, now));
           } else if (report.getStatus().equals("IN_PROGRESS")) {
           } else if (report.getStatus().equals("IN_PROGRESS")) {

+ 12 - 8
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java

@@ -2775,6 +2775,12 @@ public class AmbariManagementControllerImpl implements
             + " update components");
             + " update components");
       }
       }
 
 
+      LOG.info("Received a updateComponent request"
+          + ", clusterName=" + request.getClusterName()
+          + ", serviceName=" + request.getServiceName()
+          + ", componentName=" + request.getComponentName()
+          + ", request=" + request.toString());
+
       Cluster cluster = clusters.getCluster(request.getClusterName());
       Cluster cluster = clusters.getCluster(request.getClusterName());
 
 
       if (request.getServiceName() == null
       if (request.getServiceName() == null
@@ -3139,14 +3145,12 @@ public class AmbariManagementControllerImpl implements
         request.setServiceName(findServiceName(cluster, request.getComponentName()));
         request.setServiceName(findServiceName(cluster, request.getComponentName()));
       }
       }
 
 
-      if (LOG.isDebugEnabled()) {
-        LOG.debug("Received a updateHostComponent request"
-            + ", clusterName=" + request.getClusterName()
-            + ", serviceName=" + request.getServiceName()
-            + ", componentName=" + request.getComponentName()
-            + ", hostname=" + request.getHostname()
-            + ", request=" + request);
-      }
+      LOG.info("Received a updateHostComponent request"
+          + ", clusterName=" + request.getClusterName()
+          + ", serviceName=" + request.getServiceName()
+          + ", componentName=" + request.getComponentName()
+          + ", hostname=" + request.getHostname()
+          + ", request=" + request);
 
 
       clusterNames.add(request.getClusterName());
       clusterNames.add(request.getClusterName());
 
 

+ 4 - 2
ambari-server/src/main/java/org/apache/ambari/server/controller/ganglia/GangliaPropertyProvider.java

@@ -365,6 +365,7 @@ public abstract class GangliaPropertyProvider extends AbstractPropertyProvider {
    * The information required to make a single RRD request.
    * The information required to make a single RRD request.
    */
    */
   private class RRDRequest {
   private class RRDRequest {
+    private static final int POPULATION_TIME_UPPER_LIMIT = 5;
     private final String clusterName;
     private final String clusterName;
     private final TemporalInfo temporalInfo;
     private final TemporalInfo temporalInfo;
     private final Map<ResourceKey, Set<Resource>> resources = new HashMap<ResourceKey, Set<Resource>>();
     private final Map<ResourceKey, Set<Resource>> resources = new HashMap<ResourceKey, Set<Resource>>();
@@ -458,8 +459,9 @@ public abstract class GangliaPropertyProvider extends AbstractPropertyProvider {
         }
         }
         int endTime = convertToNumber(reader.readLine()).intValue();
         int endTime = convertToNumber(reader.readLine()).intValue();
 
 
-        if (LOG.isInfoEnabled()) {
-          LOG.info("Ganglia resource population time: " + (endTime - startTime));
+        int totalTime = endTime - startTime;
+        if (LOG.isInfoEnabled() && totalTime > POPULATION_TIME_UPPER_LIMIT) {
+          LOG.info("Ganglia resource population time: " + totalTime);
         }
         }
       } catch (IOException e) {
       } catch (IOException e) {
         if (LOG.isErrorEnabled()) {
         if (LOG.isErrorEnabled()) {