patch 4.0

This commit is contained in:
wangzelin.wzl
2022-10-24 10:34:53 +08:00
parent 4ad6e00ec3
commit 93a1074b0c
10533 changed files with 2588271 additions and 2299373 deletions

View File

@ -20,42 +20,24 @@ using namespace oceanbase;
using namespace sql;
using namespace oceanbase::common;
namespace oceanbase {
namespace sql {
const char* ObLogMonitoringDump::get_name() const
namespace oceanbase
{
static const char* monitoring_name_[1] = {
"MONITORING DUMP",
namespace sql
{
const char *ObLogMonitoringDump::get_name() const
{
static const char *monitoring_name_[1] =
{
"MONITORING DUMP",
};
return monitoring_name_[0];
}
int ObLogMonitoringDump::copy_without_child(ObLogicalOperator*& out)
{
int ret = OB_SUCCESS;
ObLogicalOperator* op = NULL;
ObLogMonitoringDump* monitoring_dump = NULL;
if (OB_FAIL(clone(op))) {
SQL_OPT_LOG(WARN, "Failed to clone ObLogMonitoringDump", K(ret));
} else if (OB_ISNULL(monitoring_dump = static_cast<ObLogMonitoringDump*>(op))) {
ret = OB_ERR_UNEXPECTED;
SQL_OPT_LOG(WARN, "Failed to cast ObLogicalOperator * to ObLogMonitoringDump *", K(ret));
} else {
monitoring_dump->flags_ = flags_;
out = monitoring_dump;
}
return ret;
}
int ObLogMonitoringDump::allocate_exchange_post(AllocExchContext* ctx)
{
int ret = OB_NOT_SUPPORTED;
UNUSED(ctx);
return ret;
}
int ObLogMonitoringDump::print_my_plan_annotation(char* buf, int64_t& buf_len, int64_t& pos, ExplainType type)
int ObLogMonitoringDump::print_my_plan_annotation(char *buf,
int64_t &buf_len,
int64_t &pos,
ExplainType type)
{
int ret = OB_SUCCESS;
// print access
@ -66,86 +48,20 @@ int ObLogMonitoringDump::print_my_plan_annotation(char* buf, int64_t& buf_len, i
return ret;
}
int ObLogMonitoringDump::transmit_op_ordering()
{
int ret = OB_NOT_SUPPORTED;
LOG_WARN("Monitoring dump never got there", K(ret));
return ret;
}
int ObLogMonitoringDump::re_est_cost(const ObLogicalOperator* parent, double need_row_count, bool& re_est)
{
int ret = OB_NOT_SUPPORTED;
UNUSED(parent);
UNUSED(need_row_count);
UNUSED(re_est);
LOG_WARN("Monitoring dump never got there", K(ret));
return ret;
}
int ObLogMonitoringDump::compute_op_ordering()
int ObLogMonitoringDump::est_cost()
{
int ret = OB_SUCCESS;
ObLogicalOperator* child = NULL;
ObLogicalOperator *child = NULL;
if (OB_ISNULL(child = get_child(first_child))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("Child is null", K(ret));
} else if (OB_FAIL(set_op_ordering(child->get_op_ordering()))) {
LOG_WARN("Failed to set op ordering", K(ret));
LOG_WARN("get unexpected null", K(child), K(ret));
} else {
set_op_cost(0.0);
set_cost(op_cost_ + child->get_cost());
set_card(child->get_card());
}
return ret;
}
int ObLogMonitoringDump::print_outline(planText& plan_text)
{
int ret = OB_SUCCESS;
if (is_added_outline_) { // do nothing.
} else if (OB_FAIL(print_tracing(plan_text))) {
LOG_WARN("fail to print tracing", K(ret));
}
return ret;
}
int ObLogMonitoringDump::print_tracing(planText& plan_text)
{
int ret = OB_SUCCESS;
bool is_oneline = plan_text.is_oneline_;
char* buf = plan_text.buf;
int64_t& buf_len = plan_text.buf_len;
int64_t& pos = plan_text.pos;
if (flags_ & OB_MONITOR_TRACING) {
if (OB_FAIL(BUF_PRINTF("\n"))) {
} else if (OB_FAIL(BUF_PRINTF(ObStmtHint::get_outline_indent(is_oneline)))) {
LOG_WARN("failed to do BUF PRINF", K(ret));
} else if (OB_FAIL(BUF_PRINTF(ObStmtHint::TRACING_HINT))) {
LOG_WARN("failed to do BUF PRINF", K(ret));
} else if (OB_FAIL(BUF_PRINTF("("))) {
LOG_WARN("failed to do BUF PRINF", K(ret));
} else if (OB_FAIL(BUF_PRINTF("%lu", dst_op_line_id_))) {
LOG_WARN("failed to do BUF PRINF", K(ret));
} else if (OB_FAIL(BUF_PRINTF(")"))) {
LOG_WARN("failed to do BUF PRINF", K(ret));
} else {
}
}
if (OB_SUCC(ret) && (flags_ & OB_MONITOR_STAT)) {
if (OB_FAIL(BUF_PRINTF("\n"))) {
LOG_WARN("failed to do BUF PRINF", K(ret));
} else if (OB_FAIL(BUF_PRINTF(ObStmtHint::get_outline_indent(is_oneline)))) {
LOG_WARN("failed to do BUF PRINF", K(ret));
} else if (OB_FAIL(BUF_PRINTF(ObStmtHint::STAT_HINT))) {
LOG_WARN("failed to do BUF PRINF", K(ret));
} else if (OB_FAIL(BUF_PRINTF("("))) {
LOG_WARN("failed to do BUF PRINF", K(ret));
} else if (OB_FAIL(BUF_PRINTF("%lu", dst_op_line_id_))) {
LOG_WARN("failed to do BUF PRINF", K(ret));
} else if (OB_FAIL(BUF_PRINTF(")"))) {
LOG_WARN("failed to do BUF PRINF", K(ret));
} else {
}
}
return ret;
}
} // namespace sql
} // namespace oceanbase