Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
dbd79cc8
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dbd79cc8
编写于
5月 10, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
c6e5879f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
13 deletion
+16
-13
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+0
-2
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+3
-5
source/libs/stream/src/stream.c
source/libs/stream/src/stream.c
+2
-0
source/libs/stream/src/streamData.c
source/libs/stream/src/streamData.c
+2
-1
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+9
-5
未找到文件。
include/libs/stream/tstream.h
浏览文件 @
dbd79cc8
...
...
@@ -207,8 +207,6 @@ static FORCE_INLINE void streamQueueProcessFail(SStreamQueue* queue) {
atomic_store_8
(
&
queue
->
status
,
STREAM_QUEUE__FAILED
);
}
static
FORCE_INLINE
void
*
streamQueueCurItem
(
SStreamQueue
*
queue
)
{
return
queue
->
qItem
;
}
void
*
streamQueueNextItem
(
SStreamQueue
*
queue
);
SStreamDataSubmit2
*
streamDataSubmitNew
(
SPackedData
submit
,
int32_t
type
);
...
...
source/libs/executor/src/executor.c
浏览文件 @
dbd79cc8
...
...
@@ -112,7 +112,7 @@ void resetTaskInfo(qTaskInfo_t tinfo) {
clearStreamBlock
(
pTaskInfo
->
pRoot
);
}
static
int32_t
doSetStreamBlock
(
SOperatorInfo
*
pOperator
,
void
*
input
,
size_t
numOfBlocks
,
int32_t
type
,
char
*
id
)
{
static
int32_t
doSetStreamBlock
(
SOperatorInfo
*
pOperator
,
void
*
input
,
size_t
numOfBlocks
,
int32_t
type
,
c
onst
c
har
*
id
)
{
if
(
pOperator
->
operatorType
!=
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
)
{
if
(
pOperator
->
numOfDownstream
==
0
)
{
qError
(
"failed to find stream scan operator to set the input data block, %s"
PRIx64
,
id
);
...
...
@@ -129,7 +129,7 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu
pOperator
->
status
=
OP_NOT_OPENED
;
SStreamScanInfo
*
pInfo
=
pOperator
->
info
;
qDebug
(
"s-task
set source blocks:%d %s"
,
(
int32_t
)
numOfBlocks
,
id
);
qDebug
(
"s-task
:%s set source blocks:%d"
,
id
,
(
int32_t
)
numOfBlocks
);
ASSERT
(
pInfo
->
validBlockIndex
==
0
&&
taosArrayGetSize
(
pInfo
->
pBlockLists
)
==
0
);
if
(
type
==
STREAM_INPUT__MERGED_SUBMIT
)
{
...
...
@@ -144,9 +144,7 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu
}
else
if
(
type
==
STREAM_INPUT__DATA_BLOCK
)
{
for
(
int32_t
i
=
0
;
i
<
numOfBlocks
;
++
i
)
{
SSDataBlock
*
pDataBlock
=
&
((
SSDataBlock
*
)
input
)[
i
];
SPackedData
tmp
=
{
.
pDataBlock
=
pDataBlock
,
};
SPackedData
tmp
=
{
.
pDataBlock
=
pDataBlock
};
taosArrayPush
(
pInfo
->
pBlockLists
,
&
tmp
);
}
pInfo
->
blockType
=
STREAM_INPUT__DATA_BLOCK
;
...
...
source/libs/stream/src/stream.c
浏览文件 @
dbd79cc8
...
...
@@ -345,6 +345,8 @@ int32_t tAppendDataToInputQueue(SStreamTask* pTask, SStreamQueueItem* pItem) {
return
0
;
}
static
void
*
streamQueueCurItem
(
SStreamQueue
*
queue
)
{
return
queue
->
qItem
;
}
void
*
streamQueueNextItem
(
SStreamQueue
*
queue
)
{
int8_t
dequeueFlag
=
atomic_exchange_8
(
&
queue
->
status
,
STREAM_QUEUE__PROCESSING
);
if
(
dequeueFlag
==
STREAM_QUEUE__FAILED
)
{
...
...
source/libs/stream/src/streamData.c
浏览文件 @
dbd79cc8
...
...
@@ -159,7 +159,8 @@ SStreamQueueItem* streamMergeQueueItem(SStreamQueueItem* dst, SStreamQueueItem*
return
dst
;
}
else
if
(
dst
->
type
==
STREAM_INPUT__DATA_SUBMIT
&&
pElem
->
type
==
STREAM_INPUT__DATA_SUBMIT
)
{
SStreamMergedSubmit2
*
pMerged
=
streamMergedSubmitNew
();
ASSERT
(
pMerged
);
// todo handle error
streamMergeSubmit
(
pMerged
,
(
SStreamDataSubmit2
*
)
dst
);
streamMergeSubmit
(
pMerged
,
(
SStreamDataSubmit2
*
)
pElem
);
taosFreeQitem
(
dst
);
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
dbd79cc8
...
...
@@ -66,7 +66,7 @@ static int32_t streamTaskExecImpl(SStreamTask* pTask, const void* data, SArray*
SArray
*
pBlockList
=
pMerged
->
submits
;
int32_t
numOfBlocks
=
taosArrayGetSize
(
pBlockList
);
qDebug
(
"s
t-task:%s %p set submit input (merged), batch num
:%d"
,
pTask
->
id
.
idStr
,
pTask
,
numOfBlocks
);
qDebug
(
"s
-task:%s %p set submit input (merged), numOfblocks
:%d"
,
pTask
->
id
.
idStr
,
pTask
,
numOfBlocks
);
qSetMultiStreamInput
(
pExecutor
,
pBlockList
->
pData
,
numOfBlocks
,
STREAM_INPUT__MERGED_SUBMIT
);
}
else
if
(
pItem
->
type
==
STREAM_INPUT__REF_DATA_BLOCK
)
{
const
SStreamRefDataBlock
*
pRefBlock
=
(
const
SStreamRefDataBlock
*
)
data
;
...
...
@@ -259,9 +259,10 @@ int32_t streamExecForAll(SStreamTask* pTask) {
int32_t
code
=
0
;
while
(
1
)
{
int32_t
batchSize
=
1
;
void
*
pInput
=
NULL
;
int16_t
times
=
0
;
SStreamQueueItem
*
pInput
=
NULL
;
// merge multiple input data if possible in the input queue.
qDebug
(
"s-task:%s start to extract data block from inputQ"
,
pTask
->
id
.
idStr
);
...
...
@@ -274,6 +275,7 @@ int32_t streamExecForAll(SStreamTask* pTask) {
qDebug
(
"===stream===try agian batchSize:%d"
,
batchSize
);
continue
;
}
qDebug
(
"===stream===break batchSize:%d"
,
batchSize
);
break
;
}
...
...
@@ -285,6 +287,7 @@ int32_t streamExecForAll(SStreamTask* pTask) {
break
;
}
}
else
{
// todo we need to sort the data block, instead of just appending into the array list.
void
*
newRet
=
NULL
;
if
((
newRet
=
streamMergeQueueItem
(
pInput
,
qItem
))
==
NULL
)
{
streamQueueProcessFail
(
pTask
->
inputQueue
);
...
...
@@ -304,6 +307,7 @@ int32_t streamExecForAll(SStreamTask* pTask) {
if
(
pInput
)
{
streamFreeQitem
(
pInput
);
}
return
0
;
}
...
...
@@ -312,14 +316,14 @@ int32_t streamExecForAll(SStreamTask* pTask) {
}
if
(
pTask
->
taskLevel
==
TASK_LEVEL__SINK
)
{
ASSERT
(
((
SStreamQueueItem
*
)
pInput
)
->
type
==
STREAM_INPUT__DATA_BLOCK
);
ASSERT
(
pInput
->
type
==
STREAM_INPUT__DATA_BLOCK
);
qDebug
(
"s-task:%s sink node start to sink result. numOfBlocks:%d"
,
pTask
->
id
.
idStr
,
batchSize
);
streamTaskOutput
(
pTask
,
pInput
);
streamTaskOutput
(
pTask
,
(
SStreamDataBlock
*
)
pInput
);
continue
;
}
SArray
*
pRes
=
taosArrayInit
(
0
,
sizeof
(
SSDataBlock
));
qDebug
(
"s-task:%s start to execute,
numOfBlock
s:%d"
,
pTask
->
id
.
idStr
,
batchSize
);
qDebug
(
"s-task:%s start to execute,
block batche
s:%d"
,
pTask
->
id
.
idStr
,
batchSize
);
streamTaskExecImpl
(
pTask
,
pInput
,
pRes
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录