Skip to content

Commit

Permalink
set job default status as submitted until get some result (vesoft-inc…
Browse files Browse the repository at this point in the history
…#4663)

Co-authored-by: Sophie <[email protected]>
  • Loading branch information
SuperYoko and Sophie-Xie authored Sep 28, 2022
1 parent 200339b commit 03d55db
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/common/graph/Response.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@
X(E_TASK_REPORT_OUT_DATE, -2049) \
X(E_JOB_NOT_IN_SPACE, -2050) \
X(E_JOB_NEED_RECOVER, -2051) \
X(E_JOB_NOT_STOPPABLE, -2052) \
X(E_JOB_SUBMITTED, -2053) \
X(E_INVALID_JOB, -2065) \
\
/* Backup Failure */ \
Expand Down
4 changes: 2 additions & 2 deletions src/graph/executor/admin/SubmitJobExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ nebula::DataSet SubmitJobExecutor::buildShowResultData(
apache::thrift::util::enumNameSafe(tsk.get_result()),
convertJobTimestampToDateTime(std::move(tsk).get_start_time()),
convertJobTimestampToDateTime(std::move(tsk).get_stop_time()),
jd.get_code() == nebula::cpp2::ErrorCode::E_UNKNOWN
jd.get_code() == nebula::cpp2::ErrorCode::E_JOB_SUBMITTED
? ""
: apache::thrift::util::enumNameSafe(jd.get_code())}));
}
Expand Down Expand Up @@ -197,7 +197,7 @@ nebula::DataSet SubmitJobExecutor::buildShowResultData(
apache::thrift::util::enumNameSafe(taskDesc.get_status()),
convertJobTimestampToDateTime(taskDesc.get_start_time()),
convertJobTimestampToDateTime(taskDesc.get_stop_time()),
jd.get_code() == nebula::cpp2::ErrorCode::E_UNKNOWN
jd.get_code() == nebula::cpp2::ErrorCode::E_JOB_SUBMITTED
? ""
: apache::thrift::util::enumNameSafe(jd.get_code()),
}));
Expand Down
1 change: 1 addition & 0 deletions src/interface/common.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ enum ErrorCode {
E_JOB_NOT_IN_SPACE = -2050, // The current task is not in the graph space
E_JOB_NEED_RECOVER = -2051, // The current task needs to be resumed
E_JOB_NOT_STOPPABLE = -2052, // Failed or finished job could not be stopped
E_JOB_SUBMITTED = -2053, // Job default status.
E_INVALID_JOB = -2065, // Invalid task

// Backup Failure
Expand Down
4 changes: 2 additions & 2 deletions src/meta/processors/job/JobDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class JobDescription {
Status status = Status::QUEUE,
int64_t startTime = 0,
int64_t stopTime = 0,
nebula::cpp2::ErrorCode errCode = nebula::cpp2::ErrorCode::E_UNKNOWN);
nebula::cpp2::ErrorCode errCode = nebula::cpp2::ErrorCode::E_JOB_SUBMITTED);

/**
* @brief Return the JobDescription if both key & val is valid
Expand Down Expand Up @@ -179,7 +179,7 @@ class JobDescription {
Status status_;
int64_t startTime_;
int64_t stopTime_;
nebula::cpp2::ErrorCode errCode_{nebula::cpp2::ErrorCode::E_UNKNOWN};
nebula::cpp2::ErrorCode errCode_{nebula::cpp2::ErrorCode::E_JOB_SUBMITTED};
};

} // namespace meta
Expand Down
2 changes: 1 addition & 1 deletion src/meta/processors/job/TaskDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class TaskDescription {
cpp2::JobStatus status_;
int64_t startTime_;
int64_t stopTime_;
nebula::cpp2::ErrorCode errCode_{nebula::cpp2::ErrorCode::E_UNKNOWN};
nebula::cpp2::ErrorCode errCode_{nebula::cpp2::ErrorCode::E_JOB_SUBMITTED};
};

} // namespace meta
Expand Down

0 comments on commit 03d55db

Please sign in to comment.