@Override public PreparedStatement createUpdateStatement(Connection conn) throws SQLException { PreparedStatement updateStatement = conn.prepareStatement("UPDATE jobs SET job=?, status=? WHERE job_num=? AND cluster_id=?"); updateStatement.setBytes(1, jobBytes); updateStatement.setString(2, clusterJob.getJobStatus().name()); updateStatement.setLong(3, jobId.getJobNum()); updateStatement.setLong(4, clusterId); return updateStatement; }
@Override public PreparedStatement createInsertStatement(Connection conn) throws SQLException { PreparedStatement statement = conn.prepareStatement( "INSERT INTO jobs (job_num, cluster_id, status, create_time, job) VALUES (?, ?, ?, ?, ?)"); statement.setLong(1, jobId.getJobNum()); statement.setLong(2, clusterId); statement.setString(3, clusterJob.getJobStatus().name()); statement.setTimestamp(4, DBHelper.getTimestamp(System.currentTimeMillis())); statement.setBytes(5, jobBytes); return statement; } }
public ClusterJobProgress(ClusterJob job) { this.action = job.getClusterAction(); this.actionstatus = job.getJobStatus(); this.stepstotal = job.getTaskStatus().size(); int completedTasks = 0; for (ClusterTask.Status taskStatus : job.getTaskStatus().values()) { if (taskStatus == ClusterTask.Status.COMPLETE) { completedTasks++; } } this.stepscompleted = completedTasks; }
public ClusterStatusResponse(Cluster cluster, ClusterJob job) { this.clusterid = cluster.getId(); this.status = cluster.getStatus(); this.actionstatus = job.getJobStatus(); this.action = job.getClusterAction(); Map<String, ClusterTask.Status> taskStatus = job.getTaskStatus(); int completedTasks = 0; for (Map.Entry<String, ClusterTask.Status> entry : taskStatus.entrySet()) { if (entry.getValue().equals(ClusterTask.Status.COMPLETE)) { completedTasks++; } } this.stepscompleted = completedTasks; this.stepstotal = taskStatus.size(); }
if (clusterJob.getJobStatus() == ClusterJob.Status.COMPLETE || clusterJob.getJobStatus() == ClusterJob.Status.FAILED) { return;
Cluster.Status clusterStatus = solverJob.getJobStatus() == ClusterJob.Status.COMPLETE ? Cluster.Status.INCONSISTENT : Cluster.Status.ACTIVE; taskService.failJobAndSetClusterStatus(toFailJob, cluster, clusterStatus,
if (clusterJob.getJobStatus() == ClusterJob.Status.FAILED || clusterJob.getJobStatus() == ClusterJob.Status.COMPLETE) { clusterJob.getJobStatus() == ClusterJob.Status.RUNNING)) { throw new IllegalStateException("Cannot be aborted at this time."); if (clusterJob.getJobStatus() == ClusterJob.Status.COMPLETE || clusterJob.getJobStatus() == ClusterJob.Status.FAILED) { return;
if (clusterJob.getJobStatus() != ClusterJob.Status.PAUSED) { return;
continue; if (job.getJobStatus() == ClusterJob.Status.PAUSED) { continue; boolean jobFailed = job.getJobStatus() == ClusterJob.Status.FAILED; int completedTasks = 0; int inProgressTasks = 0;
ClusterJob clusterJob = clusterStore.getClusterJob(JobId.fromString(jobId)); if (clusterJob == null || clusterJob.getJobStatus() == ClusterJob.Status.FAILED) {