azkaban-aplcache

adding necessary logs to help trace and debug issues (#829) *

11/23/2016 12:18:38 PM

Details

diff --git a/azkaban-common/src/main/java/azkaban/executor/ExecutorManager.java b/azkaban-common/src/main/java/azkaban/executor/ExecutorManager.java
index ff3951e..4557464 100644
--- a/azkaban-common/src/main/java/azkaban/executor/ExecutorManager.java
+++ b/azkaban-common/src/main/java/azkaban/executor/ExecutorManager.java
@@ -1048,12 +1048,14 @@ public class ExecutorManager extends EventHandler implements
   }
 
   private void cleanOldExecutionLogs(long millis) {
+    long beforeDeleteLogsTimestamp = System.currentTimeMillis();
     try {
       int count = executorLoader.removeExecutionLogsByTime(millis);
       logger.info("Cleaned up " + count + " log entries.");
     } catch (ExecutorManagerException e) {
-      e.printStackTrace();
+      logger.error("log clean up failed. ", e);
     }
+    logger.info("log clean up time: "  + (System.currentTimeMillis() - beforeDeleteLogsTimestamp)/1000 + " seconds.");
   }
 
   private Map<String, Object> callExecutorServer(ExecutableFlow exflow,
diff --git a/azkaban-common/src/main/java/azkaban/utils/PropsUtils.java b/azkaban-common/src/main/java/azkaban/utils/PropsUtils.java
index 3412425..e159335 100644
--- a/azkaban-common/src/main/java/azkaban/utils/PropsUtils.java
+++ b/azkaban-common/src/main/java/azkaban/utils/PropsUtils.java
@@ -34,6 +34,7 @@ import org.apache.commons.jexl2.JexlException;
 import org.apache.commons.jexl2.MapContext;
 import org.apache.commons.lang.StringUtils;
 
+import org.apache.log4j.Logger;
 import org.joda.time.DateTime;
 
 import azkaban.executor.ExecutableFlowBase;
@@ -41,6 +42,7 @@ import azkaban.flow.CommonJobProperties;
 
 public class PropsUtils {
 
+  private static final Logger logger = Logger.getLogger(PropsUtils.class);
   /**
    * Load job schedules from the given directories ] * @param dir The directory
    * to look in
@@ -292,7 +294,7 @@ public class PropsUtils {
     props.put(CommonJobProperties.FLOW_UUID, UUID.randomUUID().toString());
     props.put(CommonJobProperties.PROJECT_LAST_CHANGED_BY, flow.getLastModifiedByUser());
     props.put(CommonJobProperties.PROJECT_LAST_CHANGED_DATE, flow.getLastModifiedTimestamp());
-    props.put(CommonJobProperties.SUBMIT_USER, flow.getExecutableFlow().getSubmitUser());  
+    props.put(CommonJobProperties.SUBMIT_USER, flow.getExecutableFlow().getSubmitUser());
 
     DateTime loadTime = new DateTime();
 
@@ -336,6 +338,7 @@ public class PropsUtils {
       Props props = new Props(null, obj);
       return props;
     } catch (IOException e) {
+      logger.error("Encountered error during parsing project properties json. ", e);
       return null;
     }
   }