Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set job default status as submitted until get some result #4663

Merged
merged 2 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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