Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
795503cc
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
795503cc
编写于
5月 22, 2021
作者:
sangshuduo
提交者:
GitHub
5月 22, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-4296]<fix>: taosdemo sub keepProgress. (#6201)
Co-authored-by:
N
Shuduo Sang
<
sdsang@taosdata.com
>
上级
2d43e7f0
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
21 addition
and
14 deletion
+21
-14
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+21
-14
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
795503cc
...
...
@@ -403,7 +403,7 @@ typedef struct SuperQueryInfo_S {
uint64_t
sqlCount
;
char
sql
[
MAX_QUERY_SQL_COUNT
][
MAX_QUERY_SQL_LENGTH
+
1
];
char
result
[
MAX_QUERY_SQL_COUNT
][
MAX_FILE_NAME_LEN
+
1
];
int
resubAfterConsume
[
MAX_QUERY_SQL_COUNT
]
;
int
resubAfterConsume
;
TAOS_SUB
*
tsub
[
MAX_QUERY_SQL_COUNT
];
char
*
childTblName
;
...
...
@@ -4495,6 +4495,18 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
g_queryInfo
.
superQueryInfo
.
subscribeKeepProgress
=
0
;
}
cJSON
*
superResubAfterConsume
=
cJSON_GetObjectItem
(
superQuery
,
"resubAfterConsume"
);
if
(
superResubAfterConsume
&&
superResubAfterConsume
->
type
==
cJSON_Number
)
{
g_queryInfo
.
superQueryInfo
.
resubAfterConsume
=
superResubAfterConsume
->
valueint
;
}
else
if
(
!
superResubAfterConsume
)
{
//printf("failed to read json, subscribe interval no found\n");
////goto PARSE_OVER;
g_queryInfo
.
superQueryInfo
.
resubAfterConsume
=
1
;
}
// sqls
cJSON
*
subsqls
=
cJSON_GetObjectItem
(
superQuery
,
"sqls"
);
if
(
!
subsqls
)
{
...
...
@@ -4526,18 +4538,6 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
tstrncpy
(
g_queryInfo
.
superQueryInfo
.
sql
[
j
],
sqlStr
->
valuestring
,
MAX_QUERY_SQL_LENGTH
);
cJSON
*
superResubAfterConsume
=
cJSON_GetObjectItem
(
sql
,
"resubAfterConsume"
);
if
(
superResubAfterConsume
&&
superResubAfterConsume
->
type
==
cJSON_Number
)
{
g_queryInfo
.
superQueryInfo
.
resubAfterConsume
[
j
]
=
superResubAfterConsume
->
valueint
;
}
else
if
(
!
superResubAfterConsume
)
{
//printf("failed to read json, subscribe interval no found\n");
//goto PARSE_OVER;
g_queryInfo
.
superQueryInfo
.
resubAfterConsume
[
j
]
=
1
;
}
cJSON
*
result
=
cJSON_GetObjectItem
(
sql
,
"result"
);
if
(
result
!=
NULL
&&
result
->
type
==
cJSON_String
&&
result
->
valuestring
!=
NULL
){
...
...
@@ -6855,6 +6855,8 @@ static void *superSubscribe(void *sarg) {
}
TAOS_RES
*
res
=
NULL
;
uint64_t
st
=
0
,
et
=
0
;
while
(
1
)
{
for
(
uint64_t
i
=
pThreadInfo
->
start_table_from
;
i
<=
pThreadInfo
->
end_table_to
;
i
++
)
{
...
...
@@ -6863,7 +6865,12 @@ static void *superSubscribe(void *sarg) {
continue
;
}
st
=
taosGetTimestampMs
();
performancePrint
(
"st: %"
PRIu64
" et: %"
PRIu64
" st-et: %"
PRIu64
"
\n
"
,
st
,
et
,
(
st
-
et
));
res
=
taos_consume
(
tsub
[
tsubSeq
]);
et
=
taosGetTimestampMs
();
performancePrint
(
"st: %"
PRIu64
" et: %"
PRIu64
" delta: %"
PRIu64
"
\n
"
,
st
,
et
,
(
et
-
st
));
if
(
res
)
{
if
(
g_queryInfo
.
superQueryInfo
.
result
[
pThreadInfo
->
querySeq
][
0
]
!=
0
)
{
sprintf
(
pThreadInfo
->
fp
,
"%s-%d"
,
...
...
@@ -6881,7 +6888,7 @@ static void *superSubscribe(void *sarg) {
if
((
g_queryInfo
.
superQueryInfo
.
subscribeKeepProgress
)
&&
(
consumed
[
tsubSeq
]
>=
g_queryInfo
.
superQueryInfo
.
resubAfterConsume
[
pThreadInfo
->
querySeq
]
))
{
g_queryInfo
.
superQueryInfo
.
resubAfterConsume
))
{
printf
(
"keepProgress:%d, resub super table query: %"
PRIu64
"
\n
"
,
g_queryInfo
.
superQueryInfo
.
subscribeKeepProgress
,
pThreadInfo
->
querySeq
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录