Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ba0c1b36
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看板
提交
ba0c1b36
编写于
7月 27, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(stream)
上级
5e1bbe0e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
20 deletion
+19
-20
include/libs/executor/executor.h
include/libs/executor/executor.h
+0
-9
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+2
-2
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+0
-4
source/libs/stream/src/streamDispatch.c
source/libs/stream/src/streamDispatch.c
+16
-4
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+1
-1
未找到文件。
include/libs/executor/executor.h
浏览文件 @
ba0c1b36
...
...
@@ -66,15 +66,6 @@ qTaskInfo_t qCreateStreamExecTaskInfo(void* msg, SReadHandle* readers);
*/
qTaskInfo_t
qCreateQueueExecTaskInfo
(
void
*
msg
,
SReadHandle
*
readers
,
int32_t
*
numOfCols
,
SSchemaWrapper
**
pSchema
);
/**
* Set the input data block for the stream scan.
* @param tinfo
* @param input
* @param type
* @return
*/
int32_t
qSetStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
input
,
int32_t
type
);
/**
* Set multiple input data blocks for the stream scan.
* @param tinfo
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
ba0c1b36
...
...
@@ -644,7 +644,7 @@ static int32_t tdExecuteRSmaImpl(SSma *pSma, const void *pMsg, int32_t inputType
smaDebug
(
"vgId:%d, execute rsma %"
PRIi8
" task for qTaskInfo:%p suid:%"
PRIu64
,
SMA_VID
(
pSma
),
level
,
pItem
->
taskInfo
,
suid
);
if
(
qSet
StreamInput
(
pItem
->
taskInfo
,
pMsg
,
inputType
)
<
0
)
{
// INPUT__DATA_SUBMIT
if
(
qSet
MultiStreamInput
(
pItem
->
taskInfo
,
pMsg
,
1
,
inputType
)
<
0
)
{
// INPUT__DATA_SUBMIT
smaError
(
"vgId:%d, rsma % "
PRIi8
" qSetStreamInput failed since %s"
,
SMA_VID
(
pSma
),
level
,
tstrerror
(
terrno
));
return
TSDB_CODE_FAILED
;
}
...
...
@@ -1329,7 +1329,7 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) {
tdRefRSmaInfo
(
pSma
,
pRSmaInfo
);
SSDataBlock
dataBlock
=
{.
info
.
type
=
STREAM_GET_ALL
};
qSet
StreamInput
(
pItem
->
taskInfo
,
&
dataBlock
,
STREAM_INPUT__DATA_BLOCK
);
qSet
MultiStreamInput
(
pItem
->
taskInfo
,
&
dataBlock
,
1
,
STREAM_INPUT__DATA_BLOCK
);
tdRSmaFetchAndSubmitResult
(
pItem
,
pRSmaInfo
->
pTSchema
,
pRSmaInfo
->
suid
,
pStat
,
STREAM_INPUT__DATA_BLOCK
);
tdUnRefRSmaInfo
(
pSma
,
pRSmaInfo
);
...
...
source/libs/executor/src/executor.c
浏览文件 @
ba0c1b36
...
...
@@ -94,10 +94,6 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu
}
}
int32_t
qSetStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
input
,
int32_t
type
)
{
return
qSetMultiStreamInput
(
tinfo
,
input
,
1
,
type
);
}
int32_t
qSetMultiStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
pBlocks
,
size_t
numOfBlocks
,
int32_t
type
)
{
if
(
tinfo
==
NULL
)
{
return
TSDB_CODE_QRY_APP_ERROR
;
...
...
source/libs/stream/src/streamDispatch.c
浏览文件 @
ba0c1b36
...
...
@@ -227,6 +227,8 @@ int32_t streamDispatchOneReq(SStreamTask* pTask, const SStreamDispatchReq* pReq,
msg
.
pCont
=
buf
;
msg
.
msgType
=
pTask
->
dispatchMsgType
;
qDebug
(
"dispatch from task %d to task %d node %d"
,
pTask
->
taskId
,
pReq
->
taskId
,
vgId
);
tmsgSendReq
(
pEpSet
,
&
msg
);
code
=
0
;
...
...
@@ -281,8 +283,10 @@ int32_t streamDispatchAllBlocks(SStreamTask* pTask, const SStreamDataBlock* pDat
return
code
;
}
else
if
(
pTask
->
dispatchType
==
TASK_DISPATCH__SHUFFLE
)
{
SArray
*
vgInfo
=
pTask
->
shuffleDispatcher
.
dbInfo
.
pVgroupInfos
;
ASSERT
(
pTask
->
shuffleDispatcher
.
waitingRspCnt
==
0
);
int32_t
rspCnt
=
atomic_load_32
(
&
pTask
->
shuffleDispatcher
.
waitingRspCnt
);
ASSERT
(
rspCnt
==
0
);
SArray
*
vgInfo
=
pTask
->
shuffleDispatcher
.
dbInfo
.
pVgroupInfos
;
int32_t
vgSz
=
taosArrayGetSize
(
vgInfo
);
SStreamDispatchReq
*
pReqs
=
taosMemoryCalloc
(
vgSz
,
sizeof
(
SStreamDispatchReq
));
if
(
pReqs
==
NULL
)
{
...
...
@@ -301,7 +305,10 @@ int32_t streamDispatchAllBlocks(SStreamTask* pTask, const SStreamDataBlock* pDat
if
(
pReqs
[
i
].
data
==
NULL
||
pReqs
[
i
].
dataLen
==
NULL
)
{
goto
FAIL_SHUFFLE_DISPATCH
;
}
SVgroupInfo
*
pVgInfo
=
taosArrayGet
(
vgInfo
,
i
);
pReqs
[
i
].
taskId
=
pVgInfo
->
taskId
;
}
for
(
int32_t
i
=
0
;
i
<
blockNum
;
i
++
)
{
SSDataBlock
*
pDataBlock
=
taosArrayGet
(
pData
->
blocks
,
i
);
char
*
ctbName
=
buildCtbNameByGroupId
(
pTask
->
shuffleDispatcher
.
stbFullName
,
pDataBlock
->
info
.
groupId
);
...
...
@@ -309,6 +316,9 @@ int32_t streamDispatchAllBlocks(SStreamTask* pTask, const SStreamDataBlock* pDat
// TODO: get hash function by hashMethod
uint32_t
hashValue
=
MurmurHash3_32
(
ctbName
,
strlen
(
ctbName
));
taosMemoryFree
(
ctbName
);
bool
found
=
false
;
// TODO: optimize search
int32_t
j
;
for
(
j
=
0
;
j
<
vgSz
;
j
++
)
{
...
...
@@ -318,12 +328,14 @@ int32_t streamDispatchAllBlocks(SStreamTask* pTask, const SStreamDataBlock* pDat
if
(
streamAddBlockToDispatchMsg
(
pDataBlock
,
&
pReqs
[
j
])
<
0
)
{
goto
FAIL_SHUFFLE_DISPATCH
;
}
pReqs
[
j
].
taskId
=
pVgInfo
->
taskId
;
pReqs
[
j
].
blockNum
++
;
found
=
true
;
break
;
}
}
ASSERT
(
found
);
}
for
(
int32_t
i
=
0
;
i
<
vgSz
;
i
++
)
{
if
(
pReqs
[
i
].
blockNum
>
0
)
{
// send
...
...
@@ -331,7 +343,7 @@ int32_t streamDispatchAllBlocks(SStreamTask* pTask, const SStreamDataBlock* pDat
if
(
streamDispatchOneReq
(
pTask
,
&
pReqs
[
i
],
pVgInfo
->
vgId
,
&
pVgInfo
->
epSet
)
<
0
)
{
goto
FAIL_SHUFFLE_DISPATCH
;
}
pTask
->
shuffleDispatcher
.
waitingRspCnt
++
;
atomic_add_fetch_32
(
&
pTask
->
shuffleDispatcher
.
waitingRspCnt
,
1
)
;
}
}
code
=
0
;
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
ba0c1b36
...
...
@@ -27,7 +27,7 @@ static int32_t streamTaskExecImpl(SStreamTask* pTask, void* data, SArray* pRes)
ASSERT
(
pTask
->
isDataScan
);
SStreamDataSubmit
*
pSubmit
=
(
SStreamDataSubmit
*
)
data
;
qDebug
(
"task %d %p set submit input %p %p %d 1"
,
pTask
->
taskId
,
pTask
,
pSubmit
,
pSubmit
->
data
,
*
pSubmit
->
dataRef
);
qSet
StreamInput
(
exec
,
pSubmit
->
data
,
STREAM_INPUT__DATA_SUBMIT
);
qSet
MultiStreamInput
(
exec
,
pSubmit
->
data
,
1
,
STREAM_INPUT__DATA_SUBMIT
);
}
else
if
(
pItem
->
type
==
STREAM_INPUT__DATA_BLOCK
||
pItem
->
type
==
STREAM_INPUT__DATA_RETRIEVE
)
{
SStreamDataBlock
*
pBlock
=
(
SStreamDataBlock
*
)
data
;
SArray
*
blocks
=
pBlock
->
blocks
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录