[FEAT MERGE]query_interface_enhancement
This commit is contained in:
@ -1058,5 +1058,44 @@ int ObFLTControlInfoManager::find_appropriate_con_info(sql::ObSQLSessionInfo &se
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObFLTControlInfoManager::get_all_flt_config(common::ObIArray<ObFLTConfRec> &rec_list, ObIAllocator &alloc) {
|
||||
int ret = OB_SUCCESS;
|
||||
// teannt_level
|
||||
ObFLTConfRec rec;
|
||||
rec.tenant_id_ = tenant_id_;
|
||||
rec.type_ = FLT_TENANT_TYPE;
|
||||
rec.control_info_ = tenant_info_;
|
||||
if (OB_FAIL(rec_list.push_back(rec))) {
|
||||
LOG_WARN("failed to push back flt config rec", K(ret));
|
||||
}
|
||||
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < mod_infos_.count(); i++) {
|
||||
ObFLTConfRec rec;
|
||||
rec.tenant_id_ = tenant_id_;
|
||||
rec.type_ = FLT_MOD_ACT_TYPE;
|
||||
rec.control_info_ = mod_infos_.at(i).control_info_;
|
||||
if (OB_FAIL(ob_write_string(alloc, mod_infos_.at(i).mod_name_, rec.mod_name_))) {
|
||||
LOG_WARN("failed to write string", K(mod_infos_.at(i).mod_name_), K(ret));
|
||||
} else if (OB_FAIL(ob_write_string(alloc, mod_infos_.at(i).act_name_, rec.act_name_))) {
|
||||
LOG_WARN("failed to write string", K(mod_infos_.at(i).act_name_), K(ret));
|
||||
} else if (OB_FAIL(rec_list.push_back(rec))) {
|
||||
LOG_WARN("failed to push back flt config rec", K(ret));
|
||||
}
|
||||
}
|
||||
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < identifier_infos_.count(); i++) {
|
||||
ObFLTConfRec rec;
|
||||
rec.tenant_id_ = tenant_id_;
|
||||
rec.type_ = FLT_CLIENT_ID_TYPE;
|
||||
rec.control_info_ = identifier_infos_.at(i).control_info_;
|
||||
if (OB_FAIL(ob_write_string(alloc, identifier_infos_.at(i).identifier_name_, rec.identifier_name_))) {
|
||||
LOG_WARN("failed to write string", K(mod_infos_.at(i).mod_name_), K(ret));
|
||||
} else if (OB_FAIL(rec_list.push_back(rec))) {
|
||||
LOG_WARN("failed to push back flt config rec", K(ret));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
|
||||
@ -65,7 +65,34 @@ namespace sql
|
||||
FLTControlInfo control_info_;
|
||||
TO_STRING_KV(K_(mod_name), K_(act_name), K_(control_info));
|
||||
};
|
||||
|
||||
enum ObFLTConfigType {
|
||||
FLT_INVALID_TYPE = 0,
|
||||
FLT_TENANT_TYPE = 1,
|
||||
FLT_MOD_ACT_TYPE = 2,
|
||||
FLT_CLIENT_ID_TYPE = 3
|
||||
};
|
||||
|
||||
class ObFLTConfRec {
|
||||
public:
|
||||
ObFLTConfRec():
|
||||
tenant_id_(OB_INVALID_ID),
|
||||
type_(FLT_INVALID_TYPE),
|
||||
mod_name_(),
|
||||
act_name_(),
|
||||
control_info_() {}
|
||||
public:
|
||||
uint64_t tenant_id_;
|
||||
ObFLTConfigType type_;
|
||||
ObString mod_name_;
|
||||
ObString act_name_;
|
||||
ObString identifier_name_;
|
||||
FLTControlInfo control_info_;
|
||||
|
||||
TO_STRING_KV(K_(tenant_id), K_(type), K_(mod_name), K_(act_name), K_(identifier_name), K_(control_info));
|
||||
};
|
||||
|
||||
|
||||
class ObFLTControlInfoManager {
|
||||
public:
|
||||
ObFLTControlInfoManager(uint64_t t_id) :
|
||||
@ -96,6 +123,7 @@ namespace sql
|
||||
int get_mod_act_con_info(common::ObString mod, common::ObString act, FLTControlInfo &coninfo);
|
||||
int get_client_id_con_info(common::ObString client_id, FLTControlInfo &coninfo);
|
||||
int find_appropriate_con_info(sql::ObSQLSessionInfo &sess);
|
||||
int get_all_flt_config(common::ObIArray<ObFLTConfRec> &rec_list, ObIAllocator &allocator);
|
||||
|
||||
bool is_valid_tenant_config() {
|
||||
return tenant_info_.is_valid();
|
||||
|
||||
@ -403,6 +403,7 @@ struct ObAuditRecordData {
|
||||
uint64_t txn_free_route_version_; // the version of txn's state
|
||||
bool partition_hit_;// flag for need das partition route or not
|
||||
bool is_perf_event_closed_;
|
||||
char flt_trace_id_[OB_MAX_UUID_STR_LENGTH + 1];
|
||||
};
|
||||
|
||||
} //namespace sql
|
||||
|
||||
Reference in New Issue
Block a user