Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b2855339
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看板
提交
b2855339
编写于
7月 22, 2022
作者:
5
54liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(stream): adjust stream scan
上级
1b69d30a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
35 addition
and
32 deletion
+35
-32
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+0
-2
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+30
-28
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+4
-2
source/libs/stream/src/streamUpdate.c
source/libs/stream/src/streamUpdate.c
+1
-0
未找到文件。
source/libs/executor/inc/executorimpl.h
浏览文件 @
b2855339
...
...
@@ -402,8 +402,6 @@ typedef struct SStreamScanInfo {
uint64_t
numOfExec
;
// execution times
STqReader
*
tqReader
;
int32_t
tsArrayIndex
;
SArray
*
tsArray
;
uint64_t
groupId
;
SUpdateInfo
*
pUpdateInfo
;
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
b2855339
...
...
@@ -1247,30 +1247,38 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
return
pBlock
;
}
else
if
(
pInfo
->
blockType
==
STREAM_INPUT__DATA_SUBMIT
)
{
qDebug
(
"scan mode %d"
,
pInfo
->
scanMode
);
if
(
pInfo
->
scanMode
==
STREAM_SCAN_FROM_RES
)
{
blockDataDestroy
(
pInfo
->
pUpdateRes
);
pInfo
->
scanMode
=
STREAM_SCAN_FROM_READERHANDLE
;
return
pInfo
->
pRes
;
}
else
if
(
pInfo
->
scanMode
==
STREAM_SCAN_FROM_UPDATERES
)
{
generateScanRange
(
pInfo
,
pInfo
->
pUpdateDataRes
,
pInfo
->
pUpdateRes
);
pInfo
->
scanMode
=
STREAM_SCAN_FROM_DATAREADER_RANGE
;
prepareRangeScan
(
pInfo
,
pInfo
->
pUpdateRes
,
&
pInfo
->
updateResIndex
);
return
pInfo
->
pUpdateRes
;
}
else
if
(
pInfo
->
scanMode
==
STREAM_SCAN_FROM_DATAREADER_RANGE
||
pInfo
->
scanMode
==
STREAM_SCAN_FROM_DATAREADER_RETRIEVE
)
{
SSDataBlock
*
pSDB
=
doRangeScan
(
pInfo
,
pInfo
->
pUpdateRes
,
pInfo
->
primaryTsIndex
,
&
pInfo
->
updateResIndex
);
if
(
pSDB
)
{
pSDB
->
info
.
type
=
pInfo
->
scanMode
==
STREAM_SCAN_FROM_DATAREADER_RANGE
?
STREAM_NORMAL
:
STREAM_PULL_DATA
;
checkUpdateData
(
pInfo
,
true
,
pSDB
,
false
);
return
pSDB
;
}
pInfo
->
scanMode
=
STREAM_SCAN_FROM_READERHANDLE
;
switch
(
pInfo
->
scanMode
)
{
case
STREAM_SCAN_FROM_RES
:
{
blockDataDestroy
(
pInfo
->
pUpdateRes
);
pInfo
->
scanMode
=
STREAM_SCAN_FROM_READERHANDLE
;
return
pInfo
->
pRes
;
}
break
;
case
STREAM_SCAN_FROM_UPDATERES
:
{
generateScanRange
(
pInfo
,
pInfo
->
pUpdateDataRes
,
pInfo
->
pUpdateRes
);
prepareRangeScan
(
pInfo
,
pInfo
->
pUpdateRes
,
&
pInfo
->
updateResIndex
);
pInfo
->
scanMode
=
STREAM_SCAN_FROM_DATAREADER_RANGE
;
return
pInfo
->
pUpdateRes
;
}
break
;
case
STREAM_SCAN_FROM_DATAREADER_RANGE
:
case
STREAM_SCAN_FROM_DATAREADER_RETRIEVE
:
{
SSDataBlock
*
pSDB
=
doRangeScan
(
pInfo
,
pInfo
->
pUpdateRes
,
pInfo
->
primaryTsIndex
,
&
pInfo
->
updateResIndex
);
if
(
pSDB
)
{
pSDB
->
info
.
type
=
pInfo
->
scanMode
==
STREAM_SCAN_FROM_DATAREADER_RANGE
?
STREAM_NORMAL
:
STREAM_PULL_DATA
;
checkUpdateData
(
pInfo
,
true
,
pSDB
,
false
);
return
pSDB
;
}
pInfo
->
scanMode
=
STREAM_SCAN_FROM_READERHANDLE
;
}
break
;
default:
break
;
}
if
(
isStateWindow
(
pInfo
)
&&
pInfo
->
sessionSup
.
pStreamAggSup
->
pScanBlock
->
info
.
rows
>
0
)
{
SStreamAggSupporter
*
pSup
=
pInfo
->
sessionSup
.
pStreamAggSup
;
if
(
isStateWindow
(
pInfo
)
&&
pSup
->
pScanBlock
->
info
.
rows
>
0
)
{
pInfo
->
scanMode
=
STREAM_SCAN_FROM_DATAREADER_RANGE
;
pInfo
->
updateResIndex
=
0
;
copyDataBlock
(
pInfo
->
pUpdateRes
,
p
Info
->
sessionSup
.
pStreamAgg
Sup
->
pScanBlock
);
blockDataCleanup
(
p
Info
->
sessionSup
.
pStreamAgg
Sup
->
pScanBlock
);
copyDataBlock
(
pInfo
->
pUpdateRes
,
pSup
->
pScanBlock
);
blockDataCleanup
(
pSup
->
pScanBlock
);
prepareRangeScan
(
pInfo
,
pInfo
->
pUpdateRes
,
&
pInfo
->
updateResIndex
);
return
pInfo
->
pUpdateRes
;
}
...
...
@@ -1329,7 +1337,6 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
updateInfoDestoryColseWinSBF
(
pInfo
->
pUpdateInfo
);
/*pOperator->status = OP_EXEC_DONE;*/
}
else
if
(
pInfo
->
pUpdateInfo
)
{
pInfo
->
tsArrayIndex
=
0
;
checkUpdateData
(
pInfo
,
true
,
pInfo
->
pRes
,
true
);
pInfo
->
twAggSup
.
maxTs
=
TMAX
(
pInfo
->
twAggSup
.
maxTs
,
pBlockInfo
->
window
.
ekey
);
if
(
pInfo
->
pUpdateDataRes
->
info
.
rows
>
0
)
{
...
...
@@ -1387,7 +1394,7 @@ static void destroyStreamScanOperatorInfo(void* param, int32_t numOfOutput) {
#if 1
if
(
pStreamScan
->
pTableScanOp
&&
pStreamScan
->
pTableScanOp
->
info
)
{
STableScanInfo
*
pTableScanInfo
=
pStreamScan
->
pTableScanOp
->
info
;
destroyTableScanOperatorInfo
(
pTableScanInfo
,
1
);
destroyTableScanOperatorInfo
(
pTableScanInfo
,
numOfOutput
);
}
#endif
if
(
pStreamScan
->
tqReader
)
{
...
...
@@ -1401,8 +1408,8 @@ static void destroyStreamScanOperatorInfo(void* param, int32_t numOfOutput) {
blockDataDestroy
(
pStreamScan
->
pUpdateRes
);
blockDataDestroy
(
pStreamScan
->
pPullDataRes
);
blockDataDestroy
(
pStreamScan
->
pDeleteDataRes
);
blockDataDestroy
(
pStreamScan
->
pUpdateDataRes
);
taosArrayDestroy
(
pStreamScan
->
pBlockLists
);
taosArrayDestroy
(
pStreamScan
->
tsArray
);
taosMemoryFree
(
pStreamScan
);
}
...
...
@@ -1444,11 +1451,6 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys
goto
_error
;
}
pInfo
->
tsArray
=
taosArrayInit
(
4
,
sizeof
(
int32_t
));
if
(
pInfo
->
tsArray
==
NULL
)
{
goto
_error
;
}
if
(
pHandle
->
vnode
)
{
SOperatorInfo
*
pTableScanOp
=
createTableScanOperatorInfo
(
pTableScanNode
,
pHandle
,
pTaskInfo
);
STableScanInfo
*
pTSInfo
=
(
STableScanInfo
*
)
pTableScanOp
->
info
;
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
b2855339
...
...
@@ -1648,6 +1648,7 @@ void destroyStreamFinalIntervalOperatorInfo(void* param, int32_t numOfOutput) {
}
}
nodesDestroyNode
((
SNode
*
)
pInfo
->
pPhyNode
);
colDataDestroy
(
&
pInfo
->
twAggSup
.
timeWindowData
);
taosMemoryFreeClear
(
param
);
}
...
...
@@ -2934,9 +2935,10 @@ SSDataBlock* createSpecialDataBlock(EStreamType type) {
pBlock
->
info
.
groupId
=
0
;
pBlock
->
info
.
rows
=
0
;
pBlock
->
info
.
type
=
type
;
pBlock
->
info
.
rowSize
=
sizeof
(
TSKEY
)
+
sizeof
(
TSKEY
)
+
sizeof
(
uint64_t
);
pBlock
->
info
.
rowSize
=
sizeof
(
TSKEY
)
+
sizeof
(
TSKEY
)
+
sizeof
(
uint64_t
)
+
sizeof
(
uint64_t
)
+
sizeof
(
TSKEY
)
+
sizeof
(
TSKEY
);
pBlock
->
pDataBlock
=
taosArrayInit
(
3
,
sizeof
(
SColumnInfoData
));
pBlock
->
pDataBlock
=
taosArrayInit
(
6
,
sizeof
(
SColumnInfoData
));
SColumnInfoData
infoData
=
{
0
};
infoData
.
info
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
;
infoData
.
info
.
bytes
=
sizeof
(
TSKEY
);
...
...
source/libs/stream/src/streamUpdate.c
浏览文件 @
b2855339
...
...
@@ -207,6 +207,7 @@ void updateInfoDestroy(SUpdateInfo *pInfo) {
}
taosArrayDestroy
(
pInfo
->
pTsSBFs
);
taosHashCleanup
(
pInfo
->
pMap
);
taosMemoryFree
(
pInfo
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录