azkaban-uncached

bug fixes

2/27/2013 5:26:04 PM

Details

diff --git a/src/java/azkaban/execapp/ExecutorServlet.java b/src/java/azkaban/execapp/ExecutorServlet.java
index 4fd55c2..1475a9a 100644
--- a/src/java/azkaban/execapp/ExecutorServlet.java
+++ b/src/java/azkaban/execapp/ExecutorServlet.java
@@ -58,13 +58,16 @@ public class ExecutorServlet extends HttpServlet implements ConnectorParams {
 	@Override
 	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
 		HashMap<String,Object> respMap= new HashMap<String,Object>();
+		logger.info("ExecutorServer called by " + req.getRemoteAddr());
 		try {
 			if (!hasParam(req, ACTION_PARAM)) {
+				logger.error("Parameter action not set");
 				respMap.put("error", "Parameter action not set");
 			}
 			else {
 				String action = getParam(req, ACTION_PARAM);
 				if (action.equals(UPDATE_ACTION)) {
+					logger.info("Updated called");
 					handleAjaxUpdateRequest(req, respMap);
 				}
 				else if (action.equals(PING_ACTION)) {
@@ -74,7 +77,8 @@ public class ExecutorServlet extends HttpServlet implements ConnectorParams {
 					int execid = Integer.parseInt(getParam(req, EXECID_PARAM));
 					String user = getParam(req, USER_PARAM, null);
 					
-					if (action.equals(LOG_ACTION)) {
+					logger.info("User " + user + " has called action " + action + " on " + execid);
+					if (action.equals(LOG_ACTION)) { 
 						handleFetchLogEvent(execid, req, resp, respMap);
 					}
 					else if (action.equals(EXECUTE_ACTION)) {
@@ -100,11 +104,13 @@ public class ExecutorServlet extends HttpServlet implements ConnectorParams {
 						handleModifyExecutionRequest(respMap, execid, user, req);
 					}
 					else {
+						logger.error("action: '" + action + "' not supported.");
 						respMap.put("error", "action: '" + action + "' not supported.");
 					}
 				}
 			}
 		} catch (Exception e) {
+			logger.error(e);
 			respMap.put(RESPONSE_ERROR, e.getMessage());
 		}
 		writeJSON(resp, respMap);
@@ -139,6 +145,7 @@ public class ExecutorServlet extends HttpServlet implements ConnectorParams {
 				
 			}
 		} catch (ExecutorManagerException e) {
+			logger.error(e);
 			respMap.put("error", e.getMessage());
 		}
 	}
@@ -157,6 +164,7 @@ public class ExecutorServlet extends HttpServlet implements ConnectorParams {
 				result = flowRunnerManager.readFlowLogs(execId, startByte, length);
 				respMap.putAll(result.toObject());
 			} catch (Exception e) {
+				logger.error(e);
 				respMap.put(RESPONSE_ERROR, e.getMessage());
 			}
 		}
@@ -167,6 +175,7 @@ public class ExecutorServlet extends HttpServlet implements ConnectorParams {
 				LogData result = flowRunnerManager.readJobLogs(execId, jobId, attempt, startByte, length);
 				respMap.putAll(result.toObject());
 			} catch (Exception e) {
+				logger.error(e);
 				respMap.put("error", e.getMessage());
 			}
 		}
@@ -203,6 +212,8 @@ public class ExecutorServlet extends HttpServlet implements ConnectorParams {
 		try {
 			flowRunnerManager.submitFlow(execId);
 		} catch (ExecutorManagerException e) {
+			e.printStackTrace();
+			logger.error(e);
 			respMap.put(RESPONSE_ERROR, e.getMessage());
 		}
 	}
@@ -228,7 +239,7 @@ public class ExecutorServlet extends HttpServlet implements ConnectorParams {
 			flowRunnerManager.pauseFlow(execid, user);
 			respMap.put(STATUS_PARAM, RESPONSE_SUCCESS);
 		} catch (ExecutorManagerException e) {
-			e.printStackTrace();
+			logger.error(e);
 			respMap.put(RESPONSE_ERROR, e.getMessage());
 		}
 	}
@@ -258,7 +269,7 @@ public class ExecutorServlet extends HttpServlet implements ConnectorParams {
 			flowRunnerManager.cancelFlow(execid, user);
 			respMap.put(STATUS_PARAM, RESPONSE_SUCCESS);
 		} catch (ExecutorManagerException e) {
-			e.printStackTrace();
+			logger.error(e);
 			respMap.put(RESPONSE_ERROR, e.getMessage());
 		}
 	}
diff --git a/src/sql/create_project_event_table.sql b/src/sql/create_project_event_table.sql
index 4cf8f21..ea9802e 100644
--- a/src/sql/create_project_event_table.sql
+++ b/src/sql/create_project_event_table.sql
@@ -3,6 +3,6 @@ CREATE TABLE project_events (
 	event_type TINYINT NOT NULL,
 	event_time BIGINT NOT NULL,
 	username VARCHAR(64),
-	message VARCHAR(128),
+	message VARCHAR(512),
 	INDEX log (project_id, event_time)
 ) ENGINE=InnoDB;
diff --git a/src/sql/update_2.0_to_2.01.sql b/src/sql/update_2.0_to_2.01.sql
index 80273f4..cff37d2 100644
--- a/src/sql/update_2.0_to_2.01.sql
+++ b/src/sql/update_2.0_to_2.01.sql
@@ -8,11 +8,13 @@ ALTER TABLE execution_jobs ADD INDEX exec_job (exec_id, job_id);
 
 ALTER TABLE execution_logs ADD COLUMN attempt INT DEFAULT 0;
 ALTER TABLE execution_logs DROP PRIMARY KEY;
-ALTER TABLE execution_logs ADD PRIMARY KEY(exec_id, name, attempt);
+ALTER TABLE execution_logs ADD PRIMARY KEY(exec_id, name, attempt, start_byte);
+
+ALTER TABLE execution_logs ADD INDEX exec_log (exec_id, name, attempt);
 
 ALTER TABLE schedules ADD COLUMN enc_type TINYINT;
 ALTER TABLE schedules ADD COLUMN schedule_options LONGBLOB;
 
-
+ALTER TABLE project_events MODIFY COLUMN message VARCHAR(512);
 
 
diff --git a/src/web/js/azkaban.exflow.view.js b/src/web/js/azkaban.exflow.view.js
index 4fb7326..e35c340 100644
--- a/src/web/js/azkaban.exflow.view.js
+++ b/src/web/js/azkaban.exflow.view.js
@@ -83,6 +83,7 @@ azkaban.FlowTabView= Backbone.View.extend({
   	$("#executebtn").hide();
   	$("#pausebtn").hide();
   	$("#resumebtn").hide();
+  	$("#retrybtn").hide();
   
  	this.model.bind('change:graph', this.handleFlowStatusChange, this);
 	this.model.bind('change:update', this.handleFlowStatusChange, this);