azkaban-uncached

Details

diff --git a/src/java/azkaban/executor/ExecutorMailer.java b/src/java/azkaban/executor/ExecutorMailer.java
index c43ca91..1facc95 100644
--- a/src/java/azkaban/executor/ExecutorMailer.java
+++ b/src/java/azkaban/executor/ExecutorMailer.java
@@ -17,12 +17,6 @@ public class ExecutorMailer {
 	private static Logger logger = Logger.getLogger(ExecutorMailer.class);
 
 	private boolean testMode = false;
-<<<<<<< HEAD
-	
-	private int mailTimeout;
-	private int connectionTimeout;
-	
-=======
 
 	private String clientHostname;
 	private String clientPortNumber;
@@ -33,22 +27,17 @@ public class ExecutorMailer {
 	private String mailSender;
 	private String azkabanName;
 
->>>>>>> reportal
 	public ExecutorMailer(Props props) {
 		this.azkabanName = props.getString("azkaban.name", "azkaban");
 		this.mailHost = props.getString("mail.host", "localhost");
 		this.mailUser = props.getString("mail.user", "");
 		this.mailPassword = props.getString("mail.password", "");
 		this.mailSender = props.getString("mail.sender", "");
-<<<<<<< HEAD
-=======
 
-		this.clientHostname = props.getString("jetty.hostname", "localhost");
-		this.clientPortNumber = Utils.nonNull(props.getString("jetty.ssl.port"));
->>>>>>> reportal
-
-		this.mailTimeout = props.getInt("mail.timeout.millis", 10000);
-		this.connectionTimeout = props.getInt("mail.connection.timeout.millis", 10000);
+		int mailTimeout = props.getInt("mail.timeout.millis", 10000);
+		EmailMessage.setTimeout(mailTimeout);
+		int connectionTimeout = props.getInt("mail.connection.timeout.millis", 10000);
+		EmailMessage.setConnectionTimeout(connectionTimeout);
 		
 		this.clientHostname = props.getString("jetty.hostname", "localhost");
 		this.clientPortNumber = Utils.nonNull(props.getString("jetty.ssl.port"));
@@ -61,57 +50,6 @@ public class ExecutorMailer {
 		message.setFromAddress(mailSender);
 
 		ExecutionOptions option = flow.getExecutionOptions();
-<<<<<<< HEAD
-		List<String> emailList = option.getDisabledJobs();
-		int execId = flow.getExecutionId();
-		
-		if (emailList != null && !emailList.isEmpty()) {
-			EmailMessage message = new EmailMessage(mailHost, mailUser, mailPassword);
-			message.setFromAddress(mailSender);
-			message.addAllToAddress(emailList);
-			message.setMimeType("text/html");
-			message.setTimeout(mailTimeout);
-			message.setConnectionTimeout(connectionTimeout);
-			message.setSubject("Flow '" + flow.getFlowId() + "' has failed on " + azkabanName);
-			
-			message.println("<h2 style=\"color:#FF0000\"> Execution '" + flow.getExecutionId() + "' of flow '" + flow.getFlowId() + "' has encountered a failure on " + getAzkabanName() + "</h2>");
-			
-			if (option.getFailureAction() == FailureAction.CANCEL_ALL) {
-				message.println("This flow is set to cancel all currently running jobs.");
-			}
-			else if (option.getFailureAction() == FailureAction.FINISH_ALL_POSSIBLE){
-				message.println("This flow is set to complete all jobs that aren't blocked by the failure.");
-			}
-			else {
-				message.println("This flow is set to complete all currently running jobs before stopping.");
-			}
-			
-			message.println("<table>");
-			message.println("<tr><td>Start Time</td><td>" + flow.getStartTime() +"</td></tr>");
-			message.println("<tr><td>End Time</td><td>" + flow.getEndTime() +"</td></tr>");
-			message.println("<tr><td>Duration</td><td>" + Utils.formatDuration(flow.getStartTime(), flow.getEndTime()) +"</td></tr>");
-			message.println("</table>");
-			message.println("");
-			String executionUrl = super.getReferenceURL() + "executor?" + "execid=" + execId;
-			message.println("<a href='\"" + executionUrl + "\">" + flow.getFlowId() + " Execution Link</a>");
-			
-			message.println("");
-			message.println("<h3>Reason</h3>");
-			List<String> failedJobs = findFailedJobs(flow);
-			message.println("<ul>");
-			for (String jobId : failedJobs) {
-				message.println("<li><a href=\"" + executionUrl + "&job=" + jobId + "\">Failed job '" + jobId + "' Link</a></li>" );
-			}
-			
-			message.println("</ul>");
-			
-			if (!testMode) {
-				try {
-					message.sendEmail();
-				} catch (MessagingException e) {
-					logger.error("Email message send failed" , e);
-				}
-=======
 
 		MailCreator mailCreator = DefaultMailCreator.getCreator(option.getMailCreator());
 
@@ -124,7 +62,6 @@ public class ExecutorMailer {
 				message.sendEmail();
 			} catch (MessagingException e) {
 				logger.error("Email message send failed", e);
->>>>>>> reportal
 			}
 		}
 	}
diff --git a/src/java/azkaban/utils/EmailMessage.java b/src/java/azkaban/utils/EmailMessage.java
index c079c85..3a3475d 100644
--- a/src/java/azkaban/utils/EmailMessage.java
+++ b/src/java/azkaban/utils/EmailMessage.java
@@ -32,8 +32,8 @@ public class EmailMessage {
 	private String _fromAddress;
 	private String _mimeType = "text/plain";
 	private StringBuffer _body = new StringBuffer();
-	private int _mailTimeout = 10000;
-	private int _connectionTimeout = 10000;
+	private static int _mailTimeout = 10000;
+	private static int _connectionTimeout = 10000;
 	
 	private ArrayList<BodyPart> _attachments = new ArrayList<BodyPart>();
 
@@ -47,14 +47,12 @@ public class EmailMessage {
 		_mailPassword = password;
 	}
 	
-	public EmailMessage setTimeout(int timeoutMillis) {
+	public static void setTimeout(int timeoutMillis) {
 		_mailTimeout = timeoutMillis;
-		return this;
 	}
 	
-	public EmailMessage setConnectionTimeout(int timeoutMillis) {
+	public static void setConnectionTimeout(int timeoutMillis) {
 		_connectionTimeout = timeoutMillis;
-		return this;
 	}
 	
 	public EmailMessage setMailHost(String host) {