Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7b53b814
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7b53b814
编写于
11月 12, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
ab52d28c
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
32 addition
and
17 deletion
+32
-17
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+1
-0
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+9
-9
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+14
-2
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+7
-0
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+1
-6
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
7b53b814
...
...
@@ -1306,6 +1306,7 @@ int32_t copyDataBlock(SSDataBlock* dst, const SSDataBlock* src) {
colDataAssign
(
pDst
,
pSrc
,
src
->
info
.
rows
,
&
src
->
info
);
}
uint32_t
cap
=
dst
->
info
.
capacity
;
dst
->
info
=
src
->
info
;
dst
->
info
.
capacity
=
cap
;
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
7b53b814
...
...
@@ -153,14 +153,13 @@ typedef struct {
SSchemaWrapper
*
qsw
;
}
SSchemaInfo
;
typedef
struct
SExecTaskInfo
{
struct
SExecTaskInfo
{
STaskIdInfo
id
;
uint32_t
status
;
STimeWindow
window
;
STaskCostInfo
cost
;
int64_t
owner
;
// if it is in execution
int32_t
code
;
int64_t
version
;
// used for stream to record wal version
SStreamTaskInfo
streamInfo
;
SSchemaInfo
schemaInfo
;
...
...
@@ -171,7 +170,8 @@ typedef struct SExecTaskInfo {
SSubplan
*
pSubplan
;
struct
SOperatorInfo
*
pRoot
;
SLocalFetch
localFetch
;
}
SExecTaskInfo
;
SArray
*
pResultBlockList
;
// result block list
};
enum
{
OP_NOT_OPENED
=
0x0
,
...
...
source/libs/executor/src/executor.c
浏览文件 @
7b53b814
...
...
@@ -536,7 +536,7 @@ int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds, bo
memcpy
(
&
pTaskInfo
->
localFetch
,
pLocal
,
sizeof
(
*
pLocal
));
}
taosArrayClear
Ex
(
pResList
,
freeBlock
);
taosArrayClear
(
pResList
);
int64_t
curOwner
=
0
;
if
((
curOwner
=
atomic_val_compare_exchange_64
(
&
pTaskInfo
->
owner
,
0
,
threadId
))
!=
0
)
{
...
...
@@ -574,8 +574,20 @@ int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds, bo
int64_t
st
=
taosGetTimestampUs
();
int32_t
blockIndex
=
0
;
while
((
pRes
=
pTaskInfo
->
pRoot
->
fpSet
.
getNextFn
(
pTaskInfo
->
pRoot
))
!=
NULL
)
{
SSDataBlock
*
p
=
createOneDataBlock
(
pRes
,
true
);
SSDataBlock
*
p
=
NULL
;
if
(
blockIndex
>=
taosArrayGetSize
(
pTaskInfo
->
pResultBlockList
))
{
SSDataBlock
*
p1
=
createOneDataBlock
(
pRes
,
true
);
taosArrayPush
(
pTaskInfo
->
pResultBlockList
,
&
p1
);
p
=
p1
;
}
else
{
p
=
*
(
SSDataBlock
**
)
taosArrayGet
(
pTaskInfo
->
pResultBlockList
,
blockIndex
);
copyDataBlock
(
p
,
pRes
);
}
blockIndex
+=
1
;
current
+=
p
->
info
.
rows
;
ASSERT
(
p
->
info
.
rows
>
0
);
taosArrayPush
(
pResList
,
&
p
);
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
7b53b814
...
...
@@ -2600,6 +2600,7 @@ static SExecTaskInfo* createExecTaskInfo(uint64_t queryId, uint64_t taskId, EOPT
pTaskInfo
->
id
.
queryId
=
queryId
;
pTaskInfo
->
execModel
=
model
;
pTaskInfo
->
pTableInfoList
=
tableListCreate
();
pTaskInfo
->
pResultBlockList
=
taosArrayInit
(
128
,
POINTER_BYTES
);
char
*
p
=
taosMemoryCalloc
(
1
,
128
);
snprintf
(
p
,
128
,
"TID:0x%"
PRIx64
" QID:0x%"
PRIx64
,
taskId
,
queryId
);
...
...
@@ -3201,6 +3202,11 @@ _complete:
return
terrno
;
}
static
void
freeBlock
(
void
*
pParam
)
{
SSDataBlock
*
pBlock
=
*
(
SSDataBlock
**
)
pParam
;
blockDataDestroy
(
pBlock
);
}
void
doDestroyTask
(
SExecTaskInfo
*
pTaskInfo
)
{
qDebug
(
"%s execTask is freed"
,
GET_TASKID
(
pTaskInfo
));
...
...
@@ -3213,6 +3219,7 @@ void doDestroyTask(SExecTaskInfo* pTaskInfo) {
nodesDestroyNode
((
SNode
*
)
pTaskInfo
->
pSubplan
);
}
taosArrayDestroyEx
(
pTaskInfo
->
pResultBlockList
,
freeBlock
);
taosMemoryFreeClear
(
pTaskInfo
->
sql
);
taosMemoryFreeClear
(
pTaskInfo
->
id
.
str
);
taosMemoryFreeClear
(
pTaskInfo
);
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
7b53b814
...
...
@@ -18,11 +18,6 @@ SQWorkerMgmt gQwMgmt = {
.
qwNum
=
0
,
};
static
void
freeBlock
(
void
*
param
)
{
SSDataBlock
*
pBlock
=
*
(
SSDataBlock
**
)
param
;
blockDataDestroy
(
pBlock
);
}
int32_t
qwProcessHbLinkBroken
(
SQWorker
*
mgmt
,
SQWMsg
*
qwMsg
,
SSchedulerHbReq
*
req
)
{
int32_t
code
=
0
;
SSchedulerHbRsp
rsp
=
{
0
};
...
...
@@ -193,7 +188,7 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) {
}
_return:
taosArrayDestroy
Ex
(
pResList
,
freeBlock
);
taosArrayDestroy
(
pResList
);
QW_RET
(
code
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录