[FEAT MERGE] system resource optimization

Co-authored-by: tushicheng <18829573815@163.com>
Co-authored-by: HaHaJeff <jeffzhouhhh@gmail.com>
Co-authored-by: dimstars <liangjinrongcm@gmail.com>
This commit is contained in:
obdev
2023-08-29 10:41:01 +00:00
committed by ob-robot
parent 7678a4a676
commit 81b8923b14
191 changed files with 2817 additions and 2464 deletions

View File

@ -15,7 +15,7 @@
#include "sql/engine/expr/ob_expr_priv_st_asewkb.h"
#include "lib/geo/ob_geo_utils.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
using namespace oceanbase::common;
using namespace oceanbase::sql;

View File

@ -15,7 +15,7 @@
#include "sql/engine/expr/ob_expr_priv_st_geogfromtext.h"
#include "lib/geo/ob_geo_common.h"
#include "lib/geo/ob_wkt_parser.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"
#include "lib/geo/ob_geo_reverse_coordinate_visitor.h"
#include "lib/geo/ob_geo_func_common.h"
@ -106,7 +106,7 @@ int ObExprPrivSTGeogFromText::eval_priv_st_geogfromtext_common(const ObExpr &exp
}
if (OB_FAIL(ret)) {
} else if (OB_FAIL(OTSRS_MGR.get_tenant_srs_guard(session->get_effective_tenant_id(), srs_guard))) {
} else if (OB_FAIL(OTSRS_MGR->get_tenant_srs_guard(srs_guard))) {
LOG_WARN("failed to get srs guard", K(ret));
} else if (OB_FAIL(srs_guard.get_srs_item(srid, srs_item))) {
LOG_WARN("failed to get srs item", K(ret));

View File

@ -13,7 +13,7 @@
#define USING_LOG_PREFIX SQL_ENG
#include "sql/engine/expr/ob_expr_priv_st_point.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/session/ob_sql_session_info.h"
#include "share/object/ob_obj_cast_util.h"
#include "lib/geo/ob_geo_func_common.h"
@ -180,7 +180,7 @@ int ObExprPrivSTPoint::eval_priv_st_point(const ObExpr &expr,
LOG_USER_ERROR(OB_OPERATE_OVERFLOW, "SRID", N_PRIV_ST_POINT);
LOG_WARN("srid input value out of range", K(ret), K(datum_srid->get_int()));
} else if (0 != (srid = datum_srid->get_uint32())) {
if (OB_FAIL(OTSRS_MGR.get_tenant_srs_guard(MTL_ID(), srs_guard))) {
if (OB_FAIL(OTSRS_MGR->get_tenant_srs_guard(srs_guard))) {
LOG_WARN("fail to get srs guard", K(ret));
} else if (OB_FAIL(srs_guard.get_srs_item(srid, srs_item))) {
LOG_WARN("fail to get srs item", K(ret));

View File

@ -17,7 +17,7 @@
#include "lib/geo/ob_geo_func_common.h"
#include "lib/geo/ob_geo_utils.h"
#include "lib/geo/ob_geo.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"
#include "sql/session/ob_sql_session_info.h"
#include "share/object/ob_obj_cast_util.h"

View File

@ -15,7 +15,7 @@
#include "lib/geo/ob_geo_func_register.h"
#include "ob_expr_priv_st_transform.h"
#include "lib/geo/ob_srs_info.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "lib/geo/ob_geo_normalize_visitor.h"
#include "lib/geo/ob_geo_wkb_size_visitor.h"
#include "lib/geo/ob_geo_wkb_visitor.h"
@ -115,7 +115,7 @@ int ObExprPrivSTTransform::eval_priv_st_transform(const ObExpr &expr, ObEvalCtx
ret = OB_ERR_GIS_INVALID_DATA;
LOG_USER_ERROR(OB_ERR_GIS_INVALID_DATA, N_PRIV_ST_TRANSFORM);
LOG_WARN("get srid from wkb failed", K(wkb), K(ret));
} else if (OB_FAIL(OTSRS_MGR.get_tenant_srs_guard(session->get_effective_tenant_id(), srs_guard))) {
} else if (OB_FAIL(OTSRS_MGR->get_tenant_srs_guard(srs_guard))) {
LOG_WARN("get tenant srs guard failed", K(session->get_effective_tenant_id()), K(src_srid), K(ret));
} else if (src_srid != 0 && OB_FAIL(srs_guard.get_srs_item(src_srid, src_srs_item))) {
LOG_WARN("failed to get srs item", K(ret), K(src_srid));

View File

@ -15,7 +15,7 @@
#include "sql/engine/expr/ob_expr_spatial_cellid.h"
#include "lib/geo/ob_geo_utils.h"
#include "lib/geo/ob_s2adapter.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
using namespace oceanbase::common;
using namespace oceanbase::sql;

View File

@ -15,7 +15,7 @@
#include "sql/engine/expr/ob_expr_spatial_mbr.h"
#include "lib/geo/ob_geo_utils.h"
#include "lib/geo/ob_s2adapter.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
using namespace oceanbase::common;
using namespace oceanbase::sql;

View File

@ -18,7 +18,7 @@
#include "lib/geo/ob_geo_utils.h"
#include "sql/session/ob_sql_session_info.h"
#include "sql/engine/ob_exec_context.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"
using namespace oceanbase::common;

View File

@ -13,7 +13,7 @@
#define USING_LOG_PREFIX SQL_ENG
#include "sql/engine/expr/ob_expr_st_asewkt.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"
#include "lib/geo/ob_geo_utils.h"
#include "lib/geo/ob_geo_reverse_coordinate_visitor.h"

View File

@ -13,7 +13,7 @@
#define USING_LOG_PREFIX SQL_ENG
#include "sql/engine/expr/ob_expr_st_astext.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"
#include "lib/geo/ob_geo_utils.h"
#include "lib/geo/ob_geo_reverse_coordinate_visitor.h"

View File

@ -17,7 +17,7 @@
#include "lib/geo/ob_geo_ibin.h"
#include "sql/session/ob_sql_session_info.h"
#include "sql/engine/ob_exec_context.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "ob_expr_st_bestsrid.h"
#include "lib/geo/ob_geo_utils.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"

View File

@ -15,7 +15,7 @@
#define OCEANBASE_SQL_OB_EXPR_ST_BUFFER
#include "sql/engine/expr/ob_expr_operator.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"
namespace oceanbase

View File

@ -17,7 +17,7 @@
#include "lib/geo/ob_geo_ibin.h"
#include "sql/session/ob_sql_session_info.h"
#include "sql/engine/ob_exec_context.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "ob_expr_st_contains.h"
#include "lib/geo/ob_geo_utils.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"

View File

@ -17,7 +17,7 @@
#include "lib/geo/ob_geo_ibin.h"
#include "sql/session/ob_sql_session_info.h"
#include "sql/engine/ob_exec_context.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "ob_expr_st_covers.h"
#include "lib/geo/ob_geo_utils.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"

View File

@ -17,7 +17,7 @@
#include "lib/geo/ob_geo_func_register.h"
#include "lib/geo/ob_geo_ibin.h"
#include "sql/engine/ob_exec_context.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "ob_expr_st_distance.h"
#include "lib/geo/ob_geo_utils.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"

View File

@ -15,7 +15,7 @@
#include "lib/geo/ob_geo_func_register.h"
#include "lib/geo/ob_geo_ibin.h"
#include "sql/engine/ob_exec_context.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/engine/expr/ob_expr_st_dwithin.h"
#include "lib/geo/ob_geo_utils.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"

View File

@ -20,7 +20,7 @@
#include "lib/geo/ob_geo_wkb_check_visitor.h"
#include "lib/geo/ob_geo_to_tree_visitor.h"
#include "lib/geo/ob_geo_func_common.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
using namespace oceanbase::common;
using namespace oceanbase::sql;

View File

@ -14,7 +14,7 @@
#define USING_LOG_PREFIX SQL_ENG
#include "sql/engine/expr/ob_expr_st_geomfromewkt.h"
#include "lib/geo/ob_wkt_parser.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"
#include "lib/geo/ob_geo_coordinate_range_visitor.h"
#include "lib/geo/ob_geo_reverse_coordinate_visitor.h"
@ -93,7 +93,7 @@ int ObExprPrivSTGeomFromEwkt::eval_st_geomfromewkt(const ObExpr &expr, ObEvalCtx
ret = OB_OPERATE_OVERFLOW;
LOG_WARN("srid input value out of range", K(ret), K(datum->get_int()));
} else if (0 != srid) {
if (OB_FAIL(OTSRS_MGR.get_tenant_srs_guard(session->get_effective_tenant_id(), srs_guard))) {
if (OB_FAIL(OTSRS_MGR->get_tenant_srs_guard(srs_guard))) {
LOG_WARN("failed to get srs guard", K(ret));
} else if (OB_FAIL(srs_guard.get_srs_item(srid, srs_item))) {
LOG_WARN("failed to get srs item", K(ret));

View File

@ -14,7 +14,7 @@
#define USING_LOG_PREFIX SQL_ENG
#include "sql/engine/expr/ob_expr_st_geomfromtext.h"
#include "lib/geo/ob_wkt_parser.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"
#include "lib/geo/ob_geo_coordinate_range_visitor.h"
#include "lib/geo/ob_geo_reverse_coordinate_visitor.h"
@ -133,7 +133,7 @@ int ObExprSTGeomFromText::eval_st_geomfromtext_common(const ObExpr &expr,
LOG_USER_ERROR(OB_OPERATE_OVERFLOW, "SRID", func_name);
LOG_WARN("srid input value out of range", K(ret), K(datum->get_int()));
} else if (0 != (srid = datum->get_uint32())) {
if (OB_FAIL(OTSRS_MGR.get_tenant_srs_guard(session->get_effective_tenant_id(), srs_guard))) {
if (OB_FAIL(OTSRS_MGR->get_tenant_srs_guard(srs_guard))) {
LOG_WARN("failed to get srs guard", K(ret));
} else if (OB_FAIL(srs_guard.get_srs_item(srid, srs_item))) {
LOG_WARN("failed to get srs item", K(ret));

View File

@ -19,7 +19,7 @@
#include "lib/geo/ob_geo_to_tree_visitor.h"
#include "lib/geo/ob_geo_wkb_check_visitor.h"
#include "lib/geo/ob_geo_func_common.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
using namespace oceanbase::common;
using namespace oceanbase::sql;
@ -121,7 +121,7 @@ int ObIExprSTGeomFromWKB::eval_geom_wkb(const ObExpr &expr, ObEvalCtx &ctx, ObDa
ret = OB_OPERATE_OVERFLOW;
LOG_WARN("srid input value out of range", K(ret), K(datum->get_int()));
} else if (0 != (srid = datum->get_uint32())) {
if (OB_FAIL(OTSRS_MGR.get_tenant_srs_guard(session->get_effective_tenant_id(), srs_guard))) {
if (OB_FAIL(OTSRS_MGR->get_tenant_srs_guard(srs_guard))) {
LOG_WARN("failed to get srs guard", K(ret));
} else if (OB_FAIL(srs_guard.get_srs_item(srid, srs_item))) {
LOG_WARN("failed to get srs item", K(ret));

View File

@ -16,7 +16,7 @@
#include "lib/geo/ob_geo_func_register.h"
#include "lib/geo/ob_geo_ibin.h"
#include "sql/engine/ob_exec_context.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "ob_expr_st_intersects.h"
#include "lib/geo/ob_geo_utils.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"

View File

@ -17,7 +17,7 @@
#include "lib/geo/ob_geo_func_isvalid.h"
#include "ob_expr_st_isvalid.h"
#include "lib/geo/ob_srs_info.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"

View File

@ -17,7 +17,7 @@
#include "lib/geo/ob_geo_func_common.h"
#include "lib/geo/ob_geo_utils.h"
#include "lib/geo/ob_geo.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"
using namespace oceanbase::common;
@ -114,7 +114,7 @@ int ObExprSTSRID::eval_st_srid_common(const ObExpr &expr, ObEvalCtx &ctx, ObDatu
LOG_USER_ERROR(OB_OPERATE_OVERFLOW, "SRID", func_name);
LOG_WARN("srid input value out of range", K(ret), K(datum->get_int()));
} else if (0 != (srid = datum->get_uint32())) {
if (OB_FAIL(OTSRS_MGR.get_tenant_srs_guard(session->get_effective_tenant_id(), srs_guard))) {
if (OB_FAIL(OTSRS_MGR->get_tenant_srs_guard(srs_guard))) {
LOG_WARN("failed to get srs guard", K(ret));
} else if (OB_FAIL(srs_guard.get_srs_item(srid, srs))) {
LOG_WARN("failed to get srs item", K(ret));

View File

@ -15,7 +15,7 @@
#include "lib/geo/ob_geo_func_register.h"
#include "ob_expr_st_transform.h"
#include "lib/geo/ob_srs_info.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "lib/geo/ob_geo_normalize_visitor.h"
#include "lib/geo/ob_geo_wkb_size_visitor.h"
#include "lib/geo/ob_geo_wkb_visitor.h"

View File

@ -17,7 +17,7 @@
#include "lib/geo/ob_geo_ibin.h"
#include "sql/session/ob_sql_session_info.h"
#include "sql/engine/ob_exec_context.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "ob_expr_st_within.h"
#include "lib/geo/ob_geo_utils.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"

View File

@ -17,7 +17,7 @@
#include "lib/geo/ob_geo.h"
#include "lib/geo/ob_geo_utils.h"
#include "lib/geo/ob_srs_info.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/session/ob_sql_session_info.h"
#include "sql/engine/ob_exec_context.h"
#include "sql/engine/expr/ob_geo_expr_utils.h"

View File

@ -14,7 +14,7 @@
#define USING_LOG_PREFIX SQL_ENG
#include "sql/engine/expr/ob_geo_expr_utils.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "lib/geo/ob_geo_func_register.h"
#include "lib/geo/ob_geo_coordinate_range_visitor.h"
#include "lib/geo/ob_geo_wkb_size_visitor.h"
@ -40,7 +40,7 @@ int ObGeoExprUtils::get_srs_item(uint64_t tenant_id,
{
int ret = OB_SUCCESS;
if (0 != srid && OB_FAIL(OTSRS_MGR.get_tenant_srs_guard(tenant_id, srs_guard))) {
if (0 != srid && OB_FAIL(OTSRS_MGR->get_tenant_srs_guard(srs_guard))) {
LOG_WARN("fail to get srs guard", K(ret), K(tenant_id));
} else if (0 != srid && OB_FAIL(srs_guard.get_srs_item(srid, srs))) {
LOG_WARN("fail to get srs", K(ret), K(srid));

View File

@ -23,7 +23,7 @@
#include "sql/session/ob_sql_session_info.h"
#include "sql/engine/ob_exec_context.h"
#include "share/ob_i_sql_expression.h" // for ObExprCtx
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/engine/expr/ob_expr_lob_utils.h"
namespace oceanbase