From f7d42ae1adbfaa608e6147d3b86510a625b21464 Mon Sep 17 00:00:00 2001 From: Alex Xing <90179377+SuperYoko@users.noreply.github.com> Date: Thu, 13 Oct 2022 13:50:10 +0800 Subject: [PATCH] fix job status when all finished (#4717) * fix job name from zone balance to data balance * address wenhui's comment --- src/graph/executor/admin/SubmitJobExecutor.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/graph/executor/admin/SubmitJobExecutor.cpp b/src/graph/executor/admin/SubmitJobExecutor.cpp index 839d918ef4a..16b507d3bcc 100644 --- a/src/graph/executor/admin/SubmitJobExecutor.cpp +++ b/src/graph/executor/admin/SubmitJobExecutor.cpp @@ -79,9 +79,14 @@ StatusOr SubmitJobExecutor::buildResult(meta::cpp2::JobOp jobOp, } const auto &jobsDesc = *resp.job_desc_ref(); for (const auto &jobDesc : jobsDesc) { + // show zone balance as data balance + auto type = jobDesc.get_type(); + if (type == meta::cpp2::JobType::ZONE_BALANCE) { + type = meta::cpp2::JobType::DATA_BALANCE; + } v.emplace_back(nebula::Row({ jobDesc.get_job_id(), - apache::thrift::util::enumNameSafe(jobDesc.get_type()), + apache::thrift::util::enumNameSafe(type), apache::thrift::util::enumNameSafe(jobDesc.get_status()), convertJobTimestampToDateTime(jobDesc.get_start_time()), convertJobTimestampToDateTime(jobDesc.get_stop_time()), @@ -124,7 +129,7 @@ nebula::DataSet SubmitJobExecutor::buildShowResultData( uint32_t total = paras.size() - index - 1, succeeded = 0, failed = 0, inProgress = 0, invalid = 0; v.emplace_back(Row({jd.get_job_id(), - apache::thrift::util::enumNameSafe(meta::cpp2::JobType::ZONE_BALANCE), + apache::thrift::util::enumNameSafe(meta::cpp2::JobType::DATA_BALANCE), apache::thrift::util::enumNameSafe(jd.get_status()), convertJobTimestampToDateTime(jd.get_start_time()).toString(), convertJobTimestampToDateTime(jd.get_stop_time()).toString(),