Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Messij2001
oceanbase
提交
4a67d3f3
O
oceanbase
项目概览
Messij2001
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4a67d3f3
编写于
10月 14, 2021
作者:
L
leslieyuchen
提交者:
wangzelin.wzl
10月 14, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change the ap_mini_task_mgr memory allocator from TCFactory to op_reclaim_alloc
上级
28e32c86
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
34 deletion
+13
-34
deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h
deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h
+1
-1
src/sql/executor/ob_mini_task_executor.cpp
src/sql/executor/ob_mini_task_executor.cpp
+1
-4
src/sql/executor/ob_mini_task_executor.h
src/sql/executor/ob_mini_task_executor.h
+10
-27
src/sql/ob_sql_init.h
src/sql/ob_sql_init.h
+1
-2
未找到文件。
deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h
浏览文件 @
4a67d3f3
...
...
@@ -722,7 +722,7 @@ struct OPNum {
template
<
class
Type
,
bool
Cond
=
true
>
struct
GetOPLabel
{
static
const
int64_t
v
=
Type
::
OP_LABEL
;
static
const
expr
const
char
*
v
=
Type
::
OP_LABEL
;
};
template
<
class
Type
>
...
...
src/sql/executor/ob_mini_task_executor.cpp
浏览文件 @
4a67d3f3
...
...
@@ -22,8 +22,6 @@
namespace
oceanbase
{
using
namespace
common
;
namespace
sql
{
REGISTER_CREATOR
(
ObAPMiniTaskMgrGFactory
,
ObAPMiniTaskMgr
,
ObAPMiniTaskMgr
,
0
);
int
ObAPMiniTaskMgr
::
save_task_result
(
const
ObAddr
&
task_addr
,
int64_t
task_id
,
int32_t
ret_code
,
const
ObMiniTaskResult
&
result
)
{
...
...
@@ -87,8 +85,7 @@ int ObAPMiniTaskMgr::init(ObSQLSessionInfo& session, ObExecutorRpcImpl* exec_rpc
void
ObAPMiniTaskMgr
::
reset
()
{
int
ret
=
OB_SUCCESS
;
ObDLinkBase
<
ObAPMiniTaskMgr
>::
reset
();
void
*
p
=
NULL
;
void
*
p
=
NULL
;
while
(
OB_SUCC
(
finish_queue_
.
pop
(
p
,
0
)))
{
if
(
p
!=
NULL
)
{
ObMiniTaskEvent
*
task_event
=
static_cast
<
ObMiniTaskEvent
*>
(
p
);
...
...
src/sql/executor/ob_mini_task_executor.h
浏览文件 @
4a67d3f3
...
...
@@ -17,10 +17,13 @@
#include "lib/allocator/ob_safe_arena.h"
namespace
oceanbase
{
namespace
sql
{
class
ObAPMiniTaskMgr
:
public
common
::
ObDLinkBase
<
ObAPMiniTaskMgr
>
{
class
ObAPMiniTaskMgr
{
static
const
int64_t
MAX_FINISH_QUEUE_CAPACITY
=
512
;
public:
static
const
int64_t
OP_LOCAL_NUM
=
1
;
static
constexpr
const
char
*
OP_LABEL
=
ObModIds
::
OB_SQL_EXECUTOR_MINI_TASK_MGR
;
ObAPMiniTaskMgr
()
:
ref_count_
(
0
),
mgr_rcode_
(
common
::
OB_SUCCESS
),
...
...
@@ -30,11 +33,8 @@ public:
lock_
()
{}
virtual
~
ObAPMiniTaskMgr
()
{}
int32_t
get_type
()
{
re
turn
0
;
re
set
()
;
}
static
ObAPMiniTaskMgr
*
alloc
();
static
void
free
(
ObAPMiniTaskMgr
*
item
);
...
...
@@ -47,7 +47,7 @@ public:
return
ATOMIC_SAF
((
uint64_t
*
)
&
ref_count_
,
1
);
}
int
init
(
ObSQLSessionInfo
&
session
,
ObExecutorRpcImpl
*
exec_rpc
);
v
irtual
void
reset
()
override
;
v
oid
reset
()
;
void
set_mgr_rcode
(
int
mgr_rcode
)
{
mgr_rcode_
=
mgr_rcode
;
...
...
@@ -88,21 +88,9 @@ private:
mutable
common
::
ObSpinLock
lock_
;
};
typedef
common
::
ObGlobalFactory
<
ObAPMiniTaskMgr
,
1
,
common
::
ObModIds
::
OB_SQL_EXECUTOR_MINI_TASK_MGR
>
ObAPMiniTaskMgrGFactory
;
typedef
common
::
ObTCFactory
<
ObAPMiniTaskMgr
,
1
,
common
::
ObModIds
::
OB_SQL_EXECUTOR_MINI_TASK_MGR
>
ObApMiniTaskMgrTCFactory
;
inline
ObAPMiniTaskMgr
*
ObAPMiniTaskMgr
::
alloc
()
inline
ObAPMiniTaskMgr
*
ObAPMiniTaskMgr
::
alloc
()
{
ObAPMiniTaskMgr
*
ap_mini_task_mgr
=
NULL
;
if
(
OB_ISNULL
(
ObApMiniTaskMgrTCFactory
::
get_instance
()))
{
SQL_EXE_LOG
(
ERROR
,
"get ap mini task mgr factory instance failed"
);
ap_mini_task_mgr
=
NULL
;
}
else
{
ap_mini_task_mgr
=
ObApMiniTaskMgrTCFactory
::
get_instance
()
->
get
(
0
);
}
return
ap_mini_task_mgr
;
return
op_reclaim_alloc
(
ObAPMiniTaskMgr
);
}
inline
void
ObAPMiniTaskMgr
::
free
(
ObAPMiniTaskMgr
*
item
)
...
...
@@ -111,13 +99,8 @@ inline void ObAPMiniTaskMgr::free(ObAPMiniTaskMgr* item)
int64_t
ref_count
=
item
->
def_ref_count
();
if
(
OB_LIKELY
(
0
==
ref_count
))
{
// nobody reference this object, so free it
if
(
OB_ISNULL
(
ObApMiniTaskMgrTCFactory
::
get_instance
()))
{
SQL_EXE_LOG
(
ERROR
,
"get ap mini task mgr factory instance failed"
);
}
else
{
item
->
reset
();
ObApMiniTaskMgrTCFactory
::
get_instance
()
->
put
(
item
);
item
=
NULL
;
}
op_reclaim_free
(
item
);
item
=
nullptr
;
}
else
if
(
OB_UNLIKELY
(
ref_count
<
0
))
{
SQL_EXE_LOG
(
ERROR
,
"ref_count is invalid"
,
K
(
ref_count
));
}
...
...
src/sql/ob_sql_init.h
浏览文件 @
4a67d3f3
...
...
@@ -49,8 +49,7 @@ inline int init_sql_factories()
// ATTENTION: don't delete this log, it's used to init thread local variable LogBufferMgr in ObLog.
SQL_LOG
(
INFO
,
"init sql factories"
);
int
ret
=
common
::
OB_SUCCESS
;
if
(
OB_FAIL
(
ObAPMiniTaskMgrGFactory
::
get_instance
()
->
init
()))
{
}
else
if
(
OB_FAIL
(
ObPxSqcHandlerFactory
::
get_instance
()
->
init
()))
{
if
(
OB_FAIL
(
ObPxSqcHandlerFactory
::
get_instance
()
->
init
()))
{
SQL_LOG
(
ERROR
,
"failed to init sqc handler"
,
K
(
ret
));
}
else
{
ObExprOperatorFactory
::
register_expr_operators
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录