[FEAT MERGE]support ddl real time monitoring

This commit is contained in:
Charles0429
2022-12-30 13:18:48 +00:00
committed by ob-robot
parent 5535b96376
commit 2c8c28887f
57 changed files with 1950 additions and 549 deletions

View File

@ -13,6 +13,8 @@
#define USING_LOG_PREFIX SQL_ENG
#include "ob_subplan_scan_op.h"
#include "sql/engine/ob_physical_plan.h"
#include "sql/engine/ob_exec_context.h"
namespace oceanbase
{
@ -43,6 +45,8 @@ int ObSubPlanScanOp::inner_open()
} else if (OB_UNLIKELY(MY_SPEC.projector_.count() % 2 != 0)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("projector array size should be multiples of 2", K(ret));
} else if (OB_FAIL(init_monitor_info())) {
LOG_WARN("init monitor info failed", K(ret));
}
return ret;
}
@ -133,5 +137,25 @@ int ObSubPlanScanOp::inner_get_next_batch(const int64_t max_row_cnt)
return ret;
}
int ObSubPlanScanOp::init_monitor_info()
{
int ret = OB_SUCCESS;
if (spec_.plan_->get_phy_plan_hint().monitor_) {
ObPhysicalPlanCtx *plan_ctx = NULL;
const ObPhysicalPlan *phy_plan = nullptr;
if (OB_ISNULL(plan_ctx = GET_PHY_PLAN_CTX(ctx_))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("deserialized exec ctx without phy plan ctx set. Unexpected", K(ret));
} else if (OB_ISNULL(phy_plan = plan_ctx->get_phy_plan())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("error unexpected, phy plan must not be nullptr", K(ret));
} else if (phy_plan->get_ddl_task_id() > 0) {
op_monitor_info_.otherstat_5_id_ = ObSqlMonitorStatIds::DDL_TASK_ID;
op_monitor_info_.otherstat_5_value_ = phy_plan->get_ddl_task_id();
}
}
return ret;
}
} // end namespace sql
} // end namespace oceanbase

View File

@ -46,6 +46,8 @@ public:
virtual int inner_get_next_batch(const int64_t max_row_cnt) override;
virtual void destroy() override { ObOperator::destroy(); }
private:
int init_monitor_info();
};
} // end namespace sql