Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b17b4932
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b17b4932
编写于
2月 10, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-11818]Refactor.
上级
4dbbf286
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
228 addition
and
159 deletion
+228
-159
include/util/tpagedbuf.h
include/util/tpagedbuf.h
+29
-23
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+2
-0
source/libs/executor/test/executorTests.cpp
source/libs/executor/test/executorTests.cpp
+2
-0
source/util/src/tpagedbuf.c
source/util/src/tpagedbuf.c
+195
-136
未找到文件。
include/util/tpagedbuf.h
浏览文件 @
b17b4932
...
...
@@ -39,73 +39,73 @@ typedef struct SFilePage {
/**
* create disk-based result buffer
* @param p
Result
Buf
* @param pBuf
* @param rowSize
* @param pagesize
* @param inMemPages
* @param handle
* @return
*/
int32_t
createDiskbasedBuffer
(
SDiskbasedBuf
**
p
Result
Buf
,
int32_t
pagesize
,
int32_t
inMemBufSize
,
uint64_t
qId
,
const
char
*
dir
);
int32_t
createDiskbasedBuffer
(
SDiskbasedBuf
**
pBuf
,
int32_t
pagesize
,
int32_t
inMemBufSize
,
uint64_t
qId
,
const
char
*
dir
);
/**
*
* @param p
Result
Buf
* @param pBuf
* @param groupId
* @param pageId
* @return
*/
SFilePage
*
getNewDataBuf
(
SDiskbasedBuf
*
p
Result
Buf
,
int32_t
groupId
,
int32_t
*
pageId
);
SFilePage
*
getNewDataBuf
(
SDiskbasedBuf
*
pBuf
,
int32_t
groupId
,
int32_t
*
pageId
);
/**
*
* @param p
Result
Buf
* @param pBuf
* @param groupId
* @return
*/
SIDList
getDataBufPagesIdList
(
SDiskbasedBuf
*
p
Result
Buf
,
int32_t
groupId
);
SIDList
getDataBufPagesIdList
(
SDiskbasedBuf
*
pBuf
,
int32_t
groupId
);
/**
* get the specified buffer page by id
* @param p
Result
Buf
* @param pBuf
* @param id
* @return
*/
SFilePage
*
getBufPage
(
SDiskbasedBuf
*
p
Result
Buf
,
int32_t
id
);
SFilePage
*
getBufPage
(
SDiskbasedBuf
*
pBuf
,
int32_t
id
);
/**
* release the referenced buf pages
* @param p
Result
Buf
* @param pBuf
* @param page
*/
void
releaseBufPage
(
SDiskbasedBuf
*
p
Result
Buf
,
void
*
page
);
void
releaseBufPage
(
SDiskbasedBuf
*
pBuf
,
void
*
page
);
/**
*
* @param p
Result
Buf
* @param pBuf
* @param pi
*/
void
releaseBufPageInfo
(
SDiskbasedBuf
*
p
Result
Buf
,
struct
SPageInfo
*
pi
);
void
releaseBufPageInfo
(
SDiskbasedBuf
*
pBuf
,
struct
SPageInfo
*
pi
);
/**
* get the total buffer size in the format of disk file
* @param p
Result
Buf
* @param pBuf
* @return
*/
size_t
getTotalBufSize
(
const
SDiskbasedBuf
*
p
Result
Buf
);
size_t
getTotalBufSize
(
const
SDiskbasedBuf
*
pBuf
);
/**
* get the number of groups in the result buffer
* @param p
Result
Buf
* @param pBuf
* @return
*/
size_t
getNumOfResultBufGroupId
(
const
SDiskbasedBuf
*
p
Result
Buf
);
size_t
getNumOfResultBufGroupId
(
const
SDiskbasedBuf
*
pBuf
);
/**
* destroy result buffer
* @param p
Result
Buf
* @param pBuf
*/
void
destroyResultBuf
(
SDiskbasedBuf
*
p
Result
Buf
);
void
destroyResultBuf
(
SDiskbasedBuf
*
pBuf
);
/**
*
...
...
@@ -123,24 +123,30 @@ int32_t getPageId(const SPageInfo* pPgInfo);
/**
* Return the buffer page size.
* @param p
Result
Buf
* @param pBuf
* @return
*/
int32_t
getBufPageSize
(
const
SDiskbasedBuf
*
p
Result
Buf
);
int32_t
getBufPageSize
(
const
SDiskbasedBuf
*
pBuf
);
/**
*
* @param p
Result
Buf
* @param pBuf
* @return
*/
bool
isAllDataInMemBuf
(
const
SDiskbasedBuf
*
p
Result
Buf
);
bool
isAllDataInMemBuf
(
const
SDiskbasedBuf
*
pBuf
);
/**
* Set the buffer page is dirty, and needs to be flushed to disk when swap out.
* @param pPageInfo
* @param dirty
*/
void
setBufPageDirty
(
SPageInfo
*
pPageInfo
,
bool
dirty
);
void
setBufPageDirty
(
SFilePage
*
pPageInfo
,
bool
dirty
);
/**
* Print the statistics when closing this buffer
* @param pBuf
*/
void
printStatisBeforeClose
(
SDiskbasedBuf
*
pBuf
);
#ifdef __cplusplus
}
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
b17b4932
...
...
@@ -5729,6 +5729,8 @@ void addToDiskbasedBuf(SOrderOperatorInfo* pInfo, jmp_buf env) {
assert
(
size
<=
getBufPageSize
(
pInfo
->
pSortInternalBuf
));
blockDataToBuf
(
pPage
->
data
,
p
);
setBufPageDirty
(
pPage
,
true
);
releaseBufPage
(
pInfo
->
pSortInternalBuf
,
pPage
);
blockDataDestroy
(
p
);
...
...
source/libs/executor/test/executorTests.cpp
浏览文件 @
b17b4932
...
...
@@ -293,6 +293,8 @@ TEST(testCase, external_sort_Test) {
// }
}
printStatisBeforeClose
(((
SOrderOperatorInfo
*
)
pOperator
->
info
)
->
pSortInternalBuf
);
int64_t
s2
=
taosGetTimestampUs
();
printf
(
"total:%ld
\n
"
,
s2
-
s1
);
...
...
source/util/src/tpagedbuf.c
浏览文件 @
b17b4932
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录