Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8d710801
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看板
提交
8d710801
编写于
1月 27, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
disable hb
上级
169fed61
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
10 deletion
+16
-10
source/client/src/clientHb.c
source/client/src/clientHb.c
+4
-0
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+3
-3
source/client/src/clientMain.c
source/client/src/clientMain.c
+2
-2
source/client/src/clientMsgHandler.c
source/client/src/clientMsgHandler.c
+1
-1
source/client/test/clientTests.cpp
source/client/test/clientTests.cpp
+6
-4
未找到文件。
source/client/src/clientHb.c
浏览文件 @
8d710801
...
...
@@ -389,6 +389,7 @@ static void hbStopThread() {
}
SAppHbMgr
*
appHbMgrInit
(
SAppInstInfo
*
pAppInstInfo
,
char
*
key
)
{
return
NULL
;
hbMgrInit
();
SAppHbMgr
*
pAppHbMgr
=
malloc
(
sizeof
(
SAppHbMgr
));
if
(
pAppHbMgr
==
NULL
)
{
...
...
@@ -452,6 +453,7 @@ void appHbMgrCleanup(SAppHbMgr* pAppHbMgr) {
}
int
hbMgrInit
()
{
return
0
;
// init once
int8_t
old
=
atomic_val_compare_exchange_8
(
&
clientHbMgr
.
inited
,
0
,
1
);
if
(
old
==
1
)
return
0
;
...
...
@@ -469,6 +471,7 @@ int hbMgrInit() {
}
void
hbMgrCleanUp
()
{
return
;
hbStopThread
();
// destroy all appHbMgr
...
...
@@ -506,6 +509,7 @@ int hbRegisterConnImpl(SAppHbMgr* pAppHbMgr, SClientHbKey connKey, SHbConnInfo *
}
int
hbRegisterConn
(
SAppHbMgr
*
pAppHbMgr
,
int32_t
connId
,
int64_t
clusterId
,
int32_t
hbType
)
{
return
0
;
SClientHbKey
connKey
=
{.
connId
=
connId
,
.
hbType
=
HEARTBEAT_TYPE_QUERY
};
SHbConnInfo
info
=
{
0
};
...
...
source/client/src/clientImpl.c
浏览文件 @
8d710801
...
...
@@ -119,7 +119,7 @@ TAOS *taos_connect_internal(const char *ip, const char *user, const char *pass,
SAppInstInfo
*
p
=
calloc
(
1
,
sizeof
(
struct
SAppInstInfo
));
p
->
mgmtEp
=
epSet
;
p
->
pTransporter
=
openTransporter
(
user
,
secretEncrypt
,
tsNumOfCores
);
p
->
pAppHbMgr
=
appHbMgrInit
(
p
,
key
);
/*p->pAppHbMgr = appHbMgrInit(p, key);*/
taosHashPut
(
appInfo
.
pInstMap
,
key
,
strlen
(
key
),
&
p
,
POINTER_BYTES
);
pInst
=
&
p
;
...
...
@@ -691,8 +691,8 @@ int32_t tmq_ask_ep_cb(void* param, const SDataBuf* pMsg, int32_t code) {
tDecodeSMqCMGetSubEpRsp
(
pMsg
->
pData
,
&
rsp
);
int32_t
sz
=
taosArrayGetSize
(
rsp
.
topics
);
// TODO: lock
printf
(
"rsp epoch %ld sz %ld
\n
"
,
rsp
.
epoch
,
rsp
.
topics
->
size
);
printf
(
"tmq epoch %ld sz %ld
\n
"
,
tmq
->
epoch
,
tmq
->
clientTopics
->
size
);
/*printf("rsp epoch %ld sz %ld\n", rsp.epoch, rsp.topics->size);*/
/*printf("tmq epoch %ld sz %ld\n", tmq->epoch, tmq->clientTopics->size);*/
if
(
rsp
.
epoch
!=
tmq
->
epoch
)
{
//TODO
if
(
tmq
->
clientTopics
)
taosArrayDestroy
(
tmq
->
clientTopics
);
...
...
source/client/src/clientMain.c
浏览文件 @
8d710801
...
...
@@ -78,7 +78,7 @@ void taos_close(TAOS* taos) {
STscObj
*
pTscObj
=
(
STscObj
*
)
taos
;
tscDebug
(
"0x%"
PRIx64
" try to close connection, numOfReq:%d"
,
pTscObj
->
id
,
pTscObj
->
numOfReqs
);
taosRemoveRef
(
clientConnRefPool
,
pTscObj
->
id
);
/*taosRemoveRef(clientConnRefPool, pTscObj->id);*/
}
int
taos_errno
(
TAOS_RES
*
tres
)
{
...
...
@@ -343,4 +343,4 @@ void taos_query_a(TAOS *taos, const char *sql, __taos_async_fn_t fp, void *param
void
taos_fetch_rows_a
(
TAOS_RES
*
res
,
__taos_async_fn_t
fp
,
void
*
param
)
{
// TODO
}
\ No newline at end of file
}
source/client/src/clientMsgHandler.c
浏览文件 @
8d710801
...
...
@@ -76,7 +76,7 @@ int processConnectRsp(void* param, const SDataBuf* pMsg, int32_t code) {
pTscObj
->
connType
=
HEARTBEAT_TYPE_QUERY
;
hbRegisterConn
(
pTscObj
->
pAppInfo
->
pAppHbMgr
,
pConnect
->
connId
,
pConnect
->
clusterId
,
HEARTBEAT_TYPE_QUERY
);
/*hbRegisterConn(pTscObj->pAppInfo->pAppHbMgr, pConnect->connId, pConnect->clusterId, HEARTBEAT_TYPE_QUERY);*/
// pRequest->body.resInfo.pRspMsg = pMsg->pData;
tscDebug
(
"0x%"
PRIx64
" clusterId:%"
PRId64
", totalConn:%"
PRId64
,
pRequest
->
requestId
,
pConnect
->
clusterId
,
...
...
source/client/test/clientTests.cpp
浏览文件 @
8d710801
...
...
@@ -53,6 +53,7 @@ TEST(testCase, driverInit_Test) {
// taos_init();
}
#if 0
TEST(testCase, connect_Test) {
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
if (pConn == NULL) {
...
...
@@ -562,7 +563,7 @@ TEST(testCase, insert_test) {
taos_close(pConn);
}
#
if 0
#
endif
TEST
(
testCase
,
create_topic_Test
)
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
assert
(
pConn
!=
NULL
);
...
...
@@ -607,12 +608,11 @@ TEST(testCase, tmq_subscribe_Test) {
tmq_subscribe
(
tmq
,
topic_list
);
while
(
1
)
{
tmq_message_t* msg = tmq_consume_poll(tmq, 0);
printf("get msg\n");
tmq_message_t
*
msg
=
tmq_consume_poll
(
tmq
,
100
0
);
//
printf("get msg\n");
//if (msg == NULL) break;
}
}
#endif
TEST
(
testCase
,
tmq_consume_Test
)
{
}
...
...
@@ -620,6 +620,7 @@ TEST(testCase, tmq_consume_Test) {
TEST
(
testCase
,
tmq_commit_TEST
)
{
}
#if 0
TEST(testCase, projection_query_tables) {
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
ASSERT_NE(pConn, nullptr);
...
...
@@ -732,5 +733,6 @@ TEST(testCase, agg_query_tables) {
taos_free_result(pRes);
taos_close(pConn);
}
#endif
#pragma GCC diagnostic pop
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录