patch 4.0
This commit is contained in:
@ -16,66 +16,57 @@
|
||||
#include "lib/container/ob_se_array.h"
|
||||
#include "sql/executor/ob_job.h"
|
||||
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace sql
|
||||
{
|
||||
class ObTaskEvent;
|
||||
class ObJobControl {
|
||||
class ObJobControl
|
||||
{
|
||||
public:
|
||||
explicit ObJobControl();
|
||||
virtual ~ObJobControl();
|
||||
|
||||
static int alloc_phy_op_input(ObExecContext& ctx, ObPhyOperator* op);
|
||||
static int build_phy_op_input(ObExecContext& ctx, ObPhyOperator* op, ObJob* job = NULL);
|
||||
|
||||
void reset();
|
||||
virtual int sort_job_scan_part_locs(ObExecContext& ctx);
|
||||
virtual int init_job_finish_queue(ObExecContext& ctx);
|
||||
// int arrange_jobs();
|
||||
virtual int sort_job_scan_part_locs(ObExecContext &ctx);
|
||||
virtual int init_job_finish_queue(ObExecContext &ctx);
|
||||
// int arrange_jobs();
|
||||
/*
|
||||
* @input ob_execution_id is used to distinguish the results of different executions in IRM,
|
||||
* only Distributed mode is effective,other mode is INVALID_ID
|
||||
* @input ob_execution_id 用于在IRM中区分不同execution的结果,
|
||||
* 仅对Distributed模式有效,其余模式均为INVALID_ID
|
||||
*/
|
||||
int create_job(
|
||||
common::ObIAllocator& alloc, const ObExecutionID& ob_execution_id, uint64_t root_op_id, ObJob*& job) const;
|
||||
int find_job_by_job_id(uint64_t job_id, ObJob*& job) const;
|
||||
int find_job_by_root_op_id(uint64_t root_op_id, ObJob*& job) const;
|
||||
virtual int get_ready_jobs(common::ObIArray<ObJob*>& jobs, bool serial_sched = false) const = 0;
|
||||
virtual int get_running_jobs(common::ObIArray<ObJob*>& jobs) const;
|
||||
int get_all_jobs(common::ObIArray<ObJob*>& jobs) const;
|
||||
int get_all_jobs_except_root_job(common::ObIArray<ObJob*>& jobs) const;
|
||||
int all_jobs_finished(bool& is_finished) const;
|
||||
int all_jobs_finished_except_root_job(bool& is_finished) const;
|
||||
int create_job(common::ObIAllocator &alloc,
|
||||
const ObExecutionID &ob_execution_id,
|
||||
uint64_t root_op_id,
|
||||
ObJob *&job) const;
|
||||
int find_job_by_job_id(uint64_t job_id, ObJob *&job) const;
|
||||
int find_job_by_root_op_id(uint64_t root_op_id, ObJob *&job) const;
|
||||
virtual int get_ready_jobs(common::ObIArray<ObJob *> &jobs, bool serial_sched = false) const = 0;
|
||||
virtual int get_running_jobs(common::ObIArray<ObJob *> &jobs) const;
|
||||
int get_all_jobs(common::ObIArray<ObJob *> &jobs) const;
|
||||
int get_all_jobs_except_root_job(common::ObIArray<ObJob *> &jobs) const;
|
||||
int all_jobs_finished(bool &is_finished) const;
|
||||
int all_jobs_finished_except_root_job(bool &is_finished) const;
|
||||
// build op input of the current job
|
||||
int build_jobs_ctx(ObExecContext& ctx);
|
||||
int get_last_failed_task_infos(common::ObIArray<ObTaskInfo*>& last_failed_task_infos) const;
|
||||
int print_status(char* buf, int64_t buf_len, bool ignore_normal_state = false) const;
|
||||
int print_status(char *buf, int64_t buf_len, bool ignore_normal_state = false) const;
|
||||
|
||||
inline int add_job(ObJob* job)
|
||||
{
|
||||
return jobs_.push_back(job);
|
||||
}
|
||||
inline int64_t get_job_count() const
|
||||
{
|
||||
return jobs_.count();
|
||||
}
|
||||
inline int add_job(ObJob *job) { return jobs_.push_back(job); }
|
||||
inline int64_t get_job_count() const { return jobs_.count(); }
|
||||
|
||||
DECLARE_TO_STRING;
|
||||
|
||||
private:
|
||||
int build_job_ctx(ObExecContext& ctx, ObJob& job);
|
||||
int build_job_op_input(ObExecContext& ctx, ObJob& job);
|
||||
// int jobs_quick_sort(common::ObIArray<ObJob *> &jobs,
|
||||
// int64_t low,
|
||||
// int64_t high);
|
||||
void print_job_tree(char* buf, const int64_t buf_len, int64_t& pos, ObJob* job) const;
|
||||
|
||||
int build_job_ctx(ObExecContext &ctx, ObJob &job);
|
||||
int build_job_op_input(ObExecContext &ctx, ObJob &job);
|
||||
// int jobs_quick_sort(common::ObIArray<ObJob *> &jobs,
|
||||
// int64_t low,
|
||||
// int64_t high);
|
||||
void print_job_tree(char *buf, const int64_t buf_len, int64_t &pos, ObJob *job) const;
|
||||
protected:
|
||||
common::ObSEArray<ObJob*, 2> jobs_; // remote plan has two jobs
|
||||
common::ObSEArray<ObJob *, 2> jobs_; // remote plan has two jobs
|
||||
private:
|
||||
mutable uint64_t local_job_id_;
|
||||
static volatile uint64_t global_job_id_;
|
||||
DISALLOW_COPY_AND_ASSIGN(ObJobControl);
|
||||
};
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
}
|
||||
}
|
||||
#endif /* OCEANBASE_SQL_EXECUTOR_OB_JOB_CONTROL_ */
|
||||
|
||||
Reference in New Issue
Block a user