Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
画布下的乐园
oceanbase
提交
2dd62c82
O
oceanbase
项目概览
画布下的乐园
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2dd62c82
编写于
11月 03, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
11月 03, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FIX] core when read index in query engine
上级
50faf7a0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
35 addition
and
10 deletion
+35
-10
src/storage/memtable/mvcc/ob_query_engine.cpp
src/storage/memtable/mvcc/ob_query_engine.cpp
+4
-3
src/storage/memtable/mvcc/ob_query_engine.h
src/storage/memtable/mvcc/ob_query_engine.h
+31
-7
未找到文件。
src/storage/memtable/mvcc/ob_query_engine.cpp
浏览文件 @
2dd62c82
...
...
@@ -176,7 +176,7 @@ void ObQueryEngine::destroy()
{
if
(
IS_NOT_INIT
)
{
// do nothing
}
else
if
(
OB_NOT_NULL
(
index_
))
{
}
else
if
(
OB_NOT_NULL
(
index_
)
&&
NOT_PLACE_HOLDER
(
index_
)
)
{
index_
->
destroy
();
memstore_allocator_
.
free
(
index_
);
index_
=
nullptr
;
...
...
@@ -704,8 +704,9 @@ int ObQueryEngine::estimate_row_count(const ObMemtableKey *start_key, const int
void
ObQueryEngine
::
dump2text
(
FILE
*
fd
)
{
if
(
OB_NOT_NULL
(
index_
))
{
index_
->
dump2text
(
fd
);
TableIndex
*
index
=
ATOMIC_LOAD
(
&
index_
);
if
(
OB_NOT_NULL
(
index
)
&&
NOT_PLACE_HOLDER
(
index
))
{
index
->
dump2text
(
fd
);
}
}
...
...
src/storage/memtable/mvcc/ob_query_engine.h
浏览文件 @
2dd62c82
...
...
@@ -49,6 +49,8 @@ public:
class
ObQueryEngine
{
#define NOT_PLACE_HOLDER(ptr) OB_UNLIKELY(PLACE_HOLDER != ptr)
public:
enum
{
INIT_TABLE_INDEX_COUNT
=
(
1
<<
10
),
...
...
@@ -198,15 +200,37 @@ public:
int
estimate_row_count
(
const
ObMemtableKey
*
start_key
,
const
int
start_exclude
,
const
ObMemtableKey
*
end_key
,
const
int
end_exclude
,
int64_t
&
logical_row_count
,
int64_t
&
physical_row_count
);
int
dump_keyhash
(
FILE
*
fd
)
const
{
return
OB_NOT_NULL
(
index_
)
?
index_
->
dump_keyhash
(
fd
)
:
OB_SUCCESS
;
}
int64_t
hash_size
()
const
{
return
OB_NOT_NULL
(
index_
)
?
index_
->
hash_size
()
:
0
;
}
int64_t
hash_alloc_memory
()
const
{
return
OB_NOT_NULL
(
index_
)
?
index_
->
hash_alloc_memory
()
:
0
;
}
int
dump_keybtree
(
FILE
*
fd
)
{
return
OB_NOT_NULL
(
index_
)
?
index_
->
dump_keybtree
(
fd
)
:
OB_SUCCESS
;
}
int64_t
btree_size
()
const
{
return
OB_NOT_NULL
(
index_
)
?
index_
->
btree_size
()
:
0
;
}
int
dump_keyhash
(
FILE
*
fd
)
const
{
TableIndex
*
index
=
ATOMIC_LOAD
(
&
index_
);
return
OB_NOT_NULL
(
index
)
&&
NOT_PLACE_HOLDER
(
index
)
?
index
->
dump_keyhash
(
fd
)
:
OB_SUCCESS
;
}
int64_t
hash_size
()
const
{
TableIndex
*
index
=
ATOMIC_LOAD
(
&
index_
);
return
OB_NOT_NULL
(
index
)
&&
NOT_PLACE_HOLDER
(
index
)
?
index
->
hash_size
()
:
0
;
}
int64_t
hash_alloc_memory
()
const
{
TableIndex
*
index
=
ATOMIC_LOAD
(
&
index_
);
return
OB_NOT_NULL
(
index
)
&&
NOT_PLACE_HOLDER
(
index
)
?
index
->
hash_alloc_memory
()
:
0
;
}
int
dump_keybtree
(
FILE
*
fd
)
{
TableIndex
*
index
=
ATOMIC_LOAD
(
&
index_
);
return
OB_NOT_NULL
(
index
)
&&
NOT_PLACE_HOLDER
(
index
)
?
index
->
dump_keybtree
(
fd
)
:
OB_SUCCESS
;
}
int64_t
btree_size
()
const
{
TableIndex
*
index
=
ATOMIC_LOAD
(
&
index_
);
return
OB_NOT_NULL
(
index
)
&&
NOT_PLACE_HOLDER
(
index
)
?
index
->
btree_size
()
:
0
;
}
int64_t
btree_alloc_memory
()
const
{
return
OB_NOT_NULL
(
index_
)
?
index_
->
btree_alloc_memory
()
+
btree_allocator_
.
get_allocated
()
:
0
;
TableIndex
*
index
=
ATOMIC_LOAD
(
&
index_
);
return
OB_NOT_NULL
(
index
)
&&
NOT_PLACE_HOLDER
(
index
)
?
index
->
btree_alloc_memory
()
+
btree_allocator_
.
get_allocated
()
:
0
;
}
void
dump2text
(
FILE
*
fd
);
int
get_table_index
(
TableIndex
*&
return_ptr
)
const
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录