Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0296c341
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0296c341
编写于
2月 10, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-11818] refactor code.
上级
3a2d7235
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
36 addition
and
36 deletion
+36
-36
2.0/src/query/tests/resultBufferTest.cpp
2.0/src/query/tests/resultBufferTest.cpp
+24
-24
include/util/tpagedbuf.h
include/util/tpagedbuf.h
+3
-3
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+1
-1
source/libs/executor/inc/executil.h
source/libs/executor/inc/executil.h
+1
-1
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+2
-2
source/libs/function/inc/tpercentile.h
source/libs/function/inc/tpercentile.h
+1
-1
source/libs/function/src/tpercentile.c
source/libs/function/src/tpercentile.c
+2
-2
source/util/src/tpagedbuf.c
source/util/src/tpagedbuf.c
+2
-2
未找到文件。
2.0/src/query/tests/resultBufferTest.cpp
浏览文件 @
0296c341
...
...
@@ -22,33 +22,33 @@ void simpleTest() {
tFilePage
*
pBufPage
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
ASSERT_TRUE
(
pBufPage
!=
NULL
);
ASSERT_EQ
(
get
Res
BufSize
(
pResultBuf
),
1024
);
ASSERT_EQ
(
get
Total
BufSize
(
pResultBuf
),
1024
);
SIDList
list
=
getDataBufPagesIdList
(
pResultBuf
,
groupId
);
ASSERT_EQ
(
taosArrayGetSize
(
list
),
1
);
ASSERT_EQ
(
getNumOfResultBufGroupId
(
pResultBuf
),
1
);
release
Res
BufPage
(
pResultBuf
,
pBufPage
);
releaseBufPage
(
pResultBuf
,
pBufPage
);
tFilePage
*
pBufPage1
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t
==
pBufPage1
);
tFilePage
*
pBufPage2
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t1
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t1
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t1
==
pBufPage2
);
tFilePage
*
pBufPage3
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t2
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t2
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t2
==
pBufPage3
);
tFilePage
*
pBufPage4
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t3
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t3
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t3
==
pBufPage4
);
tFilePage
*
pBufPage5
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t4
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t4
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t4
==
pBufPage5
);
destroyResultBuf
(
pResultBuf
);
...
...
@@ -68,31 +68,31 @@ void writeDownTest() {
*
(
int32_t
*
)(
pBufPage
->
data
)
=
nx
;
writePageId
=
pageId
;
release
Res
BufPage
(
pResultBuf
,
pBufPage
);
releaseBufPage
(
pResultBuf
,
pBufPage
);
tFilePage
*
pBufPage1
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t1
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t1
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t1
==
pBufPage1
);
ASSERT_TRUE
(
pageId
==
1
);
tFilePage
*
pBufPage2
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t2
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t2
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t2
==
pBufPage2
);
ASSERT_TRUE
(
pageId
==
2
);
tFilePage
*
pBufPage3
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t3
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t3
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t3
==
pBufPage3
);
ASSERT_TRUE
(
pageId
==
3
);
tFilePage
*
pBufPage4
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t4
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t4
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t4
==
pBufPage4
);
ASSERT_TRUE
(
pageId
==
4
);
release
Res
BufPage
(
pResultBuf
,
t4
);
releaseBufPage
(
pResultBuf
,
t4
);
// flush the written page to disk, and read it out again
tFilePage
*
pBufPagex
=
get
Res
BufPage
(
pResultBuf
,
writePageId
);
tFilePage
*
pBufPagex
=
getBufPage
(
pResultBuf
,
writePageId
);
ASSERT_EQ
(
*
(
int32_t
*
)
pBufPagex
->
data
,
nx
);
SArray
*
pa
=
getDataBufPagesIdList
(
pResultBuf
,
groupId
);
...
...
@@ -112,41 +112,41 @@ void recyclePageTest() {
tFilePage
*
pBufPage
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
ASSERT_TRUE
(
pBufPage
!=
NULL
);
release
Res
BufPage
(
pResultBuf
,
pBufPage
);
releaseBufPage
(
pResultBuf
,
pBufPage
);
tFilePage
*
pBufPage1
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t1
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t1
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t1
==
pBufPage1
);
ASSERT_TRUE
(
pageId
==
1
);
tFilePage
*
pBufPage2
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t2
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t2
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t2
==
pBufPage2
);
ASSERT_TRUE
(
pageId
==
2
);
tFilePage
*
pBufPage3
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t3
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t3
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t3
==
pBufPage3
);
ASSERT_TRUE
(
pageId
==
3
);
tFilePage
*
pBufPage4
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t4
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t4
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t4
==
pBufPage4
);
ASSERT_TRUE
(
pageId
==
4
);
release
Res
BufPage
(
pResultBuf
,
t4
);
releaseBufPage
(
pResultBuf
,
t4
);
tFilePage
*
pBufPage5
=
getNewDataBuf
(
pResultBuf
,
groupId
,
&
pageId
);
tFilePage
*
t5
=
get
Res
BufPage
(
pResultBuf
,
pageId
);
tFilePage
*
t5
=
getBufPage
(
pResultBuf
,
pageId
);
ASSERT_TRUE
(
t5
==
pBufPage5
);
ASSERT_TRUE
(
pageId
==
5
);
// flush the written page to disk, and read it out again
tFilePage
*
pBufPagex
=
get
Res
BufPage
(
pResultBuf
,
writePageId
);
tFilePage
*
pBufPagex
=
getBufPage
(
pResultBuf
,
writePageId
);
*
(
int32_t
*
)(
pBufPagex
->
data
)
=
nx
;
writePageId
=
pageId
;
// update the data
release
Res
BufPage
(
pResultBuf
,
pBufPagex
);
releaseBufPage
(
pResultBuf
,
pBufPagex
);
tFilePage
*
pBufPagex1
=
get
Res
BufPage
(
pResultBuf
,
1
);
tFilePage
*
pBufPagex1
=
getBufPage
(
pResultBuf
,
1
);
SArray
*
pa
=
getDataBufPagesIdList
(
pResultBuf
,
groupId
);
ASSERT_EQ
(
taosArrayGetSize
(
pa
),
6
);
...
...
include/util/tpaged
file
.h
→
include/util/tpaged
buf
.h
浏览文件 @
0296c341
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_TPAGED
FILE
_H
#define TDENGINE_TPAGED
FILE
_H
#ifndef TDENGINE_TPAGED
BUF
_H
#define TDENGINE_TPAGED
BUF
_H
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -146,4 +146,4 @@ void setBufPageDirty(SPageInfo* pPageInfo, bool dirty);
}
#endif
#endif // TDENGINE_TPAGED
FILE
_H
#endif // TDENGINE_TPAGED
BUF
_H
source/client/src/clientImpl.c
浏览文件 @
0296c341
...
...
@@ -9,7 +9,7 @@
#include "tglobal.h"
#include "tmsgtype.h"
#include "tnote.h"
#include "tpaged
file
.h"
#include "tpaged
buf
.h"
#include "tref.h"
#define CHECK_CODE_GOTO(expr, label) \
...
...
source/libs/executor/inc/executil.h
浏览文件 @
0296c341
...
...
@@ -16,8 +16,8 @@
#define TDENGINE_QUERYUTIL_H
#include "common.h"
#include "tpagedfile.h"
#include "tbuffer.h"
#include "tpagedbuf.h"
#define SET_RES_WINDOW_KEY(_k, _ori, _len, _uid) \
do { \
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
0296c341
...
...
@@ -27,14 +27,14 @@ extern "C" {
#include "dataSinkMgt.h"
#include "executil.h"
#include "executor.h"
#include "planner.h"
#include "taosdef.h"
#include "tarray.h"
#include "tfilter.h"
#include "thash.h"
#include "tlockfree.h"
#include "tpagedfile.h"
#include "executor.h"
#include "tpagedbuf.h"
struct
SColumnFilterElem
;
...
...
source/libs/function/inc/tpercentile.h
浏览文件 @
0296c341
...
...
@@ -20,7 +20,7 @@
extern
"C"
{
#endif
#include "tpaged
file
.h"
#include "tpaged
buf
.h"
#include "ttszip.h"
typedef
struct
MinMaxEntry
{
...
...
source/libs/function/src/tpercentile.c
浏览文件 @
0296c341
...
...
@@ -15,10 +15,10 @@
#include <tglobal.h>
#include "os.h"
#include "tpercentile.h"
#include "tpagedfile.h"
#include "taosdef.h"
#include "tcompare.h"
#include "tpagedbuf.h"
#include "tpercentile.h"
#include "ttypes.h"
#define DEFAULT_NUM_OF_SLOT 1024
...
...
source/util/src/tpaged
file
.c
→
source/util/src/tpaged
buf
.c
浏览文件 @
0296c341
#include "tpagedfile.h"
#include "thash.h"
#include "tpagedbuf.h"
#include "stddef.h"
#include "taoserror.h"
#include "tcompression.h"
#include "thash.h"
#define GET_DATA_PAYLOAD(_p) ((char *)(_p)->pData + POINTER_BYTES)
#define NO_IN_MEM_AVAILABLE_PAGES(_b) (listNEles((_b)->lruList) >= (_b)->inMemPages)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录