http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/WorkflowActionBean.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/WorkflowActionBean.java b/core/src/main/java/org/apache/oozie/WorkflowActionBean.java index 6b05b89..32bebae 100644 --- a/core/src/main/java/org/apache/oozie/WorkflowActionBean.java +++ b/core/src/main/java/org/apache/oozie/WorkflowActionBean.java @@ -58,23 +58,47 @@ import org.json.simple.JSONObject; @Entity @NamedQueries({ - @NamedQuery(name = "UPDATE_ACTION", query = "update WorkflowActionBean a set a.conf = :conf, a.consoleUrl = :consoleUrl, a.data = :data, a.stats = :stats, a.externalChildIDs = :externalChildIDs, a.errorCode = :errorCode, a.errorMessage = :errorMessage, a.externalId = :externalId, a.externalStatus = :externalStatus, a.name = :name, a.cred = :cred , a.retries = :retries, a.trackerUri = :trackerUri, a.transition = :transition, a.type = :type, a.endTimestamp = :endTime, a.executionPath = :executionPath, a.lastCheckTimestamp = :lastCheckTime, a.logToken = :logToken, a.pending = :pending, a.pendingAgeTimestamp = :pendingAge, a.signalValue = :signalValue, a.slaXml = :slaXml, a.startTimestamp = :startTime, a.statusStr = :status, a.wfId=:wfId where a.id = :id"), - - @NamedQuery(name = "UPDATE_ACTION_FOR_LAST_CHECKED_TIME", query = "update WorkflowActionBean a set a.lastCheckTimestamp = :lastCheckTime where a.id = :id"), - - @NamedQuery(name = "UPDATE_ACTION_START", query = "update WorkflowActionBean a set a.startTimestamp = :startTime, a.externalChildIDs = :externalChildIDs, a.conf = :conf, a.errorCode = :errorCode, a.errorMessage = :errorMessage, a.startTimestamp = :startTime, a.externalId = :externalId, a.trackerUri = :trackerUri, a.consoleUrl = :consoleUrl, a.lastCheckTimestamp = :lastCheckTime, a.statusStr = :status, a.externalStatus = :externalStatus, a.data = :data, a.retries = :retries, a.pending = :pending, a.pendingAgeTimestamp = :pendingAge, a.userRetryCount = :userRetryCount where a.id = :id"), - - @NamedQuery(name = "UPDATE_ACTION_CHECK", query = "update WorkflowActionBean a set a.userRetryCount = :userRetryCount, a.stats = :stats, a.externalChildIDs = :externalChildIDs, a.externalStatus = :externalStatus, a.statusStr = :status, a.data = :data, a.pending = :pending, a.errorCode = :errorCode, a.errorMessage = :errorMessage, a.lastCheckTimestamp = :lastCheckTime, a.retries = :retries, a.pendingAgeTimestamp = :pendingAge, a.startTimestamp = :startTime where a.id = :id"), - - @NamedQuery(name = "UPDATE_ACTION_END", query = "update WorkflowActionBean a set a.stats = :stats, a.errorCode = :errorCode, a.errorMessage = :errorMessage, a.retries = :retries, a.endTimestamp = :endTime, a.statusStr = :status, a.pending = :pending, a.pendingAgeTimestamp = :pendingAge, a.signalValue = :signalValue, a.userRetryCount = :userRetryCount, a.externalStatus = :externalStatus where a.id = :id"), - - @NamedQuery(name = "UPDATE_ACTION_PENDING", query = "update WorkflowActionBean a set a.pending = :pending, a.pendingAgeTimestamp = :pendingAge, a.executionPath = :executionPath where a.id = :id"), - - @NamedQuery(name = "UPDATE_ACTION_STATUS_PENDING", query = "update WorkflowActionBean a set a.statusStr = :status, a.pending = :pending, a.pendingAgeTimestamp = :pendingAge where a.id = :id"), - - @NamedQuery(name = "UPDATE_ACTION_PENDING_TRANS", query = "update WorkflowActionBean a set a.pending = :pending, a.pendingAgeTimestamp = :pendingAge, a.transition = :transition where a.id = :id"), - - @NamedQuery(name = "UPDATE_ACTION_PENDING_TRANS_ERROR", query = "update WorkflowActionBean a set a.pending = :pending, a.pendingAgeTimestamp = :pendingAge, a.transition = :transition, a.errorCode = :errorCode, a.errorMessage = :errorMessage, a.statusStr = :status where a.id = :id"), + @NamedQuery(name = "UPDATE_ACTION", query = "update WorkflowActionBean a set a.conf = :conf, a.consoleUrl = :consoleUrl," + + " a.data = :data, a.stats = :stats, a.externalChildIDs = :externalChildIDs, a.errorCode = :errorCode," + + " a.errorMessage = :errorMessage, a.externalId = :externalId, a.externalStatus = :externalStatus, a.name = :name," + + " a.cred = :cred , a.retries = :retries, a.trackerUri = :trackerUri, a.transition = :transition, a.type = :type," + + " a.endTimestamp = :endTime, a.executionPath = :executionPath, a.lastCheckTimestamp = :lastCheckTime, a.logToken " + + "= :logToken, a.pending = :pending, a.pendingAgeTimestamp = :pendingAge, a.signalValue = :signalValue, a.slaXml " + + "= :slaXml, a.startTimestamp = :startTime, a.statusStr = :status, a.wfId=:wfId where a.id = :id"), + + @NamedQuery(name = "UPDATE_ACTION_FOR_LAST_CHECKED_TIME", query = "update WorkflowActionBean a set a.lastCheckTimestamp " + + "= :lastCheckTime where a.id = :id"), + + @NamedQuery(name = "UPDATE_ACTION_START", query = "update WorkflowActionBean a set a.startTimestamp = :startTime," + + " a.externalChildIDs = :externalChildIDs, a.conf = :conf, a.errorCode = :errorCode, a.errorMessage = :errorMessage," + + " a.startTimestamp = :startTime, a.externalId = :externalId, a.trackerUri = :trackerUri, a.consoleUrl " + + "= :consoleUrl, a.lastCheckTimestamp = :lastCheckTime, a.statusStr = :status, a.externalStatus = :externalStatus," + + " a.data = :data, a.retries = :retries, a.pending = :pending, a.pendingAgeTimestamp = :pendingAge, a.userRetryCount" + + " = :userRetryCount where a.id = :id"), + + @NamedQuery(name = "UPDATE_ACTION_CHECK", query = "update WorkflowActionBean a set a.userRetryCount = :userRetryCount," + + " a.stats = :stats, a.externalChildIDs = :externalChildIDs, a.externalStatus = :externalStatus, a.statusStr " + + "= :status, a.data = :data, a.pending = :pending, a.errorCode = :errorCode, a.errorMessage = :errorMessage," + + " a.lastCheckTimestamp = :lastCheckTime, a.retries = :retries, a.pendingAgeTimestamp = :pendingAge," + + " a.startTimestamp = :startTime where a.id = :id"), + + @NamedQuery(name = "UPDATE_ACTION_END", query = "update WorkflowActionBean a set a.stats = :stats, a.errorCode = :errorCode," + + " a.errorMessage = :errorMessage, a.retries = :retries, a.endTimestamp = :endTime, a.statusStr = :status, a.pending" + + " = :pending, a.pendingAgeTimestamp = :pendingAge, a.signalValue = :signalValue, a.userRetryCount " + + "= :userRetryCount, a.externalStatus = :externalStatus where a.id = :id"), + + @NamedQuery(name = "UPDATE_ACTION_PENDING", query = "update WorkflowActionBean a set a.pending = :pending," + + " a.pendingAgeTimestamp = :pendingAge, a.executionPath = :executionPath where a.id = :id"), + + @NamedQuery(name = "UPDATE_ACTION_STATUS_PENDING", query = "update WorkflowActionBean a set a.statusStr = :status, a.pending" + + " = :pending, a.pendingAgeTimestamp = :pendingAge where a.id = :id"), + + @NamedQuery(name = "UPDATE_ACTION_PENDING_TRANS", query = "update WorkflowActionBean a set a.pending = :pending," + + " a.pendingAgeTimestamp = :pendingAge, a.transition = :transition where a.id = :id"), + + @NamedQuery(name = "UPDATE_ACTION_PENDING_TRANS_ERROR", query = "update WorkflowActionBean a set a.pending = :pending," + + " a.pendingAgeTimestamp = :pendingAge, a.transition = :transition, a.errorCode = :errorCode, a.errorMessage " + + "= :errorMessage, a.statusStr = :status where a.id = :id"), @NamedQuery(name = "DELETE_ACTION", query = "delete from WorkflowActionBean a where a.id IN (:id)"), @@ -84,33 +108,53 @@ import org.json.simple.JSONObject; @NamedQuery(name = "GET_ACTION", query = "select OBJECT(a) from WorkflowActionBean a where a.id = :id"), - @NamedQuery(name = "GET_ACTION_ID_TYPE_LASTCHECK", query = "select a.id, a.type, a.lastCheckTimestamp from WorkflowActionBean a where a.id = :id"), + @NamedQuery(name = "GET_ACTION_ID_TYPE_LASTCHECK", query = "select a.id, a.type, a.lastCheckTimestamp " + + "from WorkflowActionBean a where a.id = :id"), - @NamedQuery(name = "GET_ACTION_FAIL", query = "select a.id, a.wfId, a.name, a.statusStr, a.pending, a.type, a.logToken, a.transition, a.errorCode, a.errorMessage from WorkflowActionBean a where a.id = :id"), + @NamedQuery(name = "GET_ACTION_FAIL", query = "select a.id, a.wfId, a.name, a.statusStr, a.pending, a.type, a.logToken," + + " a.transition, a.errorCode, a.errorMessage from WorkflowActionBean a where a.id = :id"), - @NamedQuery(name = "GET_ACTION_SIGNAL", query = "select a.id, a.wfId, a.name, a.statusStr, a.pending, a.pendingAgeTimestamp, a.type, a.logToken, a.transition, a.errorCode, a.errorMessage, a.executionPath, a.signalValue, a.slaXml, a.externalId from WorkflowActionBean a where a.id = :id"), + @NamedQuery(name = "GET_ACTION_SIGNAL", query = "select a.id, a.wfId, a.name, a.statusStr, a.pending, a.pendingAgeTimestamp," + + " a.type, a.logToken, a.transition, a.errorCode, a.errorMessage, a.executionPath, a.signalValue, a.slaXml," + + " a.externalId from WorkflowActionBean a where a.id = :id"), - @NamedQuery(name = "GET_ACTION_CHECK", query = "select a.id, a.wfId, a.name, a.statusStr, a.pending, a.pendingAgeTimestamp, a.type, a.logToken, a.transition, a.retries, a.userRetryCount, a.userRetryMax, a.userRetryInterval, a.trackerUri, a.startTimestamp, a.endTimestamp, a.lastCheckTimestamp, a.errorCode, a.errorMessage, a.externalId, a.externalStatus, a.externalChildIDs, a.conf from WorkflowActionBean a where a.id = :id"), + @NamedQuery(name = "GET_ACTION_CHECK", query = "select a.id, a.wfId, a.name, a.statusStr, a.pending, a.pendingAgeTimestamp," + + " a.type, a.logToken, a.transition, a.retries, a.userRetryCount, a.userRetryMax, a.userRetryInterval, a.trackerUri," + + " a.startTimestamp, a.endTimestamp, a.lastCheckTimestamp, a.errorCode, a.errorMessage, a.externalId," + + " a.externalStatus, a.externalChildIDs, a.conf from WorkflowActionBean a where a.id = :id"), - @NamedQuery(name = "GET_ACTION_END", query = "select a.id, a.wfId, a.name, a.statusStr, a.pending, a.pendingAgeTimestamp, a.type, a.logToken, a.transition, a.retries, a.trackerUri, a.userRetryCount, a.userRetryMax, a.userRetryInterval, a.startTimestamp, a.endTimestamp, a.errorCode, a.errorMessage, a.externalId, a.externalStatus, a.externalChildIDs, a.conf, a.data, a.stats from WorkflowActionBean a where a.id = :id"), + @NamedQuery(name = "GET_ACTION_END", query = "select a.id, a.wfId, a.name, a.statusStr, a.pending, a.pendingAgeTimestamp," + + " a.type, a.logToken, a.transition, a.retries, a.trackerUri, a.userRetryCount, a.userRetryMax, a.userRetryInterval," + + " a.startTimestamp, a.endTimestamp, a.errorCode, a.errorMessage, a.externalId, a.externalStatus," + + " a.externalChildIDs, a.conf, a.data, a.stats from WorkflowActionBean a where a.id = :id"), - @NamedQuery(name = "GET_ACTION_COMPLETED", query = "select a.id, a.wfId, a.statusStr, a.type, a.logToken from WorkflowActionBean a where a.id = :id"), + @NamedQuery(name = "GET_ACTION_COMPLETED", query = "select a.id, a.wfId, a.statusStr, a.type, a.logToken " + + "from WorkflowActionBean a where a.id = :id"), @NamedQuery(name = "GET_ACTION_FOR_UPDATE", query = "select OBJECT(a) from WorkflowActionBean a where a.id = :id"), - @NamedQuery(name = "GET_ACTION_FOR_SLA", query = "select a.id, a.statusStr, a.startTimestamp, a.endTimestamp from WorkflowActionBean a where a.id = :id"), + @NamedQuery(name = "GET_ACTION_FOR_SLA", query = "select a.id, a.statusStr, a.startTimestamp, a.endTimestamp " + + "from WorkflowActionBean a where a.id = :id"), - @NamedQuery(name = "GET_ACTIONS_FOR_WORKFLOW", query = "select OBJECT(a) from WorkflowActionBean a where a.wfId = :wfId order by a.startTimestamp"), + @NamedQuery(name = "GET_ACTIONS_FOR_WORKFLOW", query = "select OBJECT(a) from WorkflowActionBean a where a.wfId = :wfId " + + "order by a.startTimestamp"), - @NamedQuery(name = "GET_ACTIONS_OF_WORKFLOW_FOR_UPDATE", query = "select OBJECT(a) from WorkflowActionBean a where a.wfId = :wfId order by a.startTimestamp"), + @NamedQuery(name = "GET_ACTIONS_OF_WORKFLOW_FOR_UPDATE", query = "select OBJECT(a) from WorkflowActionBean a where a.wfId " + + "= :wfId order by a.startTimestamp"), - @NamedQuery(name = "GET_PENDING_ACTIONS", query = "select a.id, a.wfId, a.statusStr, a.type, a.pendingAgeTimestamp from WorkflowActionBean a where a.pending = 1 AND a.pendingAgeTimestamp < :pendingAge AND a.statusStr <> 'RUNNING' AND a.createdTimeTS >= :createdTime"), + @NamedQuery(name = "GET_PENDING_ACTIONS", query = "select a.id, a.wfId, a.statusStr, a.type, a.pendingAgeTimestamp from" + + " WorkflowActionBean a where a.pending = 1 AND a.pendingAgeTimestamp < :pendingAge AND a.statusStr <> 'RUNNING' " + + "AND a.createdTimeTS >= :createdTime"), - @NamedQuery(name = "GET_RUNNING_ACTIONS", query = "select a.id from WorkflowActionBean a where a.pending = 1 AND a.statusStr = 'RUNNING' AND a.lastCheckTimestamp < :lastCheckTime"), + @NamedQuery(name = "GET_RUNNING_ACTIONS", query = "select a.id from WorkflowActionBean a where a.pending = 1 AND a.statusStr" + + " = 'RUNNING' AND a.lastCheckTimestamp < :lastCheckTime"), - @NamedQuery(name = "GET_RETRY_MANUAL_ACTIONS", query = "select OBJECT(a) from WorkflowActionBean a where a.wfId = :wfId AND (a.statusStr = 'START_RETRY' OR a.statusStr = 'START_MANUAL' OR a.statusStr = 'END_RETRY' OR a.statusStr = 'END_MANUAL')"), + @NamedQuery(name = "GET_RETRY_MANUAL_ACTIONS", query = "select OBJECT(a) from WorkflowActionBean a where a.wfId = :wfId " + + "AND (a.statusStr = 'START_RETRY' OR a.statusStr = 'START_MANUAL' OR a.statusStr = 'END_RETRY' OR a.statusStr " + + "= 'END_MANUAL')"), - @NamedQuery(name = "GET_ACTIONS_FOR_WORKFLOW_RERUN", query = "select a.id, a.name, a.statusStr, a.endTimestamp, a.type from WorkflowActionBean a where a.wfId = :wfId order by a.startTimestamp") }) + @NamedQuery(name = "GET_ACTIONS_FOR_WORKFLOW_RERUN", query = "select a.id, a.name, a.statusStr, a.endTimestamp, a.type " + + "from WorkflowActionBean a where a.wfId = :wfId order by a.startTimestamp") }) @Table(name = "WF_ACTIONS") public class WorkflowActionBean implements Writable, WorkflowAction, JsonBean { @Id
http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/WorkflowJobBean.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/WorkflowJobBean.java b/core/src/main/java/org/apache/oozie/WorkflowJobBean.java index cb06bec..22a01d3 100644 --- a/core/src/main/java/org/apache/oozie/WorkflowJobBean.java +++ b/core/src/main/java/org/apache/oozie/WorkflowJobBean.java @@ -55,73 +55,110 @@ import java.util.List; @NamedQueries({ - @NamedQuery(name = "UPDATE_WORKFLOW", query = "update WorkflowJobBean w set w.appName = :appName, w.appPath = :appPath, w.conf = :conf, w.group = :groupName, w.run = :run, w.user = :user, w.createdTimestamp = :createdTime, w.endTimestamp = :endTime, w.externalId = :externalId, w.lastModifiedTimestamp = :lastModTime,w.logToken = :logToken, w.protoActionConf = :protoActionConf, w.slaXml =:slaXml, w.startTimestamp = :startTime, w.statusStr = :status, w.wfInstance = :wfInstance where w.id = :id"), + @NamedQuery(name = "UPDATE_WORKFLOW", query = "update WorkflowJobBean w set w.appName = :appName, w.appPath = :appPath," + + " w.conf = :conf, w.group = :groupName, w.run = :run, w.user = :user, w.createdTimestamp = :createdTime," + + " w.endTimestamp = :endTime, w.externalId = :externalId, w.lastModifiedTimestamp = :lastModTime,w.logToken " + + "= :logToken, w.protoActionConf = :protoActionConf, w.slaXml =:slaXml, w.startTimestamp = :startTime, w.statusStr " + + "= :status, w.wfInstance = :wfInstance where w.id = :id"), - @NamedQuery(name = "UPDATE_WORKFLOW_MODTIME", query = "update WorkflowJobBean w set w.lastModifiedTimestamp = :lastModTime where w.id = :id"), + @NamedQuery(name = "UPDATE_WORKFLOW_MODTIME", query = "update WorkflowJobBean w set w.lastModifiedTimestamp = :lastModTime" + + " where w.id = :id"), - @NamedQuery(name = "UPDATE_WORKFLOW_STATUS_MODTIME", query = "update WorkflowJobBean w set w.statusStr = :status, w.lastModifiedTimestamp = :lastModTime where w.id = :id"), + @NamedQuery(name = "UPDATE_WORKFLOW_STATUS_MODTIME", query = "update WorkflowJobBean w set w.statusStr = :status," + + " w.lastModifiedTimestamp = :lastModTime where w.id = :id"), - @NamedQuery(name = "UPDATE_WORKFLOW_PARENT_MODIFIED", query = "update WorkflowJobBean w set w.parentId = :parentId, w.lastModifiedTimestamp = :lastModTime where w.id = :id"), + @NamedQuery(name = "UPDATE_WORKFLOW_PARENT_MODIFIED", query = "update WorkflowJobBean w set w.parentId = :parentId," + + " w.lastModifiedTimestamp = :lastModTime where w.id = :id"), - @NamedQuery(name = "UPDATE_WORKFLOW_STATUS_INSTANCE_MODIFIED", query = "update WorkflowJobBean w set w.statusStr = :status, w.wfInstance = :wfInstance, w.lastModifiedTimestamp = :lastModTime where w.id = :id"), + @NamedQuery(name = "UPDATE_WORKFLOW_STATUS_INSTANCE_MODIFIED", query = "update WorkflowJobBean w set w.statusStr = :status," + + " w.wfInstance = :wfInstance, w.lastModifiedTimestamp = :lastModTime where w.id = :id"), - @NamedQuery(name = "UPDATE_WORKFLOW_STATUS_INSTANCE_MOD_END", query = "update WorkflowJobBean w set w.statusStr = :status, w.wfInstance = :wfInstance, w.lastModifiedTimestamp = :lastModTime, w.endTimestamp = :endTime where w.id = :id"), + @NamedQuery(name = "UPDATE_WORKFLOW_STATUS_INSTANCE_MOD_END", query = "update WorkflowJobBean w set w.statusStr = :status," + + " w.wfInstance = :wfInstance, w.lastModifiedTimestamp = :lastModTime, w.endTimestamp = :endTime where w.id = :id"), - @NamedQuery(name = "UPDATE_WORKFLOW_STATUS_INSTANCE_MOD_START_END", query = "update WorkflowJobBean w set w.statusStr = :status, w.wfInstance = :wfInstance, w.lastModifiedTimestamp = :lastModTime, w.startTimestamp = :startTime, w.endTimestamp = :endTime where w.id = :id"), + @NamedQuery(name = "UPDATE_WORKFLOW_STATUS_INSTANCE_MOD_START_END", query = "update WorkflowJobBean w set w.statusStr " + + "= :status, w.wfInstance = :wfInstance, w.lastModifiedTimestamp = :lastModTime, w.startTimestamp = :startTime," + + " w.endTimestamp = :endTime where w.id = :id"), - @NamedQuery(name = "UPDATE_WORKFLOW_RERUN", query = "update WorkflowJobBean w set w.appName = :appName, w.protoActionConf = :protoActionConf, w.appPath = :appPath, w.conf = :conf, w.logToken = :logToken, w.user = :user, w.group = :group, w.externalId = :externalId, w.endTimestamp = :endTime, w.run = :run, w.statusStr = :status, w.wfInstance = :wfInstance, w.lastModifiedTimestamp = :lastModTime where w.id = :id"), + @NamedQuery(name = "UPDATE_WORKFLOW_RERUN", query = "update WorkflowJobBean w set w.appName = :appName, w.protoActionConf " + + "= :protoActionConf, w.appPath = :appPath, w.conf = :conf, w.logToken = :logToken, w.user = :user, w.group " + + "= :group, w.externalId = :externalId, w.endTimestamp = :endTime, w.run = :run, w.statusStr = :status," + + " w.wfInstance = :wfInstance, w.lastModifiedTimestamp = :lastModTime where w.id = :id"), @NamedQuery(name = "DELETE_WORKFLOW", query = "delete from WorkflowJobBean w where w.id IN (:id)"), @NamedQuery(name = "GET_WORKFLOWS", query = "select OBJECT(w) from WorkflowJobBean w order by w.startTimestamp desc"), - @NamedQuery(name = "GET_WORKFLOWS_COLUMNS", query = "select w.id, w.appName, w.statusStr, w.run, w.user, w.group, w.createdTimestamp, w.startTimestamp, w.lastModifiedTimestamp, w.endTimestamp, w.externalId, w.parentId from WorkflowJobBean w order by w.createdTimestamp desc"), + @NamedQuery(name = "GET_WORKFLOWS_COLUMNS", query = "select w.id, w.appName, w.statusStr, w.run, w.user, w.group," + + " w.createdTimestamp, w.startTimestamp, w.lastModifiedTimestamp, w.endTimestamp, w.externalId, w.parentId " + + "from WorkflowJobBean w order by w.createdTimestamp desc"), @NamedQuery(name = "GET_WORKFLOWS_COUNT", query = "select count(w) from WorkflowJobBean w"), - @NamedQuery(name = "GET_COMPLETED_WORKFLOWS_OLDER_THAN", query = "select w from WorkflowJobBean w where w.endTimestamp < :endTime"), + @NamedQuery(name = "GET_COMPLETED_WORKFLOWS_OLDER_THAN", query = "select w from WorkflowJobBean w where w.endTimestamp" + + " < :endTime"), - @NamedQuery(name = "GET_COMPLETED_WORKFLOWS_WITH_NO_PARENT_OLDER_THAN", query = "select w.id from WorkflowJobBean w where w.endTimestamp < :endTime and w.parentId is null"), + @NamedQuery(name = "GET_COMPLETED_WORKFLOWS_WITH_NO_PARENT_OLDER_THAN", query = "select w.id from WorkflowJobBean w " + + "where w.endTimestamp < :endTime and w.parentId is null"), - @NamedQuery(name = "GET_COMPLETED_COORD_WORKFLOWS_OLDER_THAN", query = "select w.id, w.parentId from WorkflowJobBean w where w.endTimestamp < :endTime and w.parentId like '%C@%'"), + @NamedQuery(name = "GET_COMPLETED_COORD_WORKFLOWS_OLDER_THAN", query = "select w.id, w.parentId from WorkflowJobBean w " + + "where w.endTimestamp < :endTime and w.parentId like '%C@%'"), @NamedQuery(name = "GET_WORKFLOW", query = "select OBJECT(w) from WorkflowJobBean w where w.id = :id"), @NamedQuery(name = "GET_WORKFLOW_STARTTIME", query = "select w.id, w.startTimestamp from WorkflowJobBean w where w.id = :id"), - @NamedQuery(name = "GET_WORKFLOW_START_END_TIME", query = "select w.id, w.startTimestamp, w.endTimestamp from WorkflowJobBean w where w.id = :id"), + @NamedQuery(name = "GET_WORKFLOW_START_END_TIME", query = "select w.id, w.startTimestamp, w.endTimestamp " + + "from WorkflowJobBean w where w.id = :id"), @NamedQuery(name = "GET_WORKFLOW_USER_GROUP", query = "select w.user, w.group from WorkflowJobBean w where w.id = :id"), - @NamedQuery(name = "GET_WORKFLOW_SUSPEND", query = "select w.id, w.user, w.group, w.appName, w.statusStr, w.parentId, w.startTimestamp, w.endTimestamp, w.logToken, w.wfInstance from WorkflowJobBean w where w.id = :id"), + @NamedQuery(name = "GET_WORKFLOW_SUSPEND", query = "select w.id, w.user, w.group, w.appName, w.statusStr, w.parentId," + + " w.startTimestamp, w.endTimestamp, w.logToken, w.wfInstance from WorkflowJobBean w where w.id = :id"), - @NamedQuery(name = "GET_WORKFLOW_RERUN", query = "select w.id, w.user, w.group, w.appName, w.statusStr, w.run, w.logToken, w.wfInstance, w.parentId from WorkflowJobBean w where w.id = :id"), + @NamedQuery(name = "GET_WORKFLOW_RERUN", query = "select w.id, w.user, w.group, w.appName, w.statusStr, w.run, w.logToken," + + " w.wfInstance, w.parentId from WorkflowJobBean w where w.id = :id"), - @NamedQuery(name = "GET_WORKFLOW_DEFINITION", query = "select w.id, w.user, w.group, w.appName, w.logToken, w.wfInstance from WorkflowJobBean w where w.id = :id"), + @NamedQuery(name = "GET_WORKFLOW_DEFINITION", query = "select w.id, w.user, w.group, w.appName, w.logToken, w.wfInstance " + + "from WorkflowJobBean w where w.id = :id"), - @NamedQuery(name = "GET_WORKFLOW_ACTION_OP", query = "select w.id, w.user, w.group, w.appName, w.appPath, w.statusStr, w.run, w.parentId, w.logToken, w.wfInstance, w.protoActionConf from WorkflowJobBean w where w.id = :id"), + @NamedQuery(name = "GET_WORKFLOW_ACTION_OP", query = "select w.id, w.user, w.group, w.appName, w.appPath, w.statusStr, w.run," + + " w.parentId, w.logToken, w.wfInstance, w.protoActionConf from WorkflowJobBean w where w.id = :id"), - @NamedQuery(name = "GET_WORKFLOW_KILL", query = "select w.id, w.user, w.group, w.appName, w.appPath, w.statusStr, w.parentId, w.startTimestamp, w.endTimestamp, w.logToken, w.wfInstance, w.slaXml, w.protoActionConf from WorkflowJobBean w where w.id = :id"), + @NamedQuery(name = "GET_WORKFLOW_KILL", query = "select w.id, w.user, w.group, w.appName, w.appPath, w.statusStr, w.parentId," + + " w.startTimestamp, w.endTimestamp, w.logToken, w.wfInstance, w.slaXml, w.protoActionConf from WorkflowJobBean w" + + " where w.id = :id"), - @NamedQuery(name = "GET_WORKFLOW_RESUME", query = "select w.id, w.user, w.group, w.appName, w.appPath, w.statusStr, w.parentId, w.startTimestamp, w.endTimestamp, w.logToken, w.wfInstance, w.protoActionConf from WorkflowJobBean w where w.id = :id"), + @NamedQuery(name = "GET_WORKFLOW_RESUME", query = "select w.id, w.user, w.group, w.appName, w.appPath, w.statusStr," + + " w.parentId, w.startTimestamp, w.endTimestamp, w.logToken, w.wfInstance, w.protoActionConf from WorkflowJobBean w " + + "where w.id = :id"), @NamedQuery(name = "GET_WORKFLOW_FOR_UPDATE", query = "select OBJECT(w) from WorkflowJobBean w where w.id = :id"), - @NamedQuery(name = "GET_WORKFLOW_FOR_SLA", query = "select w.id, w.statusStr, w.startTimestamp, w.endTimestamp from WorkflowJobBean w where w.id = :id"), + @NamedQuery(name = "GET_WORKFLOW_FOR_SLA", query = "select w.id, w.statusStr, w.startTimestamp, w.endTimestamp " + + "from WorkflowJobBean w where w.id = :id"), - @NamedQuery(name = "GET_WORKFLOW_ID_FOR_EXTERNAL_ID", query = "select w.id from WorkflowJobBean w where w.externalId = :externalId"), + @NamedQuery(name = "GET_WORKFLOW_ID_FOR_EXTERNAL_ID", query = "select w.id from WorkflowJobBean w where w.externalId " + + "= :externalId"), - @NamedQuery(name = "GET_WORKFLOWS_COUNT_WITH_STATUS", query = "select count(w) from WorkflowJobBean w where w.statusStr = :status"), + @NamedQuery(name = "GET_WORKFLOWS_COUNT_WITH_STATUS", query = "select count(w) from WorkflowJobBean w where w.statusStr " + + "= :status"), - @NamedQuery(name = "GET_WORKFLOWS_COUNT_WITH_STATUS_IN_LAST_N_SECS", query = "select count(w) from WorkflowJobBean w where w.statusStr = :status and w.lastModifiedTimestamp > :lastModTime"), + @NamedQuery(name = "GET_WORKFLOWS_COUNT_WITH_STATUS_IN_LAST_N_SECS", query = "select count(w) from WorkflowJobBean w " + + "where w.statusStr = :status and w.lastModifiedTimestamp > :lastModTime"), - @NamedQuery(name = "GET_WORKFLOWS_WITH_WORKFLOW_PARENT_ID", query = "select w.id from WorkflowJobBean w where w.parentId = :parentId"), + @NamedQuery(name = "GET_WORKFLOWS_WITH_WORKFLOW_PARENT_ID", query = "select w.id from WorkflowJobBean w where w.parentId " + + "= :parentId"), - @NamedQuery(name = "GET_WORKFLOWS_WITH_COORD_PARENT_ID", query = "select w.id from WorkflowJobBean w where w.parentId like :parentId"), // when setting parentId parameter, make sure to append a '%' (percent symbol) at the end (e.g. 0000004-130709155224435-oozie-rkan-C%") + @NamedQuery(name = "GET_WORKFLOWS_WITH_COORD_PARENT_ID", query = "select w.id from WorkflowJobBean w where w.parentId " + + "like :parentId"), // when setting parentId parameter, make sure to append a '%' (percent symbol) at the end + //(e.g. 0000004-130709155224435-oozie-rkan-C%") - @NamedQuery(name = "GET_WORKFLOWS_BASIC_INFO_BY_PARENT_ID", query = "select w.id, w.statusStr, w.endTimestamp, w.lastModifiedTimestamp from WorkflowJobBean w where w.parentId = :parentId"), + @NamedQuery(name = "GET_WORKFLOWS_BASIC_INFO_BY_PARENT_ID", query = "select w.id, w.statusStr, w.endTimestamp," + + " w.lastModifiedTimestamp from WorkflowJobBean w where w.parentId = :parentId"), - @NamedQuery(name = "GET_WORKFLOWS_BASIC_INFO_BY_COORD_PARENT_ID", query = "select w.id, w.statusStr, w.endTimestamp, w.lastModifiedTimestamp from WorkflowJobBean w where w.parentId like :parentId"), + @NamedQuery(name = "GET_WORKFLOWS_BASIC_INFO_BY_COORD_PARENT_ID", query = "select w.id, w.statusStr, w.endTimestamp," + + " w.lastModifiedTimestamp from WorkflowJobBean w where w.parentId like :parentId"), @NamedQuery(name = "GET_WORKFLOW_FOR_USER", query = "select w.user from WorkflowJobBean w where w.id = :id"), http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java b/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java index b9c89b2..427f43d 100644 --- a/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java +++ b/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java @@ -135,7 +135,8 @@ public class JavaActionExecutor extends ActionExecutor { public static final String LAUNCER_VIEW_ACL = "oozie.launcher.view.acl"; public static final String MAPREDUCE_TO_CLASSPATH = "mapreduce.needed.for"; - public static final String OOZIE_LAUNCHER_ADD_MAPREDUCE_TO_CLASSPATH_PROPERTY = ActionExecutor.CONF_PREFIX + MAPREDUCE_TO_CLASSPATH; + public static final String OOZIE_LAUNCHER_ADD_MAPREDUCE_TO_CLASSPATH_PROPERTY = ActionExecutor.CONF_PREFIX + + MAPREDUCE_TO_CLASSPATH; public static final String MAX_EXTERNAL_STATS_SIZE = "oozie.external.stats.max.size"; public static final String ACL_VIEW_JOB = "mapreduce.job.acl-view-job"; http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/client/rest/JsonBean.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/client/rest/JsonBean.java b/core/src/main/java/org/apache/oozie/client/rest/JsonBean.java index c8bd7c2..00d06ef 100644 --- a/core/src/main/java/org/apache/oozie/client/rest/JsonBean.java +++ b/core/src/main/java/org/apache/oozie/client/rest/JsonBean.java @@ -31,7 +31,7 @@ public interface JsonBean { * @return the JSONObject for the bean with GMT time zone. */ JSONObject toJSONObject(); - + /** * Return the JSONObject for the bean with the given time zone. * http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/bundle/BundleJobSuspendXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/bundle/BundleJobSuspendXCommand.java b/core/src/main/java/org/apache/oozie/command/bundle/BundleJobSuspendXCommand.java index 669ac5e..5c3d84e 100644 --- a/core/src/main/java/org/apache/oozie/command/bundle/BundleJobSuspendXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/bundle/BundleJobSuspendXCommand.java @@ -131,7 +131,8 @@ public class BundleJobSuspendXCommand extends SuspendTransitionXCommand { protected void verifyPrecondition() throws CommandException, PreconditionException { if (bundleJob.getStatus() == Job.Status.SUCCEEDED || bundleJob.getStatus() == Job.Status.FAILED || bundleJob.getStatus() == Job.Status.KILLED || bundleJob.getStatus() == Job.Status.DONEWITHERROR) { - LOG.info("BundleJobSuspendXCommand is not going to execute because job either succeeded, failed, killed, or donewitherror; id = " + LOG.info("BundleJobSuspendXCommand is not going to execute because job either succeeded, failed, killed," + + " or donewitherror; id = " + jobId + ", status = " + bundleJob.getStatus()); throw new PreconditionException(ErrorCode.E1312, jobId, bundleJob.getStatus().toString()); } @@ -146,7 +147,8 @@ public class BundleJobSuspendXCommand extends SuspendTransitionXCommand { bundleJob.setSuspendedTime(new Date()); bundleJob.setLastModifiedTime(new Date()); - LOG.debug("Suspend bundle job id = " + jobId + ", status = " + bundleJob.getStatus() + ", pending = " + bundleJob.isPending()); + LOG.debug("Suspend bundle job id = " + jobId + ", status = " + bundleJob.getStatus() + ", pending = " + + bundleJob.isPending()); updateList.add(new UpdateEntry<BundleJobQuery>(BundleJobQuery.UPDATE_BUNDLE_JOB_STATUS_PENDING_SUSP_MOD_TIME, bundleJob)); } @@ -160,7 +162,8 @@ public class BundleJobSuspendXCommand extends SuspendTransitionXCommand { if (action.getCoordId() != null) { queue(new CoordSuspendXCommand(action.getCoordId())); updateBundleAction(action); - LOG.debug("Suspend bundle action = [{0}], new status = [{1}], pending = [{2}] and queue CoordSuspendXCommand for [{3}]", + LOG.debug("Suspend bundle action = [{0}], new status = [{1}], pending = [{2}] and queue CoordSuspendXCommand" + + " for [{3}]", action.getBundleActionId(), action.getStatus(), action.getPending(), action.getCoordId()); } else { updateBundleAction(action); http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java index 179cc45..b3174d2 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java @@ -510,7 +510,8 @@ public class CoordActionInputCheckXCommand extends CoordinatorXCommand<Void> { return; } - if (coordJob.getStatus() != Job.Status.RUNNING && coordJob.getStatus() != Job.Status.RUNNINGWITHERROR && coordJob.getStatus() != Job.Status.PAUSED + if (coordJob.getStatus() != Job.Status.RUNNING && coordJob.getStatus() != Job.Status.RUNNINGWITHERROR + && coordJob.getStatus() != Job.Status.PAUSED && coordJob.getStatus() != Job.Status.PAUSEDWITHERROR) { throw new PreconditionException( ErrorCode.E1100, "["+ actionId + "]::CoordActionInputCheck:: Ignoring action." + http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/coord/CoordActionStartXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordActionStartXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordActionStartXCommand.java index 16d7036..dbc188a 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordActionStartXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordActionStartXCommand.java @@ -193,7 +193,8 @@ public class CoordActionStartXCommand extends CoordinatorXCommand<Void> { DagEngine dagEngine = Services.get().get(DagEngineService.class).getDagEngine(user); try { Configuration conf = new XConfiguration(new StringReader(coordAction.getRunConf())); - SLAEventBean slaEvent = SLADbOperations.createStatusEvent(coordAction.getSlaXml(), coordAction.getId(), Status.STARTED, + SLAEventBean slaEvent = SLADbOperations.createStatusEvent(coordAction.getSlaXml(), coordAction.getId(), + Status.STARTED, SlaAppType.COORDINATOR_ACTION, log); if(slaEvent != null) { insertList.add(slaEvent); @@ -221,7 +222,8 @@ public class CoordActionStartXCommand extends CoordinatorXCommand<Void> { JPAService jpaService = Services.get().get(JPAService.class); if (jpaService != null) { log.debug("Updating WF record for WFID :" + coordAction.getExternalId() + " with parent id: " + actionId); - WorkflowJobBean wfJob = WorkflowJobQueryExecutor.getInstance().get(WorkflowJobQuery.GET_WORKFLOW_STARTTIME, coordAction.getExternalId()); + WorkflowJobBean wfJob = WorkflowJobQueryExecutor.getInstance().get(WorkflowJobQuery.GET_WORKFLOW_STARTTIME, + coordAction.getExternalId()); wfJob.setParentId(actionId); wfJob.setLastModifiedTime(new Date()); BatchQueryExecutor executor = BatchQueryExecutor.getInstance(); @@ -281,7 +283,8 @@ public class CoordActionStartXCommand extends CoordinatorXCommand<Void> { CoordActionQuery.UPDATE_COORD_ACTION_FOR_START, coordAction)); insertList = new ArrayList<JsonBean>(); - SLAEventBean slaEvent = SLADbOperations.createStatusEvent(coordAction.getSlaXml(), coordAction.getId(), Status.FAILED, + SLAEventBean slaEvent = SLADbOperations.createStatusEvent(coordAction.getSlaXml(), coordAction.getId(), + Status.FAILED, SlaAppType.COORDINATOR_ACTION, log); if(slaEvent != null) { insertList.add(slaEvent); //Update SLA events http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/coord/CoordChangeXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordChangeXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordChangeXCommand.java index ff7bf8a..3b7b664 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordChangeXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordChangeXCommand.java @@ -281,7 +281,8 @@ public class CoordChangeXCommand extends CoordinatorXCommand<Void> { if (SLAService.isEnabled()) { Services.get().get(SLAService.class).removeRegistration(actionId); } - SLARegistrationBean slaReg = SLARegistrationQueryExecutor.getInstance().get(SLARegQuery.GET_SLA_REG_ALL, actionId); + SLARegistrationBean slaReg = SLARegistrationQueryExecutor.getInstance().get(SLARegQuery.GET_SLA_REG_ALL, + actionId); if (slaReg != null) { LOG.debug("Deleting registration bean corresponding to action " + slaReg.getId()); deleteList.add(slaReg); @@ -446,7 +447,8 @@ public class CoordChangeXCommand extends CoordinatorXCommand<Void> { } } - if (coordJob.getNextMaterializedTime() != null && coordJob.getEndTime().compareTo(coordJob.getNextMaterializedTime()) <= 0) { + if (coordJob.getNextMaterializedTime() != null && coordJob.getEndTime() + .compareTo(coordJob.getNextMaterializedTime()) <= 0) { LOG.info("[" + coordJob.getId() + "]: all actions have been materialized, job status = " + coordJob.getStatus() + ", set pending to true"); // set doneMaterialization to true when materialization is done http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java b/core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java index fbc6152..4e4a569 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java @@ -198,7 +198,8 @@ public class CoordCommandUtils { || getFuncType(startInst) == ENDOFWEEKS || getFuncType(startInst) == ENDOFDAYS) { if (getFuncType(endInst) != CURRENT) { throw new CommandException(ErrorCode.E1010, - "Only start-instance as absolute/endOfMonths/endOfWeeks/endOfDays and end-instance as current is supported." + "Only start-instance as absolute/endOfMonths/endOfWeeks/endOfDays and end-instance as current is" + + " supported." + " start = " + startInst + " end = " + endInst); } } http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java index b4e62e9..ff1aa37 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java @@ -222,7 +222,9 @@ public class CoordMaterializeTransitionXCommand extends MaterializeTransitionXCo if (endMatdTime.compareTo(jobEndTime) > 0) { endMatdTime = jobEndTime; } - LOG.debug("Materializing coord job id=" + jobId + ", start=" + DateUtils.formatDateOozieTZ(startMatdTime) + ", end=" + DateUtils.formatDateOozieTZ(endMatdTime) + + LOG.debug("Materializing coord job id=" + jobId + ", start=" + DateUtils.formatDateOozieTZ(startMatdTime) + ", end=" + + DateUtils.formatDateOozieTZ(endMatdTime) + ", window=" + materializationWindow); } http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/coord/CoordPushDependencyCheckXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordPushDependencyCheckXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordPushDependencyCheckXCommand.java index 1e864ea..41b78af 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordPushDependencyCheckXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordPushDependencyCheckXCommand.java @@ -185,7 +185,8 @@ public class CoordPushDependencyCheckXCommand extends CoordinatorXCommand<Void> if (isTimeout()) { LOG.debug("Queueing timeout command"); // XCommand.queue() will not work when there is a Exception - callableQueueService.queue(new CoordActionTimeOutXCommand(coordAction, coordJob.getUser(), coordJob.getAppName())); + callableQueueService.queue(new CoordActionTimeOutXCommand(coordAction, coordJob.getUser(), + coordJob.getAppName())); unregisterMissingDependencies(missingDependenciesArray, actionId); } else if (coordPullInputDependency.getMissingDependenciesAsList().size() > 0) { http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/coord/CoordResumeXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordResumeXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordResumeXCommand.java index 1998924..3a70ebc 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordResumeXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordResumeXCommand.java @@ -97,7 +97,8 @@ public class CoordResumeXCommand extends ResumeTransitionXCommand { @Override protected void verifyPrecondition() throws CommandException, PreconditionException { - if (coordJob.getStatus() != CoordinatorJob.Status.SUSPENDED && coordJob.getStatus() != CoordinatorJob.Status.SUSPENDEDWITHERROR && coordJob.getStatus() != Job.Status.PREPSUSPENDED) { + if (coordJob.getStatus() != CoordinatorJob.Status.SUSPENDED && coordJob.getStatus() != CoordinatorJob.Status + .SUSPENDEDWITHERROR && coordJob.getStatus() != Job.Status.PREPSUSPENDED) { throw new PreconditionException(ErrorCode.E1100, "CoordResumeXCommand not Resumed - " + "job not in SUSPENDED/SUSPENDEDWITHERROR/PREPSUSPENDED state, job = " + jobId); } http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java index 42bdc99..2226b46 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java @@ -374,7 +374,8 @@ public class CoordSubmitXCommand extends SubmitTransitionXCommand { /* * Check against multiple data instance values inside a single <instance> <start-instance> or <end-instance> tag - * If found, the job is not submitted and user is informed to correct the error, instead of defaulting to the first instance value in the list + * If found, the job is not submitted and user is informed to correct the error, + * instead of defaulting to the first instance value in the list */ private void checkMultipleTimeInstances(Element eCoordJob, String eventType, String dataType) throws CoordinatorJobException { Element eventsSpec, dataSpec, instance; @@ -385,7 +386,8 @@ public class CoordSubmitXCommand extends SubmitTransitionXCommand { if (eventsSpec != null) { dataSpec = eventsSpec.getChild(dataType, ns); if (dataSpec != null) { - // In case of input-events, there can be multiple child <instance> datasets. Iterating to ensure none of them have errors + // In case of input-events, there can be multiple child <instance> datasets. + // Iterating to ensure none of them have errors instanceSpecList = dataSpec.getChildren("instance", ns); Iterator instanceIter = instanceSpecList.iterator(); while(instanceIter.hasNext()) { @@ -405,13 +407,15 @@ public class CoordSubmitXCommand extends SubmitTransitionXCommand { } } - // In case of input-events, there can be multiple child <start-instance> datasets. Iterating to ensure none of them have errors + // In case of input-events, there can be multiple child <start-instance> datasets. + // Iterating to ensure none of them have errors instanceSpecList = dataSpec.getChildren("start-instance", ns); instanceIter = instanceSpecList.iterator(); while(instanceIter.hasNext()) { instance = ((Element) instanceIter.next()); if(instance.getContentSize() == 0) { //empty string or whitespace - throw new CoordinatorJobException(ErrorCode.E1021, "<start-instance> tag within " + eventType + " is empty!"); + throw new CoordinatorJobException(ErrorCode.E1021, "<start-instance> tag within " + eventType + + " is empty!"); } instanceValue = instance.getContent(0).toString(); boolean isInvalid = false; @@ -425,7 +429,8 @@ public class CoordSubmitXCommand extends SubmitTransitionXCommand { } } - // In case of input-events, there can be multiple child <end-instance> datasets. Iterating to ensure none of them have errors + // In case of input-events, there can be multiple child <end-instance> datasets. + // Iterating to ensure none of them have errors instanceSpecList = dataSpec.getChildren("end-instance", ns); instanceIter = instanceSpecList.iterator(); while(instanceIter.hasNext()) { http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/coord/CoordSuspendXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordSuspendXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordSuspendXCommand.java index 1195ef0..7a4f0c0 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordSuspendXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordSuspendXCommand.java @@ -164,7 +164,8 @@ public class CoordSuspendXCommand extends SuspendTransitionXCommand { InstrumentUtils.incrJobCounter(getName(), 1, getInstrumentation()); coordJob.setLastModifiedTime(new Date()); coordJob.setSuspendedTime(new Date()); - LOG.debug("Suspend coordinator job id = " + jobId + ", status = " + coordJob.getStatus() + ", pending = " + coordJob.isPending()); + LOG.debug("Suspend coordinator job id = " + jobId + ", status = " + coordJob.getStatus() + ", pending = " + + coordJob.isPending()); updateList.add(new UpdateEntry<CoordJobQuery>(CoordJobQuery.UPDATE_COORD_JOB_STATUS_PENDING_TIME, coordJob)); } http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/wf/ActionEndXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/wf/ActionEndXCommand.java b/core/src/main/java/org/apache/oozie/command/wf/ActionEndXCommand.java index 86ee1cc..ef0ed66 100644 --- a/core/src/main/java/org/apache/oozie/command/wf/ActionEndXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/wf/ActionEndXCommand.java @@ -129,7 +129,8 @@ public class ActionEndXCommand extends ActionXCommand<Void> { } if (wfAction.isPending() && (wfAction.getStatus() == WorkflowActionBean.Status.DONE - || wfAction.getStatus() == WorkflowActionBean.Status.END_RETRY || wfAction.getStatus() == WorkflowActionBean.Status.END_MANUAL)) { + || wfAction.getStatus() == WorkflowActionBean.Status.END_RETRY || wfAction.getStatus() + == WorkflowActionBean.Status.END_MANUAL)) { if (wfJob.getStatus() != WorkflowJob.Status.RUNNING) { throw new PreconditionException(ErrorCode.E0811, WorkflowJob.Status.RUNNING.toString()); @@ -217,7 +218,8 @@ public class ActionEndXCommand extends ActionXCommand<Void> { break; } if (!shouldHandleUserRetry || !handleUserRetry(context, wfAction)) { - SLAEventBean slaEvent = SLADbXOperations.createStatusEvent(wfAction.getSlaXml(), wfAction.getId(), slaStatus, SlaAppType.WORKFLOW_ACTION); + SLAEventBean slaEvent = SLADbXOperations.createStatusEvent(wfAction.getSlaXml(), wfAction.getId(), slaStatus, + SlaAppType.WORKFLOW_ACTION); if(slaEvent != null) { insertList.add(slaEvent); } http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/wf/ActionKillXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/wf/ActionKillXCommand.java b/core/src/main/java/org/apache/oozie/command/wf/ActionKillXCommand.java index 61891b8..94598a8 100644 --- a/core/src/main/java/org/apache/oozie/command/wf/ActionKillXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/wf/ActionKillXCommand.java @@ -155,7 +155,8 @@ public class ActionKillXCommand extends ActionXCommand<Void> { wfJob.setLastModifiedTime(new Date()); updateList.add(new UpdateEntry<WorkflowJobQuery>(WorkflowJobQuery.UPDATE_WORKFLOW_MODTIME, wfJob)); // Add SLA status event (KILLED) for WF_ACTION - SLAEventBean slaEvent = SLADbXOperations.createStatusEvent(wfAction.getSlaXml(), wfAction.getId(), Status.KILLED, + SLAEventBean slaEvent = SLADbXOperations.createStatusEvent(wfAction.getSlaXml(), wfAction.getId(), + Status.KILLED, SlaAppType.WORKFLOW_ACTION); if(slaEvent != null) { insertList.add(slaEvent); @@ -174,7 +175,8 @@ public class ActionKillXCommand extends ActionXCommand<Void> { wfJob.setLastModifiedTime(new Date()); updateList.add(new UpdateEntry<WorkflowJobQuery>(WorkflowJobQuery.UPDATE_WORKFLOW_STATUS_MODTIME, wfJob)); // What will happen to WF and COORD_ACTION, NOTIFICATION? - SLAEventBean slaEvent = SLADbXOperations.createStatusEvent(wfAction.getSlaXml(), wfAction.getId(), Status.FAILED, + SLAEventBean slaEvent = SLADbXOperations.createStatusEvent(wfAction.getSlaXml(), wfAction.getId(), + Status.FAILED, SlaAppType.WORKFLOW_ACTION); if(slaEvent != null) { insertList.add(slaEvent); http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/wf/ActionStartXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/wf/ActionStartXCommand.java b/core/src/main/java/org/apache/oozie/command/wf/ActionStartXCommand.java index 71c29cd..ab40c6e 100644 --- a/core/src/main/java/org/apache/oozie/command/wf/ActionStartXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/wf/ActionStartXCommand.java @@ -227,7 +227,8 @@ public class ActionStartXCommand extends ActionXCommand<org.apache.oozie.command wfAction.setErrorInfo(null, null); incrActionCounter(wfAction.getType(), 1); - LOG.info("Start action [{0}] with user-retry state : userRetryCount [{1}], userRetryMax [{2}], userRetryInterval [{3}]", + LOG.info("Start action [{0}] with user-retry state : userRetryCount [{1}], userRetryMax [{2}], userRetryInterval" + + " [{3}]", wfAction.getId(), wfAction.getUserRetryCount(), wfAction.getUserRetryMax(), wfAction .getUserRetryInterval()); @@ -237,7 +238,8 @@ public class ActionStartXCommand extends ActionXCommand<org.apache.oozie.command if (wfAction.getStartTime() == null) { context.setStartTime(); } - context.setVar(JobUtils.getRetryKey(wfAction, JsonTags.WORKFLOW_ACTION_START_TIME), String.valueOf(new Date().getTime())); + context.setVar(JobUtils.getRetryKey(wfAction, JsonTags.WORKFLOW_ACTION_START_TIME), + String.valueOf(new Date().getTime())); executor.start(context, wfAction); cron.stop(); FaultInjection.activate("org.apache.oozie.command.SkipCommitFaultInjection"); @@ -309,7 +311,8 @@ public class ActionStartXCommand extends ActionXCommand<org.apache.oozie.command try { failJob(context); endWF(); - SLAEventBean slaEvent1 = SLADbXOperations.createStatusEvent(wfAction.getSlaXml(), wfAction.getId(), Status.FAILED, + SLAEventBean slaEvent1 = SLADbXOperations.createStatusEvent(wfAction.getSlaXml(), wfAction.getId(), + Status.FAILED, SlaAppType.WORKFLOW_ACTION); if(slaEvent1 != null) { insertList.add(slaEvent1); http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java b/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java index 29ccd32..7e328b7 100644 --- a/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java @@ -442,7 +442,8 @@ public abstract class ActionXCommand<T> extends WorkflowXCommand<T> { /* * (non-Javadoc) - * @see org.apache.oozie.action.ActionExecutor.Context#setEndData(org.apache.oozie.client.WorkflowAction.Status, java.lang.String) + * @see org.apache.oozie.action.ActionExecutor.Context#setEndData(org.apache.oozie.client.WorkflowAction.Status, + * java.lang.String) */ public void setEndData(WorkflowAction.Status status, String signalValue) { action.setEndData(status, signalValue); http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/coord/CoordUtils.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/coord/CoordUtils.java b/core/src/main/java/org/apache/oozie/coord/CoordUtils.java index 2874bf6..e0c6af9 100644 --- a/core/src/main/java/org/apache/oozie/coord/CoordUtils.java +++ b/core/src/main/java/org/apache/oozie/coord/CoordUtils.java @@ -202,7 +202,8 @@ public class CoordUtils { String[] range = s.split("-"); // Check the format for action's range if (range.length != 2) { - throw new CommandException(ErrorCode.E0302, "format is wrong for action's range '" + s + "', an example of correct format is 1-5"); + throw new CommandException(ErrorCode.E0302, "format is wrong for action's range '" + s + "', an example of" + + " correct format is 1-5"); } int start; int end; http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/coord/HCatELFunctions.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/coord/HCatELFunctions.java b/core/src/main/java/org/apache/oozie/coord/HCatELFunctions.java index f40f406..12c0b81 100644 --- a/core/src/main/java/org/apache/oozie/coord/HCatELFunctions.java +++ b/core/src/main/java/org/apache/oozie/coord/HCatELFunctions.java @@ -319,7 +319,8 @@ public class HCatELFunctions { } /** - * Used to specify the MAXIMUM value of an HCat partition which is input dependency for workflow job.<p> Look for two evaluator-level + * Used to specify the MAXIMUM value of an HCat partition which is input dependency for workflow job. + * <p> Look for two evaluator-level * variables <p> A) .datain.<DATAIN_NAME> B) .datain.<DATAIN_NAME>.unresolved <p> A defines the current list of * HCat URIs. <p> B defines whether there are any unresolved EL-function (i.e latest) <p> If there are something * unresolved, this function will echo back the original function <p> otherwise it sends the max partition value. @@ -364,7 +365,8 @@ public class HCatELFunctions { } /** - * Used to specify the MINIMUM value of an HCat partition which is input dependency for workflow job.<p> Look for two evaluator-level + * Used to specify the MINIMUM value of an HCat partition which is input dependency for workflow job. + * <p> Look for two evaluator-level * variables <p> A) .datain.<DATAIN_NAME> B) .datain.<DATAIN_NAME>.unresolved <p> A defines the current list of * HCat URIs. <p> B defines whether there are any unresolved EL-function (i.e latest) <p> If there are something * unresolved, this function will echo back the original function <p> otherwise it sends the min partition value. http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/executor/jpa/BundleJobsGetRunningOrPendingJPAExecutor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/executor/jpa/BundleJobsGetRunningOrPendingJPAExecutor.java b/core/src/main/java/org/apache/oozie/executor/jpa/BundleJobsGetRunningOrPendingJPAExecutor.java index 18ceb10..bfb0b84 100644 --- a/core/src/main/java/org/apache/oozie/executor/jpa/BundleJobsGetRunningOrPendingJPAExecutor.java +++ b/core/src/main/java/org/apache/oozie/executor/jpa/BundleJobsGetRunningOrPendingJPAExecutor.java @@ -28,7 +28,8 @@ import org.apache.oozie.BundleJobBean; import org.apache.oozie.ErrorCode; /** - * Get a list of Bundle Jobs that are are RUNNING or RUNNINGWITHERROR status or the pending flag is 1. The result is ordered by lastModifiedTimestamp. + * Get a list of Bundle Jobs that are are RUNNING or RUNNINGWITHERROR status or the pending flag is 1. + * The result is ordered by lastModifiedTimestamp. */ public class BundleJobsGetRunningOrPendingJPAExecutor implements JPAExecutor<List<BundleJobBean>> { private int limit; http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionRemoveJPAExecutor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionRemoveJPAExecutor.java b/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionRemoveJPAExecutor.java index 02a4f68..bedff49 100644 --- a/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionRemoveJPAExecutor.java +++ b/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionRemoveJPAExecutor.java @@ -34,7 +34,7 @@ public class CoordActionRemoveJPAExecutor implements JPAExecutor<Void> { /** * Constructor which records coordinator action id. - * + * * @param coordActionId */ public CoordActionRemoveJPAExecutor(String coordActionId) { http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobGetRunningActionsCountJPAExecutor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobGetRunningActionsCountJPAExecutor.java b/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobGetRunningActionsCountJPAExecutor.java index 274b3c1..567df40 100644 --- a/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobGetRunningActionsCountJPAExecutor.java +++ b/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobGetRunningActionsCountJPAExecutor.java @@ -25,7 +25,7 @@ import org.apache.oozie.ErrorCode; import org.apache.oozie.util.ParamChecker; /** - * Load the number of running actions for a coordinator job. + * Load the number of running actions for a coordinator job. */ public class CoordJobGetRunningActionsCountJPAExecutor implements JPAExecutor<Integer> { http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowActionRetryManualGetJPAExecutor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowActionRetryManualGetJPAExecutor.java b/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowActionRetryManualGetJPAExecutor.java index 51449db..606c9b7 100644 --- a/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowActionRetryManualGetJPAExecutor.java +++ b/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowActionRetryManualGetJPAExecutor.java @@ -34,7 +34,7 @@ public class WorkflowActionRetryManualGetJPAExecutor implements JPAExecutor<List /** * This creates the WorkflowActionRetryManualGetJPAExecutor executor object. - * + * * @param wfId */ public WorkflowActionRetryManualGetJPAExecutor(String wfId) { http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowInfoWithActionsSubsetGetJPAExecutor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowInfoWithActionsSubsetGetJPAExecutor.java b/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowInfoWithActionsSubsetGetJPAExecutor.java index 43c7d08..5f12b4d 100644 --- a/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowInfoWithActionsSubsetGetJPAExecutor.java +++ b/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowInfoWithActionsSubsetGetJPAExecutor.java @@ -43,7 +43,7 @@ public class WorkflowInfoWithActionsSubsetGetJPAExecutor implements JPAExecutor< /** * This will create the WorkflowInfoWithActionsSubsetGetJPAExecutor object. which is responsible for getting the * Workflow job with actions in certain range. - * + * * @param wfJobId * @param start * @param len http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowJobsBasicInfoFromParentId.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowJobsBasicInfoFromParentId.java b/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowJobsBasicInfoFromParentId.java index 4b8adfb..5721d96 100644 --- a/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowJobsBasicInfoFromParentId.java +++ b/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowJobsBasicInfoFromParentId.java @@ -7,7 +7,7 @@ * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/service/AuthorizationService.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/service/AuthorizationService.java b/core/src/main/java/org/apache/oozie/service/AuthorizationService.java index d76e1ea..33fd9c3 100644 --- a/core/src/main/java/org/apache/oozie/service/AuthorizationService.java +++ b/core/src/main/java/org/apache/oozie/service/AuthorizationService.java @@ -406,7 +406,8 @@ public class AuthorizationService implements Service { incrCounter(INSTR_FAILED_AUTH_COUNTER, 1); throw new AuthorizationException(ErrorCode.E0504, appPath); } - if (conf.get(XOozieClient.IS_PROXY_SUBMISSION) == null) { // Only further check existence of job definition files for non proxy submission jobs; + if (conf.get(XOozieClient.IS_PROXY_SUBMISSION) == null) { // Only further check existence of job definition + //files for non proxy submission jobs; if (!fs.isFile(path)) { Path appXml = new Path(path, fileName); if (!fs.exists(appXml)) { http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/service/PurgeService.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/service/PurgeService.java b/core/src/main/java/org/apache/oozie/service/PurgeService.java index c2c966b..81f22b6 100644 --- a/core/src/main/java/org/apache/oozie/service/PurgeService.java +++ b/core/src/main/java/org/apache/oozie/service/PurgeService.java @@ -22,7 +22,8 @@ import org.apache.hadoop.conf.Configuration; import org.apache.oozie.command.PurgeXCommand; /** - * The PurgeService schedules purging of completed jobs and associated action older than a specified age for workflow, coordinator and bundle. + * The PurgeService schedules purging of completed jobs and associated action older than a specified age for workflow, + * coordinator and bundle. */ public class PurgeService implements Service { http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/servlet/JsonRestServlet.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/servlet/JsonRestServlet.java b/core/src/main/java/org/apache/oozie/servlet/JsonRestServlet.java index 404d3cd..17dc686 100644 --- a/core/src/main/java/org/apache/oozie/servlet/JsonRestServlet.java +++ b/core/src/main/java/org/apache/oozie/servlet/JsonRestServlet.java @@ -381,7 +381,7 @@ public abstract class JsonRestServlet extends HttpServlet { * @param timeZoneId time zone to use for dates in the JSON response. * @throws java.io.IOException thrown if the bean could not be serialized to the response output stream. */ - protected void sendJsonResponse(HttpServletResponse response, int statusCode, JsonBean bean, String timeZoneId) + protected void sendJsonResponse(HttpServletResponse response, int statusCode, JsonBean bean, String timeZoneId) throws IOException { response.setStatus(statusCode); JSONObject json = bean.toJSONObject(timeZoneId); http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/servlet/ServletUtilities.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/servlet/ServletUtilities.java b/core/src/main/java/org/apache/oozie/servlet/ServletUtilities.java index 9cdd915..3eb32d5 100644 --- a/core/src/main/java/org/apache/oozie/servlet/ServletUtilities.java +++ b/core/src/main/java/org/apache/oozie/servlet/ServletUtilities.java @@ -71,11 +71,13 @@ public class ServletUtilities { } if (n == 0) { - throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0302, "a workflow, coordinator, or bundle app path is required"); + throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0302, "a workflow, coordinator," + + " or bundle app path is required"); } if (n != 1) { - throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0302, "Multiple app paths specified, only one is allowed"); + throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0302, "Multiple app paths specified," + + " only one is allowed"); } } http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/servlet/V0AdminServlet.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/servlet/V0AdminServlet.java b/core/src/main/java/org/apache/oozie/servlet/V0AdminServlet.java index d4a0989..b43ab99 100644 --- a/core/src/main/java/org/apache/oozie/servlet/V0AdminServlet.java +++ b/core/src/main/java/org/apache/oozie/servlet/V0AdminServlet.java @@ -42,7 +42,8 @@ public class V0AdminServlet extends BaseAdminServlet { static { RESOURCES_INFO[0] = new ResourceInfo(RestConstants.ADMIN_STATUS_RESOURCE, Arrays.asList("PUT", "GET"), - Arrays.asList(new ParameterInfo(RestConstants.ADMIN_SAFE_MODE_PARAM, Boolean.class, true, + Arrays.asList(new ParameterInfo(RestConstants.ADMIN_SAFE_MODE_PARAM, Boolean.class, + true, Arrays.asList("PUT")))); RESOURCES_INFO[1] = new ResourceInfo(RestConstants.ADMIN_OS_ENV_RESOURCE, Arrays.asList("GET"), Collections.EMPTY_LIST); http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/servlet/V0JobsServlet.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/servlet/V0JobsServlet.java b/core/src/main/java/org/apache/oozie/servlet/V0JobsServlet.java index ff50f3d..1d80094 100644 --- a/core/src/main/java/org/apache/oozie/servlet/V0JobsServlet.java +++ b/core/src/main/java/org/apache/oozie/servlet/V0JobsServlet.java @@ -56,7 +56,8 @@ public class V0JobsServlet extends BaseJobsServlet { try { String action = request.getParameter(RestConstants.ACTION_PARAM); if (action != null && !action.equals(RestConstants.JOB_ACTION_START)) { - throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0303, RestConstants.ACTION_PARAM, action); + throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0303, RestConstants.ACTION_PARAM, + action); } boolean startJob = (action != null); String user = conf.get(OozieClient.USER_NAME); @@ -75,7 +76,8 @@ public class V0JobsServlet extends BaseJobsServlet { * v0 service implementation to get a JSONObject representation of a job from its external ID */ @Override - protected JSONObject getJobIdForExternalId(HttpServletRequest request, String externalId) throws XServletException, IOException { + protected JSONObject getJobIdForExternalId(HttpServletRequest request, String externalId) throws XServletException, + IOException { JSONObject json = new JSONObject(); try { DagEngine dagEngine = Services.get().get(DagEngineService.class) http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/servlet/V1JobServlet.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/servlet/V1JobServlet.java b/core/src/main/java/org/apache/oozie/servlet/V1JobServlet.java index 0d275fd..361141b 100644 --- a/core/src/main/java/org/apache/oozie/servlet/V1JobServlet.java +++ b/core/src/main/java/org/apache/oozie/servlet/V1JobServlet.java @@ -88,7 +88,8 @@ public class V1JobServlet extends BaseJobServlet { startBundleJob(request, response); } else { - throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0303, RestConstants.ACTION_PARAM, RestConstants.JOB_ACTION_START); + throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0303, RestConstants.ACTION_PARAM, + RestConstants.JOB_ACTION_START); } } http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/sla/SLARegistrationBean.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/sla/SLARegistrationBean.java b/core/src/main/java/org/apache/oozie/sla/SLARegistrationBean.java index 5eac78c..d10366d 100644 --- a/core/src/main/java/org/apache/oozie/sla/SLARegistrationBean.java +++ b/core/src/main/java/org/apache/oozie/sla/SLARegistrationBean.java @@ -45,21 +45,31 @@ import org.json.simple.JSONObject; @Table(name = "SLA_REGISTRATION") @NamedQueries({ - @NamedQuery(name = "UPDATE_SLA_REG_ALL", query = "update SLARegistrationBean w set w.jobId = :jobId, w.nominalTimeTS = :nominalTime, w.expectedStartTS = :expectedStartTime, w.expectedEndTS = :expectedEndTime, w.expectedDuration = :expectedDuration, w.slaConfig = :slaConfig, w.notificationMsg = :notificationMsg, w.upstreamApps = :upstreamApps, w.appType = :appType, w.appName = :appName, w.user = :user, w.parentId = :parentId, w.jobData = :jobData where w.jobId = :jobId"), + @NamedQuery(name = "UPDATE_SLA_REG_ALL", query = "update SLARegistrationBean w set w.jobId = :jobId, w.nominalTimeTS " + + "= :nominalTime, w.expectedStartTS = :expectedStartTime, w.expectedEndTS = :expectedEndTime, w.expectedDuration " + + "= :expectedDuration, w.slaConfig = :slaConfig, w.notificationMsg = :notificationMsg, w.upstreamApps = :upstreamApps," + + " w.appType = :appType, w.appName = :appName, w.user = :user, w.parentId = :parentId, w.jobData = :jobData " + + "where w.jobId = :jobId"), - @NamedQuery(name = "UPDATE_SLA_CONFIG", query = "update SLARegistrationBean w set w.slaConfig = :slaConfig where w.jobId = :jobId"), + @NamedQuery(name = "UPDATE_SLA_CONFIG", query = "update SLARegistrationBean w set w.slaConfig = :slaConfig where w.jobId" + + " = :jobId"), - @NamedQuery(name = "UPDATE_SLA_EXPECTED_VALUE", query = "update SLARegistrationBean w set w.expectedStartTS = :expectedStartTime, w.expectedEndTS = :expectedEndTime , w.expectedDuration = :expectedDuration where w.jobId = :jobId"), + @NamedQuery(name = "UPDATE_SLA_EXPECTED_VALUE", query = "update SLARegistrationBean w set w.expectedStartTS " + + "= :expectedStartTime, w.expectedEndTS = :expectedEndTime , w.expectedDuration = :expectedDuration where w.jobId" + + " = :jobId"), - @NamedQuery(name = "GET_SLA_REG_ON_RESTART", query = "select w.notificationMsg, w.upstreamApps, w.slaConfig, w.jobData from SLARegistrationBean w where w.jobId = :id"), + @NamedQuery(name = "GET_SLA_REG_ON_RESTART", query = "select w.notificationMsg, w.upstreamApps, w.slaConfig, w.jobData " + + "from SLARegistrationBean w where w.jobId = :id"), @NamedQuery(name = "GET_SLA_REG_ALL", query = "select OBJECT(w) from SLARegistrationBean w where w.jobId = :id"), @NamedQuery(name = "GET_SLA_CONFIGS", query = "select w.jobId, w.slaConfig from SLARegistrationBean w where w.jobId IN (:ids)"), - @NamedQuery(name = "GET_SLA_EXPECTED_VALUE_CONFIG", query = "select w.jobId, w.slaConfig, w.expectedStartTS, w.expectedEndTS, w.expectedDuration, w.nominalTimeTS from SLARegistrationBean w where w.jobId = :id"), + @NamedQuery(name = "GET_SLA_EXPECTED_VALUE_CONFIG", query = "select w.jobId, w.slaConfig, w.expectedStartTS, w.expectedEndTS," + + " w.expectedDuration, w.nominalTimeTS from SLARegistrationBean w where w.jobId = :id"), - @NamedQuery(name = "GET_SLA_REG_FOR_PARENT_ID", query = "select w.jobId, w.slaConfig from SLARegistrationBean w where w.parentId = :parentId"), + @NamedQuery(name = "GET_SLA_REG_FOR_PARENT_ID", query = "select w.jobId, w.slaConfig from SLARegistrationBean w " + + "where w.parentId = :parentId"), @NamedQuery(name = "GET_SLA_REGISTRATIONS", query = "select OBJECT(w) from SLARegistrationBean w") }) http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/sla/SLASummaryBean.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/sla/SLASummaryBean.java b/core/src/main/java/org/apache/oozie/sla/SLASummaryBean.java index e9ea9ba..65802d9 100644 --- a/core/src/main/java/org/apache/oozie/sla/SLASummaryBean.java +++ b/core/src/main/java/org/apache/oozie/sla/SLASummaryBean.java @@ -48,21 +48,36 @@ import org.json.simple.JSONObject; @Table(name = "SLA_SUMMARY") @NamedQueries({ - @NamedQuery(name = "UPDATE_SLA_SUMMARY_FOR_SLA_STATUS", query = "update SLASummaryBean w set w.slaStatus = :slaStatus, w.eventStatus = :eventStatus, w.eventProcessed = :eventProcessed, w.lastModifiedTS = :lastModifiedTS where w.jobId = :jobId"), + @NamedQuery(name = "UPDATE_SLA_SUMMARY_FOR_SLA_STATUS", query = "update SLASummaryBean w set w.slaStatus = :slaStatus," + + " w.eventStatus = :eventStatus, w.eventProcessed = :eventProcessed, w.lastModifiedTS = :lastModifiedTS " + + "where w.jobId = :jobId"), - @NamedQuery(name = "UPDATE_SLA_SUMMARY_FOR_STATUS_ACTUAL_TIMES", query = "update SLASummaryBean w set w.slaStatus = :slaStatus, w.eventStatus = :eventStatus, w.eventProcessed = :eventProcessed, w.jobStatus = :jobStatus, w.lastModifiedTS = :lastModifiedTS, w.actualStartTS = :actualStartTS, w.actualEndTS = :actualEndTS, w.actualDuration = :actualDuration where w.jobId = :jobId"), + @NamedQuery(name = "UPDATE_SLA_SUMMARY_FOR_STATUS_ACTUAL_TIMES", query = "update SLASummaryBean w set w.slaStatus = :slaStatus," + + " w.eventStatus = :eventStatus, w.eventProcessed = :eventProcessed, w.jobStatus = :jobStatus, w.lastModifiedTS " + + "= :lastModifiedTS, w.actualStartTS = :actualStartTS, w.actualEndTS = :actualEndTS, w.actualDuration = :actualDuration" + + " where w.jobId = :jobId"), - @NamedQuery(name = "UPDATE_SLA_SUMMARY_FOR_EXPECTED_TIMES", query = "update SLASummaryBean w set w.nominalTimeTS = :nominalTime, w.expectedStartTS = :expectedStartTime, w.expectedEndTS = :expectedEndTime, w.expectedDuration = :expectedDuration , w.lastModifiedTS = :lastModTime where w.jobId = :jobId"), + @NamedQuery(name = "UPDATE_SLA_SUMMARY_FOR_EXPECTED_TIMES", query = "update SLASummaryBean w set w.nominalTimeTS " + + "= :nominalTime, w.expectedStartTS = :expectedStartTime, w.expectedEndTS = :expectedEndTime, w.expectedDuration " + + "= :expectedDuration , w.lastModifiedTS = :lastModTime where w.jobId = :jobId"), - @NamedQuery(name = "UPDATE_SLA_SUMMARY_EVENTPROCESSED", query = "update SLASummaryBean w set w.eventProcessed = :eventProcessed where w.jobId = :jobId"), + @NamedQuery(name = "UPDATE_SLA_SUMMARY_EVENTPROCESSED", query = "update SLASummaryBean w set w.eventProcessed " + + "= :eventProcessed where w.jobId = :jobId"), - @NamedQuery(name = "UPDATE_SLA_SUMMARY_LAST_MODIFIED_TIME", query = "update SLASummaryBean w set w.lastModifiedTS = :lastModifiedTS where w.jobId = :jobId"), + @NamedQuery(name = "UPDATE_SLA_SUMMARY_LAST_MODIFIED_TIME", query = "update SLASummaryBean w set w.lastModifiedTS " + + "= :lastModifiedTS where w.jobId = :jobId"), - @NamedQuery(name = "UPDATE_SLA_SUMMARY_ALL", query = "update SLASummaryBean w set w.jobId = :jobId, w.appName = :appName, w.appType = :appType, w.nominalTimeTS = :nominalTime, w.expectedStartTS = :expectedStartTime, w.expectedEndTS = :expectedEndTime, w.expectedDuration = :expectedDuration, w.jobStatus = :jobStatus, w.slaStatus = :slaStatus, w.eventStatus = :eventStatus, w.lastModifiedTS = :lastModTime, w.user = :user, w.parentId = :parentId, w.eventProcessed = :eventProcessed, w.actualDuration = :actualDuration, w.actualEndTS = :actualEndTS, w.actualStartTS = :actualStartTS where w.jobId = :jobId"), + @NamedQuery(name = "UPDATE_SLA_SUMMARY_ALL", query = "update SLASummaryBean w set w.jobId = :jobId, w.appName = :appName," + + " w.appType = :appType, w.nominalTimeTS = :nominalTime, w.expectedStartTS = :expectedStartTime, w.expectedEndTS " + + "= :expectedEndTime, w.expectedDuration = :expectedDuration, w.jobStatus = :jobStatus, w.slaStatus = :slaStatus," + + " w.eventStatus = :eventStatus, w.lastModifiedTS = :lastModTime, w.user = :user, w.parentId = :parentId," + + " w.eventProcessed = :eventProcessed, w.actualDuration = :actualDuration, w.actualEndTS = :actualEndTS," + + " w.actualStartTS = :actualStartTS where w.jobId = :jobId"), @NamedQuery(name = "GET_SLA_SUMMARY", query = "select OBJECT(w) from SLASummaryBean w where w.jobId = :id"), - @NamedQuery(name = "GET_SLA_SUMMARY_RECORDS_RESTART", query = "select OBJECT(w) from SLASummaryBean w where w.eventProcessed <= 7 AND w.lastModifiedTS >= :lastModifiedTime"), + @NamedQuery(name = "GET_SLA_SUMMARY_RECORDS_RESTART", query = "select OBJECT(w) from SLASummaryBean w where w.eventProcessed " + + "<= 7 AND w.lastModifiedTS >= :lastModifiedTime"), @NamedQuery(name = "GET_SLA_SUMMARY_EVENTPROCESSED", query = "select w.eventProcessed from SLASummaryBean w where w.jobId = :id"), http://git-wip-us.apache.org/repos/asf/oozie/blob/4f404934/core/src/main/java/org/apache/oozie/sla/listener/SLAEmailEventListener.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/sla/listener/SLAEmailEventListener.java b/core/src/main/java/org/apache/oozie/sla/listener/SLAEmailEventListener.java index d08521c..6e863df 100644 --- a/core/src/main/java/org/apache/oozie/sla/listener/SLAEmailEventListener.java +++ b/core/src/main/java/org/apache/oozie/sla/listener/SLAEmailEventListener.java @@ -84,8 +84,10 @@ public class SLAEmailEventListener extends SLAEventListener { EVENT_STATUS("SLA Status"), APP_TYPE("App Type"), APP_NAME("App Name"), USER("User"), JOBID("Job ID"), PARENT_JOBID( "Parent Job ID"), JOB_URL("Job URL"), PARENT_JOB_URL("Parent Job URL"), NOMINAL_TIME("Nominal Time"), EXPECTED_START_TIME("Expected Start Time"), ACTUAL_START_TIME("Actual Start Time"), - EXPECTED_END_TIME("Expected End Time"), ACTUAL_END_TIME("Actual End Time"), EXPECTED_DURATION("Expected Duration (in mins)"), - ACTUAL_DURATION("Actual Duration (in mins)"), NOTIFICATION_MESSAGE("Notification Message"), UPSTREAM_APPS("Upstream Apps"), + EXPECTED_END_TIME("Expected End Time"), ACTUAL_END_TIME("Actual End Time"), + EXPECTED_DURATION("Expected Duration (in mins)"), + ACTUAL_DURATION("Actual Duration (in mins)"), NOTIFICATION_MESSAGE("Notification Message"), + UPSTREAM_APPS("Upstream Apps"), JOB_STATUS("Job Status"); private String name;