Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
069778c6
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看板
提交
069778c6
编写于
7月 16, 2022
作者:
5
54liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(stream): add log
上级
e4152b43
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
29 addition
and
25 deletion
+29
-25
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+1
-1
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+28
-24
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
069778c6
...
...
@@ -1752,7 +1752,7 @@ char* dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf)
int32_t
colNum
=
taosArrayGetSize
(
pDataBlock
->
pDataBlock
);
int32_t
rows
=
pDataBlock
->
info
.
rows
;
int32_t
len
=
0
;
len
+=
snprintf
(
dumpBuf
+
len
,
size
-
len
,
"
%s |block type %d |child id %d|group id:%"
PRIu64
"| uid:%ld|======
\n
"
,
"dumpBlockData"
,
len
+=
snprintf
(
dumpBuf
+
len
,
size
-
len
,
"
===stream===%s |block type %d |child id %d|group id:%"
PRIu64
"| uid:%ld|
\n
"
,
flag
,
(
int32_t
)
pDataBlock
->
info
.
type
,
pDataBlock
->
info
.
childId
,
pDataBlock
->
info
.
groupId
,
pDataBlock
->
info
.
uid
);
if
(
len
>=
size
-
1
)
return
dumpBuf
;
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
069778c6
...
...
@@ -1353,13 +1353,13 @@ static int32_t closeIntervalWindow(SHashObj* pHashMap, STimeWindowAggSupp* pSup,
if
(
chIds
&&
pPullDataMap
)
{
SArray
*
chAy
=
*
(
SArray
**
)
chIds
;
int32_t
size
=
taosArrayGetSize
(
chAy
);
qDebug
(
"window %"
PRId64
" wait child size:%d"
,
win
.
skey
,
size
);
qDebug
(
"
===stream===
window %"
PRId64
" wait child size:%d"
,
win
.
skey
,
size
);
for
(
int32_t
i
=
0
;
i
<
size
;
i
++
)
{
qDebug
(
"window %"
PRId64
" wait child id:%d"
,
win
.
skey
,
*
(
int32_t
*
)
taosArrayGet
(
chAy
,
i
));
qDebug
(
"
===stream===
window %"
PRId64
" wait child id:%d"
,
win
.
skey
,
*
(
int32_t
*
)
taosArrayGet
(
chAy
,
i
));
}
continue
;
}
else
if
(
pPullDataMap
)
{
qDebug
(
"close window %"
PRId64
,
win
.
skey
);
qDebug
(
"
===stream===
close window %"
PRId64
,
win
.
skey
);
}
SResultRowPosition
*
pPos
=
(
SResultRowPosition
*
)
pIte
;
if
(
pSup
->
calTrigger
==
STREAM_TRIGGER_WINDOW_CLOSE
)
{
...
...
@@ -2482,7 +2482,9 @@ static void doHashInterval(SOperatorInfo* pOperatorInfo, SSDataBlock* pSDataBloc
SPullWindowInfo
pull
=
{.
window
=
nextWin
,
.
groupId
=
tableGroupId
};
// add pull data request
taosArrayPush
(
pInfo
->
pPullWins
,
&
pull
);
addPullWindow
(
pInfo
->
pPullDataMap
,
&
winRes
,
taosArrayGetSize
(
pInfo
->
pChildren
));
int32_t
size
=
taosArrayGetSize
(
pInfo
->
pChildren
);
addPullWindow
(
pInfo
->
pPullDataMap
,
&
winRes
,
size
);
qDebug
(
"===stream===prepare retrive %"
PRId64
", size:%d"
,
winRes
.
ts
,
size
);
}
else
{
int32_t
index
=
-
1
;
SArray
*
chArray
=
NULL
;
...
...
@@ -2492,14 +2494,14 @@ static void doHashInterval(SOperatorInfo* pOperatorInfo, SSDataBlock* pSDataBloc
chId
=
getChildIndex
(
pSDataBlock
);
index
=
taosArraySearchIdx
(
chArray
,
&
chId
,
compareInt32Val
,
TD_EQ
);
}
if
(
index
!=
-
1
&&
pSDataBlock
->
info
.
type
==
STREAM_PULL_DATA
)
{
qDebug
(
"===
===delete child id %d"
,
chId
);
taosArrayRemove
(
chArray
,
index
);
if
(
taosArrayGetSize
(
chArray
)
==
0
)
{
// pull data is over
taosHashRemove
(
pInfo
->
pPullDataMap
,
&
winRes
,
sizeof
(
SWinRes
));
}
}
//
if (index != -1 && pSDataBlock->info.type == STREAM_PULL_DATA) {
// qDebug("===stream
===delete child id %d", chId);
//
taosArrayRemove(chArray, index);
//
if (taosArrayGetSize(chArray) == 0) {
//
// pull data is over
//
taosHashRemove(pInfo->pPullDataMap, &winRes, sizeof(SWinRes));
//
}
//
}
if
(
index
==
-
1
||
pSDataBlock
->
info
.
type
==
STREAM_PULL_DATA
)
{
ignore
=
false
;
}
...
...
@@ -2623,6 +2625,7 @@ void processPullOver(SSDataBlock* pBlock, SHashObj* pMap) {
SArray
*
chArray
=
*
(
SArray
**
)
chIds
;
int32_t
index
=
taosArraySearchIdx
(
chArray
,
&
chId
,
compareInt32Val
,
TD_EQ
);
if
(
index
!=
-
1
)
{
qDebug
(
"===stream===window %"
PRId64
" delete child id %d"
,
winRes
.
ts
,
chId
);
taosArrayRemove
(
chArray
,
index
);
if
(
taosArrayGetSize
(
chArray
)
==
0
)
{
// pull data is over
...
...
@@ -2641,7 +2644,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
SExprSupp
*
pSup
=
&
pOperator
->
exprSupp
;
qDebug
(
"interval status %d %s"
,
pOperator
->
status
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval
Semi"
);
qDebug
(
"interval status %d %s"
,
pOperator
->
status
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval Semi"
);
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
return
NULL
;
...
...
@@ -2657,18 +2660,18 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
}
return
NULL
;
}
printDataBlock
(
pInfo
->
binfo
.
pRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval
Semi"
);
printDataBlock
(
pInfo
->
binfo
.
pRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval Semi"
);
return
pInfo
->
binfo
.
pRes
;
}
else
{
doBuildResultDatablock
(
pOperator
,
&
pInfo
->
binfo
,
&
pInfo
->
groupResInfo
,
pInfo
->
aggSup
.
pResultBuf
);
if
(
pInfo
->
binfo
.
pRes
->
info
.
rows
!=
0
)
{
printDataBlock
(
pInfo
->
binfo
.
pRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval
Semi"
);
printDataBlock
(
pInfo
->
binfo
.
pRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval Semi"
);
return
pInfo
->
binfo
.
pRes
;
}
if
(
pInfo
->
pUpdateRes
->
info
.
rows
!=
0
&&
pInfo
->
returnUpdate
)
{
pInfo
->
returnUpdate
=
false
;
ASSERT
(
!
IS_FINAL_OP
(
pInfo
));
printDataBlock
(
pInfo
->
pUpdateRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval
Semi"
);
printDataBlock
(
pInfo
->
pUpdateRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval Semi"
);
// process the rest of the data
return
pInfo
->
pUpdateRes
;
}
...
...
@@ -2676,13 +2679,13 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
if
(
pInfo
->
pPullDataRes
->
info
.
rows
!=
0
)
{
// process the rest of the data
ASSERT
(
IS_FINAL_OP
(
pInfo
));
printDataBlock
(
pInfo
->
pPullDataRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval
Semi"
);
printDataBlock
(
pInfo
->
pPullDataRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval Semi"
);
return
pInfo
->
pPullDataRes
;
}
doBuildDeleteResult
(
pInfo
->
pDelWins
,
&
pInfo
->
delIndex
,
pInfo
->
pDelRes
);
if
(
pInfo
->
pDelRes
->
info
.
rows
!=
0
)
{
// process the rest of the data
printDataBlock
(
pInfo
->
pDelRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval
Semi"
);
printDataBlock
(
pInfo
->
pDelRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval Semi"
);
return
pInfo
->
pDelRes
;
}
}
...
...
@@ -2693,10 +2696,10 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
clearSpecialDataBlock
(
pInfo
->
pUpdateRes
);
removeDeleteResults
(
pUpdated
,
pInfo
->
pDelWins
);
pOperator
->
status
=
OP_RES_TO_RETURN
;
qDebug
(
"%s return data"
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval
Semi"
);
qDebug
(
"%s return data"
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval Semi"
);
break
;
}
printDataBlock
(
pBlock
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final recv"
:
"interval
Semi recv"
);
printDataBlock
(
pBlock
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final recv"
:
"interval Semi recv"
);
maxTs
=
TMAX
(
maxTs
,
pBlock
->
info
.
window
.
ekey
);
if
(
pBlock
->
info
.
type
==
STREAM_NORMAL
||
pBlock
->
info
.
type
==
STREAM_PULL_DATA
||
...
...
@@ -2771,6 +2774,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
SStreamFinalIntervalOperatorInfo
*
pTmpInfo
=
pChildOp
->
info
;
pTmpInfo
->
twAggSup
.
calTrigger
=
STREAM_TRIGGER_AT_ONCE
;
taosArrayPush
(
pInfo
->
pChildren
,
&
pChildOp
);
qDebug
(
"===stream===add child, id:%d"
,
chIndex
);
}
SOperatorInfo
*
pChildOp
=
taosArrayGetP
(
pInfo
->
pChildren
,
chIndex
);
SStreamFinalIntervalOperatorInfo
*
pChInfo
=
pChildOp
->
info
;
...
...
@@ -2795,14 +2799,14 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
blockDataEnsureCapacity
(
pInfo
->
binfo
.
pRes
,
pOperator
->
resultInfo
.
capacity
);
doBuildResultDatablock
(
pOperator
,
&
pInfo
->
binfo
,
&
pInfo
->
groupResInfo
,
pInfo
->
aggSup
.
pResultBuf
);
if
(
pInfo
->
binfo
.
pRes
->
info
.
rows
!=
0
)
{
printDataBlock
(
pInfo
->
binfo
.
pRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval
Semi"
);
printDataBlock
(
pInfo
->
binfo
.
pRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval Semi"
);
return
pInfo
->
binfo
.
pRes
;
}
if
(
pInfo
->
pUpdateRes
->
info
.
rows
!=
0
&&
pInfo
->
returnUpdate
)
{
pInfo
->
returnUpdate
=
false
;
ASSERT
(
!
IS_FINAL_OP
(
pInfo
));
printDataBlock
(
pInfo
->
pUpdateRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval
Semi"
);
printDataBlock
(
pInfo
->
pUpdateRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval Semi"
);
// process the rest of the data
return
pInfo
->
pUpdateRes
;
}
...
...
@@ -2811,14 +2815,14 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
if
(
pInfo
->
pPullDataRes
->
info
.
rows
!=
0
)
{
// process the rest of the data
ASSERT
(
IS_FINAL_OP
(
pInfo
));
printDataBlock
(
pInfo
->
pPullDataRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval
Semi"
);
printDataBlock
(
pInfo
->
pPullDataRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval Semi"
);
return
pInfo
->
pPullDataRes
;
}
doBuildDeleteResult
(
pInfo
->
pDelWins
,
&
pInfo
->
delIndex
,
pInfo
->
pDelRes
);
if
(
pInfo
->
pDelRes
->
info
.
rows
!=
0
)
{
// process the rest of the data
printDataBlock
(
pInfo
->
pDelRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval
Semi"
);
printDataBlock
(
pInfo
->
pDelRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval Final"
:
"interval Semi"
);
return
pInfo
->
pDelRes
;
}
// ASSERT(false);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录