Commit a7774e02 authored by Steffen Lackner's avatar Steffen Lackner
Browse files

[code] send additional status information to the scheduler

parent 6f5d650a
......@@ -157,6 +157,8 @@ void JsonProtocolWriter::append_job_submitted(const string & job_id,
void JsonProtocolWriter::append_job_completed(const string & job_id,
const string & job_status,
const string & job_state,
const string & kill_reason,
double date)
{
/* {
......@@ -174,6 +176,8 @@ void JsonProtocolWriter::append_job_completed(const string & job_id,
Value data(rapidjson::kObjectType);
data.AddMember("job_id", Value().SetString(job_id.c_str(), _alloc), _alloc);
data.AddMember("status", Value().SetString(job_status.c_str(), _alloc), _alloc);
data.AddMember("job_state", Value().SetString(job_state.c_str(), _alloc), _alloc);
data.AddMember("kill_reason", Value().SetString(kill_reason.c_str(), _alloc), _alloc);
Value event(rapidjson::kObjectType);
event.AddMember("timestamp", Value().SetDouble(date), _alloc);
......
......@@ -106,6 +106,8 @@ public:
*/
virtual void append_job_completed(const std::string & job_id,
const std::string & job_status,
const std::string & job_state,
const std::string & kill_reason,
double date) = 0;
/**
......@@ -222,6 +224,8 @@ public:
*/
void append_job_completed(const std::string & job_id,
const std::string & job_status,
const std::string & job_state,
const std::string & kill_reason,
double date);
/**
......
......@@ -212,8 +212,31 @@ void server_on_job_completed(ServerData * data,
status = "TIMEOUT";
}
string job_state;
switch (job->state) {
case JobState::JOB_STATE_NOT_SUBMITTED:
job_state = "NOT_SUBMITTED";
break;
case JobState::JOB_STATE_SUBMITTED:
job_state = "SUBMITTED";
break;
case JobState::JOB_STATE_RUNNING:
job_state = "RUNNING";
break;
case JobState::JOB_STATE_COMPLETED_SUCCESSFULLY:
job_state = "COMPLETED_SUCCESSFULLY";
break;
case JobState::JOB_STATE_COMPLETED_KILLED:
job_state = "COMPLETED_KILLED";
break;
case JobState::JOB_STATE_REJECTED:
job_state = "REJECTED";
break;
}
data->context->proto_writer->append_job_completed(message->job_id.to_string(),
status, MSG_get_clock());
status, job_state, job->kill_reason,
MSG_get_clock());
check_submitted_and_completed(data);
}
......
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