Commit 14ea42e7 authored by Daniel Eggert's avatar Daniel Eggert
Browse files

analysis stats alterations

parent 52893e0a
......@@ -1280,6 +1280,24 @@ public class SceneDatabase {
updateJobStatus(job.id, job.status);
}
public synchronized void updateJobFeedback(ProcessingJob job) {
try {
PreparedStatement pst = con.prepareStatement("update jobs set feedback=? where id=?;");
if (job.feedback == null) {
pst.setNull(1, Types.VARCHAR);
} else {
pst.setString(1, job.feedback);
}
pst.setLong(2, job.id);
pst.executeUpdate();
commit();
} catch (SQLException e) {
e.printStackTrace();
}
}
public synchronized void updateJobProgress(long jobid, int progress) {
try {
PreparedStatement pst = con.prepareStatement(SqlStatements.UPDATE_JOB_PROGRESS_QUERY);
......@@ -1340,14 +1358,14 @@ public class SceneDatabase {
}
/**
* Updates the download stats for the job with the given jobid<br>
* Updates the statistics array for the job with the given jobid<br>
*
* @param jobid
* @param idx
*/
public synchronized void updateJobDownloadStat(long jobid, Integer[] stats) {
public synchronized void updateJobStatistics(long jobid, Integer[] stats) {
try {
PreparedStatement pst = con.prepareStatement(SqlStatements.UPDATE_JOB_DOWNLOAD_STATS);
PreparedStatement pst = con.prepareStatement(SqlStatements.UPDATE_JOB_STATS);
pst.setArray(1, con.createArrayOf("integer", stats));
pst.setLong(2, jobid);
......
......@@ -66,7 +66,7 @@ public interface SqlStatements {
public static final String UPDATE_JOB_COMMENT_QUERY = "UPDATE jobs SET comment=? WHERE id=?;";
public static final String UPDATE_JOB_PROGRESS_QUERY = "UPDATE jobs SET progress=? WHERE id=?;";
public static final String UPDATE_INC_JOB_DOWNLOAD_STATS = "UPDATE jobs SET statistics[?] = statistics[?]+1 WHERE id=? AND statistics is not NULL RETURNING statistics;";
public static final String UPDATE_JOB_DOWNLOAD_STATS = "UPDATE jobs SET statistics = ? WHERE id=?;";
public static final String UPDATE_JOB_STATS = "UPDATE jobs SET statistics = ? WHERE id=?;";
public static final String UPDATE_FINISHED_JOB_QUERY = "UPDATE jobs SET finishtime=CURRENT_TIMESTAMP, status=?::job_status, comment=?, statistics=?, failed_sceneids=? WHERE id=? RETURNING finishtime;";
public static final String JOB_COMMENT_QUERY = "SELECT comment FROM jobs WHERE id=?;";
......
......@@ -65,9 +65,24 @@ public class ProcessingJob {
public String analysisParameter;
/**
* download job statistics:<br>
* [0] total number of scenes to download<br>
* [1] number of scenes successfully downloaded<br>
* [2] number of scenes failed to download
* [2] number of scenes failed to download<br>
* <br>
* TODO: processing statistics<br>
* <br>
*
* analysis job statistics:<br>
* for each operation <i>o</i>:
* [o*8 + 0] number of just CREATED tasks<br>
* [o*8 + 1] number of SCHEDULED tasks<br>
* [o*8 + 2] number of DEPLOYED tasks<br>
* [o*8 + 3] number of RUNNING tasks<br>
* [o*8 + 4] number of FINISHED tasks<br>
* [o*8 + 5] number of CANCELING tasks<br>
* [o*8 + 6] number of CANCELED tasks<br>
* [o*8 + 7] number of FAILED tasks<br>
*/
public int[] statistics;
public job_mode mode;
......@@ -415,6 +430,10 @@ public class ProcessingJob {
return subJobs;
}
public String deriveFlinkJobName() {
return "gmsJobId" + Long.toString(id);
}
@Override
public String toString() {
return "[" + id + "] creationtime(" + creationtime + "), finishtime(" + finishtime + "),\n" + "sceneids(" + (sceneids != null ? Arrays.toString(sceneids) : "null") + "),\n"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment