Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f5e4cdd1
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看板
提交
f5e4cdd1
编写于
5月 19, 2021
作者:
S
Shuduo Sang
3
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-4238]<fix>: taosdemo async subscribe.
interval.
上级
c282e038
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
10 deletion
+27
-10
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+27
-10
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
f5e4cdd1
...
...
@@ -114,12 +114,18 @@ typedef enum TALBE_EXISTS_EN {
TBL_EXISTS_BUTT
}
TALBE_EXISTS_EN
;
enum
MODE
{
enum
enumSYNC_
MODE
{
SYNC_MODE
,
ASYNC_MODE
,
MODE_BUT
};
typedef
enum
enumQUERY_CLASS
{
SPECIFIED_CLASS
,
STABLE_CLASS
,
CLASS_BUT
}
QUERY_CLASS
;
typedef
enum
enum_INSERT_MODE
{
PROGRESSIVE_INSERT_MODE
,
INTERLACE_INSERT_MODE
,
...
...
@@ -6557,18 +6563,21 @@ static void specified_sub_callback(
}
static
TAOS_SUB
*
subscribeImpl
(
QUERY_CLASS
class
,
threadInfo
*
pThreadInfo
,
char
*
sql
,
char
*
topic
,
bool
restart
)
char
*
sql
,
char
*
topic
,
bool
restart
,
uint64_t
interval
)
{
TAOS_SUB
*
tsub
=
NULL
;
if
(
ASYNC_MODE
==
g_queryInfo
.
specifiedQueryInfo
.
asyncMode
)
{
if
((
SPECIFIED_CLASS
==
class
)
&&
(
ASYNC_MODE
==
g_queryInfo
.
specifiedQueryInfo
.
asyncMode
))
{
tsub
=
taos_subscribe
(
pThreadInfo
->
taos
,
restart
,
topic
,
sql
,
specified_sub_callback
,
(
void
*
)
pThreadInfo
,
g_queryInfo
.
specifiedQueryInfo
.
subscribeInterval
);
}
else
if
(
ASYNC_MODE
==
g_queryInfo
.
superQueryInfo
.
asyncMode
)
{
}
else
if
((
STABLE_CLASS
==
class
)
&&
(
ASYNC_MODE
==
g_queryInfo
.
superQueryInfo
.
asyncMode
))
{
tsub
=
taos_subscribe
(
pThreadInfo
->
taos
,
restart
,
...
...
@@ -6578,7 +6587,7 @@ static TAOS_SUB* subscribeImpl(
tsub
=
taos_subscribe
(
pThreadInfo
->
taos
,
restart
,
topic
,
sql
,
NULL
,
NULL
,
0
);
topic
,
sql
,
NULL
,
NULL
,
interval
);
}
if
(
tsub
==
NULL
)
{
...
...
@@ -6644,8 +6653,10 @@ static void *superSubscribe(void *sarg) {
debugPrint
(
"%s() LN%d, [%d] subSqlstr: %s
\n
"
,
__func__
,
__LINE__
,
pThreadInfo
->
threadID
,
subSqlstr
);
tsub
[
i
]
=
subscribeImpl
(
STABLE_CLASS
,
pThreadInfo
,
subSqlstr
,
topic
,
g_queryInfo
.
superQueryInfo
.
subscribeRestart
);
g_queryInfo
.
superQueryInfo
.
subscribeRestart
,
g_queryInfo
.
superQueryInfo
.
subscribeInterval
);
if
(
NULL
==
tsub
[
i
])
{
taos_close
(
pThreadInfo
->
taos
);
return
NULL
;
...
...
@@ -6687,8 +6698,10 @@ static void *superSubscribe(void *sarg) {
g_queryInfo
.
superQueryInfo
.
subscribeKeepProgress
);
consumed
[
i
]
=
0
;
tsub
[
i
]
=
subscribeImpl
(
STABLE_CLASS
,
pThreadInfo
,
subSqlstr
,
topic
,
g_queryInfo
.
superQueryInfo
.
subscribeRestart
g_queryInfo
.
superQueryInfo
.
subscribeRestart
,
g_queryInfo
.
superQueryInfo
.
subscribeInterval
);
if
(
NULL
==
tsub
[
i
])
{
taos_close
(
pThreadInfo
->
taos
);
...
...
@@ -6744,10 +6757,12 @@ static void *specifiedSubscribe(void *sarg) {
g_queryInfo
.
specifiedQueryInfo
.
result
[
pThreadInfo
->
querySeq
],
pThreadInfo
->
threadID
);
}
tsub
=
subscribeImpl
(
pThreadInfo
,
tsub
=
subscribeImpl
(
SPECIFIED_CLASS
,
pThreadInfo
,
g_queryInfo
.
specifiedQueryInfo
.
sql
[
pThreadInfo
->
querySeq
],
topic
,
g_queryInfo
.
specifiedQueryInfo
.
subscribeRestart
);
g_queryInfo
.
specifiedQueryInfo
.
subscribeRestart
,
g_queryInfo
.
specifiedQueryInfo
.
subscribeInterval
);
if
(
NULL
==
tsub
)
{
taos_close
(
pThreadInfo
->
taos
);
return
NULL
;
...
...
@@ -6777,10 +6792,12 @@ static void *specifiedSubscribe(void *sarg) {
taos_unsubscribe
(
tsub
,
g_queryInfo
.
specifiedQueryInfo
.
subscribeKeepProgress
);
tsub
=
subscribeImpl
(
SPECIFIED_CLASS
,
pThreadInfo
,
g_queryInfo
.
specifiedQueryInfo
.
sql
[
pThreadInfo
->
querySeq
],
topic
,
g_queryInfo
.
specifiedQueryInfo
.
subscribeRestart
g_queryInfo
.
specifiedQueryInfo
.
subscribeRestart
,
g_queryInfo
.
specifiedQueryInfo
.
subscribeInterval
);
if
(
NULL
==
tsub
)
{
taos_close
(
pThreadInfo
->
taos
);
...
...
sangshuduo
@sangshuduo
mentioned in commit
c69604fd
·
5月 20, 2021
mentioned in commit
c69604fd
mentioned in commit c69604fdb4c7e68e70bb61c33fa610d20c313c55
开关提交列表
sangshuduo
@sangshuduo
mentioned in commit
4e32f1cc
·
5月 20, 2021
mentioned in commit
4e32f1cc
mentioned in commit 4e32f1cc72bf39ee432541935abbeea8adab8475
开关提交列表
涛思数据(TDengine)
@taos_data
mentioned in commit
968f21d4
·
5月 20, 2021
mentioned in commit
968f21d4
mentioned in commit 968f21d42b73bf3af38e28fe32044bcc88f85f4e
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录