reduce memory of mod WokerMap

This commit is contained in:
sdc
2023-08-28 06:10:49 +00:00
committed by ob-robot
parent a54dafc522
commit aad707d31c
5 changed files with 17 additions and 15 deletions

View File

@ -1115,8 +1115,7 @@ int ObPhysicalPlan::set_expected_worker_map(const common::hash::ObHashMap<ObAddr
}
return ret;
}
const common::hash::ObHashMap<ObAddr, int64_t>& ObPhysicalPlan:: get_expected_worker_map() const
const ObPlanStat::AddrMap& ObPhysicalPlan:: get_expected_worker_map() const
{
return stat_.expected_worker_map_;
}
@ -1130,12 +1129,7 @@ int ObPhysicalPlan::set_minimal_worker_map(const common::hash::ObHashMap<ObAddr,
return ret;
}
const common::hash::ObHashMap<ObAddr, int64_t>& ObPhysicalPlan::get_minimal_worker_map() const
{
return stat_.minimal_worker_map_;
}
int ObPhysicalPlan::assign_worker_map(common::hash::ObHashMap<ObAddr, int64_t> &worker_map, const common::hash::ObHashMap<ObAddr, int64_t> &c)
int ObPhysicalPlan::assign_worker_map(ObPlanStat::AddrMap &worker_map, const common::hash::ObHashMap<ObAddr, int64_t> &c)
{
int ret = OB_SUCCESS;
ObMemAttr attr(MTL_ID(), "WorkerMap");

View File

@ -180,10 +180,10 @@ public:
void set_minimal_worker_count(int64_t c) { stat_.minimal_worker_count_ = c; }
int64_t get_minimal_worker_count() const { return stat_.minimal_worker_count_; }
int set_expected_worker_map(const common::hash::ObHashMap<ObAddr, int64_t> &c);
const common::hash::ObHashMap<ObAddr, int64_t>& get_expected_worker_map() const;
const ObPlanStat::AddrMap& get_expected_worker_map() const;
int set_minimal_worker_map(const common::hash::ObHashMap<ObAddr, int64_t> &c);
const common::hash::ObHashMap<ObAddr, int64_t>& get_minimal_worker_map() const;
int assign_worker_map(common::hash::ObHashMap<ObAddr, int64_t> &worker_map,
const common::hash::ObHashMap<ObAddr, int64_t>& get_minimal_worker_map() const;
int assign_worker_map(ObPlanStat::AddrMap &worker_map,
const common::hash::ObHashMap<ObAddr, int64_t> &c);
const char* get_sql_id() const { return stat_.sql_id_.ptr(); }
const ObString& get_sql_id_string() const { return stat_.sql_id_; }

View File

@ -115,7 +115,7 @@ int ObPxAdmission::enter_query_admission(ObSQLSessionInfo &session,
&& 1 != plan.get_px_dop()
&& plan.get_expected_worker_count() > 0) {
// use for appointment
const ObHashMap<ObAddr, int64_t> &req_px_worker_map = plan.get_expected_worker_map();
const auto &req_px_worker_map = plan.get_expected_worker_map();
ObHashMap<ObAddr, int64_t> &acl_px_worker_map = exec_ctx.get_admission_addr_map();
if (acl_px_worker_map.created()) {
acl_px_worker_map.clear();
@ -123,7 +123,7 @@ int ObPxAdmission::enter_query_admission(ObSQLSessionInfo &session,
LOG_WARN("create hash map failed", K(ret));
}
if (OB_SUCC(ret)) {
for (ObHashMap<ObAddr, int64_t>::const_iterator it = req_px_worker_map.begin();
for (auto it = req_px_worker_map.begin();
OB_SUCC(ret) && it != req_px_worker_map.end(); ++it) {
if (OB_FAIL(acl_px_worker_map.set_refactored(it->first, it->second))){
LOG_WARN("set refactored failed", K(ret), K(it->first), K(it->second));

View File

@ -43,6 +43,7 @@ public:
virtual int on_root_data_channel_setup() = 0;
};
struct ObExprExtraSerializeInfo
{
OB_UNIS_VERSION(1);