Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f2eac06a
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
f2eac06a
编写于
1月 02, 2020
作者:
weixin_48148422
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TBASE-1423: single meter subscription
上级
4ba0819f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
8 deletion
+29
-8
src/system/detail/src/vnodeRead.c
src/system/detail/src/vnodeRead.c
+7
-1
src/system/detail/src/vnodeShell.c
src/system/detail/src/vnodeShell.c
+10
-1
tests/examples/c/makefile
tests/examples/c/makefile
+5
-4
tests/examples/c/subscribe.c
tests/examples/c/subscribe.c
+7
-2
未找到文件。
src/system/detail/src/vnodeRead.c
浏览文件 @
f2eac06a
...
...
@@ -630,7 +630,13 @@ void *vnodeQueryOnSingleTable(SMeterObj **pMetersObj, SSqlGroupbyExpr *pGroupbyE
pQuery
=
&
(
pQInfo
->
query
);
dTrace
(
"qmsg:%p create QInfo:%p, QInfo created"
,
pQueryMsg
,
pQInfo
);
pQuery
->
skey
=
pQueryMsg
->
skey
;
SMeterSidExtInfo
**
pSids
=
(
SMeterSidExtInfo
**
)
pQueryMsg
->
pSidExtInfo
;
if
(
pSids
!=
NULL
&&
pSids
[
0
]
->
key
>
0
)
{
pQuery
->
skey
=
pSids
[
0
]
->
key
;
}
else
{
pQuery
->
skey
=
pQueryMsg
->
skey
;
}
pQuery
->
ekey
=
pQueryMsg
->
ekey
;
pQuery
->
lastKey
=
pQuery
->
skey
;
...
...
src/system/detail/src/vnodeShell.c
浏览文件 @
f2eac06a
...
...
@@ -444,6 +444,8 @@ void vnodeExecuteRetrieveReq(SSchedMsg *pSched) {
int
progressSize
=
0
;
if
(
pQInfo
->
pMeterQuerySupporter
!=
NULL
)
progressSize
=
pQInfo
->
pMeterQuerySupporter
->
numOfMeters
*
(
sizeof
(
int64_t
)
+
sizeof
(
TSKEY
))
+
sizeof
(
int32_t
);
else
if
(
pQInfo
->
pObj
!=
NULL
)
progressSize
=
sizeof
(
int64_t
)
+
sizeof
(
TSKEY
)
+
sizeof
(
int32_t
);
pStart
=
taosBuildRspMsgWithSize
(
pObj
->
thandle
,
TSDB_MSG_TYPE_RETRIEVE_RSP
,
progressSize
+
size
+
100
);
if
(
pStart
==
NULL
)
{
...
...
@@ -478,7 +480,7 @@ void vnodeExecuteRetrieveReq(SSchedMsg *pSched) {
// write the progress information of each meter to response
// this is required by subscriptions
if
(
p
rogressSize
>
0
)
{
if
(
p
QInfo
->
pMeterQuerySupporter
!=
NULL
)
{
*
((
int32_t
*
)
pMsg
)
=
htonl
(
pQInfo
->
pMeterQuerySupporter
->
numOfMeters
);
pMsg
+=
sizeof
(
int32_t
);
for
(
int32_t
i
=
0
;
i
<
pQInfo
->
pMeterQuerySupporter
->
numOfMeters
;
i
++
)
{
...
...
@@ -487,6 +489,13 @@ void vnodeExecuteRetrieveReq(SSchedMsg *pSched) {
*
((
TSKEY
*
)
pMsg
)
=
htobe64
(
pQInfo
->
pMeterQuerySupporter
->
pMeterSidExtInfo
[
i
]
->
key
);
pMsg
+=
sizeof
(
TSKEY
);
}
}
else
if
(
pQInfo
->
pObj
!=
NULL
)
{
*
((
int32_t
*
)
pMsg
)
=
htonl
(
1
);
pMsg
+=
sizeof
(
int32_t
);
*
((
int64_t
*
)
pMsg
)
=
htobe64
(
pQInfo
->
pObj
->
uid
);
pMsg
+=
sizeof
(
int64_t
);
*
((
TSKEY
*
)
pMsg
)
=
htobe64
(
pQInfo
->
query
.
lastKey
);
pMsg
+=
sizeof
(
TSKEY
);
}
msgLen
=
pMsg
-
pStart
;
...
...
tests/examples/c/makefile
浏览文件 @
f2eac06a
...
...
@@ -4,16 +4,17 @@
ROOT
=
./
TARGET
=
exe
LFLAGS
=
'-Wl,-rpath,/usr/local/taos/driver/'
-ltaos
-lpthread
-lm
-lrt
#LFLAGS = '-Wl,-rpath,/home/zbm/project/td/debug/build/lib/' -L/home/zbm/project/td/debug/build/lib -ltaos -lpthread -lm -lrt
CFLAGS
=
-O3
-g
-Wall
-Wno-deprecated
-fPIC
-Wno-unused-result
-Wconversion
-Wno-char-subscripts
-D_REENTRANT
-Wno-format
-D_REENTRANT
-DLINUX
-msse4
.2
-Wno-unused-function
-D_M_X64
\
-I
/usr/local/taos/include
-std
=
gnu99
all
:
$(TARGET)
exe
:
gcc
$(CFLAGS)
./asyncdemo.c
-o
$(ROOT)/asyncdemo
$(LFLAGS)
gcc
$(CFLAGS)
./demo.c
-o
$(ROOT)/demo
$(LFLAGS)
gcc
$(CFLAGS)
./prepare.c
-o
$(ROOT)/prepare
$(LFLAGS)
gcc
$(CFLAGS)
./stream.c
-o
$(ROOT)/stream
$(LFLAGS)
gcc
$(CFLAGS)
./asyncdemo.c
-o
$(ROOT)
/asyncdemo
$(LFLAGS)
gcc
$(CFLAGS)
./demo.c
-o
$(ROOT)
/demo
$(LFLAGS)
gcc
$(CFLAGS)
./prepare.c
-o
$(ROOT)
/prepare
$(LFLAGS)
gcc
$(CFLAGS)
./stream.c
-o
$(ROOT)
/stream
$(LFLAGS)
gcc
$(CFLAGS)
./subscribe.c
-o
$(ROOT)
subscribe
$(LFLAGS)
clean
:
...
...
tests/examples/c/subscribe.c
浏览文件 @
f2eac06a
...
...
@@ -28,6 +28,7 @@ int main(int argc, char *argv[]) {
const
char
*
host
=
"127.0.0.1"
;
const
char
*
user
=
"root"
;
const
char
*
passwd
=
"taosdata"
;
const
char
*
sql
=
"select * from meters;"
;
int
async
=
1
,
restart
=
0
;
TAOS_SUB
*
tsub
=
NULL
;
...
...
@@ -52,6 +53,10 @@ int main(int argc, char *argv[]) {
restart
=
1
;
continue
;
}
if
(
strcmp
(
argv
[
i
],
"-single"
)
==
0
)
{
sql
=
"select * from t0;"
;
continue
;
}
}
// init TAOS
...
...
@@ -64,9 +69,9 @@ int main(int argc, char *argv[]) {
}
if
(
async
)
{
tsub
=
taos_subscribe
(
"test"
,
restart
,
taos
,
"select * from meters;"
,
subscribe_callback
,
NULL
,
1000
);
tsub
=
taos_subscribe
(
"test"
,
restart
,
taos
,
sql
,
subscribe_callback
,
NULL
,
1000
);
}
else
{
tsub
=
taos_subscribe
(
"test"
,
restart
,
taos
,
"select * from meters;"
,
NULL
,
NULL
,
0
);
tsub
=
taos_subscribe
(
"test"
,
restart
,
taos
,
sql
,
NULL
,
NULL
,
0
);
}
if
(
tsub
==
NULL
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录