Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
de6fa208
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
de6fa208
编写于
1月 14, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-11818] refactor.
上级
9ea9444b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
19 deletion
+13
-19
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+0
-1
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+3
-8
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+10
-10
未找到文件。
source/client/inc/clientInt.h
浏览文件 @
de6fa208
...
...
@@ -82,7 +82,6 @@ typedef struct STscObj {
int32_t
acctId
;
uint32_t
connId
;
uint64_t
id
;
// ref ID returned by taosAddRef
void
*
pTransporter
;
pthread_mutex_t
mutex
;
// used to protect the operation on db
int32_t
numOfReqs
;
// number of sqlObj bound to this connection
SAppInstInfo
*
pAppInfo
;
...
...
source/client/src/clientEnv.c
浏览文件 @
de6fa208
...
...
@@ -89,13 +89,12 @@ static void tscInitLogFile() {
// todo close the transporter properly
void
closeTransporter
(
STscObj
*
pTscObj
)
{
if
(
pTscObj
==
NULL
||
pTscObj
->
pTransporter
==
NULL
)
{
if
(
pTscObj
==
NULL
||
pTscObj
->
p
AppInfo
->
p
Transporter
==
NULL
)
{
return
;
}
tscDebug
(
"free transporter:%p in connObj: 0x%"
PRIx64
,
pTscObj
->
pTransporter
,
pTscObj
->
id
);
rpcClose
(
pTscObj
->
pTransporter
);
pTscObj
->
pTransporter
=
NULL
;
tscDebug
(
"free transporter:%p in connObj: 0x%"
PRIx64
,
pTscObj
->
pAppInfo
->
pTransporter
,
pTscObj
->
id
);
rpcClose
(
pTscObj
->
pAppInfo
->
pTransporter
);
}
// TODO refactor
...
...
@@ -140,10 +139,6 @@ void* createTscObj(const char* user, const char* auth, const char *db, SAppInstI
}
pObj
->
pAppInfo
=
pAppInfo
;
if
(
pAppInfo
!=
NULL
)
{
pObj
->
pTransporter
=
pAppInfo
->
pTransporter
;
}
tstrncpy
(
pObj
->
user
,
user
,
sizeof
(
pObj
->
user
));
memcpy
(
pObj
->
pass
,
auth
,
TSDB_PASSWORD_LEN
);
...
...
source/client/src/clientImpl.c
浏览文件 @
de6fa208
...
...
@@ -158,7 +158,7 @@ int32_t parseSql(SRequestObj* pRequest, SQueryNode** pQuery) {
.
sqlLen
=
pRequest
->
sqlLen
,
.
pMsg
=
pRequest
->
msgBuf
,
.
msgLen
=
ERROR_MSG_BUF_DEFAULT_SIZE
,
.
pTransporter
=
pTscObj
->
pTransporter
,
.
pTransporter
=
pTscObj
->
p
AppInfo
->
p
Transporter
,
};
cxt
.
mgmtEpSet
=
getEpSet_s
(
&
pTscObj
->
pAppInfo
->
mgmtEp
);
...
...
@@ -191,10 +191,10 @@ int32_t execDdlQuery(SRequestObj* pRequest, SQueryNode* pQuery) {
pShowReqInfo
->
pArray
=
pDcl
->
pExtension
;
}
}
asyncSendMsgToServer
(
pTscObj
->
pTransporter
,
&
pDcl
->
epSet
,
&
transporterId
,
pSendMsg
);
asyncSendMsgToServer
(
pTscObj
->
p
AppInfo
->
p
Transporter
,
&
pDcl
->
epSet
,
&
transporterId
,
pSendMsg
);
}
else
{
SEpSet
*
pEpSet
=
&
pTscObj
->
pAppInfo
->
mgmtEp
.
epSet
;
asyncSendMsgToServer
(
pTscObj
->
pTransporter
,
pEpSet
,
&
transporterId
,
pSendMsg
);
asyncSendMsgToServer
(
pTscObj
->
p
AppInfo
->
p
Transporter
,
pEpSet
,
&
transporterId
,
pSendMsg
);
}
tsem_wait
(
&
pRequest
->
body
.
rspSem
);
...
...
@@ -241,7 +241,7 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryDag* pDag) {
if
(
TSDB_SQL_INSERT
==
pRequest
->
type
||
TSDB_SQL_CREATE_TABLE
==
pRequest
->
type
)
{
SQueryResult
res
=
{.
code
=
0
,
.
numOfRows
=
0
,
.
msgSize
=
ERROR_MSG_BUF_DEFAULT_SIZE
,
.
msg
=
pRequest
->
msgBuf
};
int32_t
code
=
scheduleExecJob
(
pRequest
->
pTscObj
->
pTransporter
,
NULL
,
pDag
,
&
pRequest
->
body
.
pQueryJob
,
&
res
);
int32_t
code
=
scheduleExecJob
(
pRequest
->
pTscObj
->
p
AppInfo
->
p
Transporter
,
NULL
,
pDag
,
&
pRequest
->
body
.
pQueryJob
,
&
res
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
// handle error and retry
}
else
{
...
...
@@ -255,7 +255,7 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryDag* pDag) {
return
pRequest
->
code
;
}
return
scheduleAsyncExecJob
(
pRequest
->
pTscObj
->
pTransporter
,
NULL
,
pDag
,
&
pRequest
->
body
.
pQueryJob
);
return
scheduleAsyncExecJob
(
pRequest
->
pTscObj
->
p
AppInfo
->
p
Transporter
,
NULL
,
pDag
,
&
pRequest
->
body
.
pQueryJob
);
}
TAOS_RES
*
tmq_create_topic
(
TAOS
*
taos
,
const
char
*
name
,
const
char
*
sql
,
int
sqlLen
)
{
...
...
@@ -305,7 +305,7 @@ TAOS_RES *tmq_create_topic(TAOS* taos, const char* name, const char* sql, int sq
SEpSet
*
pEpSet
=
&
pTscObj
->
pAppInfo
->
mgmtEp
.
epSet
;
int64_t
transporterId
=
0
;
asyncSendMsgToServer
(
pTscObj
->
pTransporter
,
pEpSet
,
&
transporterId
,
body
);
asyncSendMsgToServer
(
pTscObj
->
p
AppInfo
->
p
Transporter
,
pEpSet
,
&
transporterId
,
body
);
tsem_wait
(
&
pRequest
->
body
.
rspSem
);
...
...
@@ -406,7 +406,7 @@ STscObj* taosConnectImpl(const char *ip, const char *user, const char *auth, con
SMsgSendInfo
*
body
=
buildConnectMsg
(
pRequest
);
int64_t
transporterId
=
0
;
asyncSendMsgToServer
(
pTscObj
->
pTransporter
,
&
pTscObj
->
pAppInfo
->
mgmtEp
.
epSet
,
&
transporterId
,
body
);
asyncSendMsgToServer
(
pTscObj
->
p
AppInfo
->
p
Transporter
,
&
pTscObj
->
pAppInfo
->
mgmtEp
.
epSet
,
&
transporterId
,
body
);
tsem_wait
(
&
pRequest
->
body
.
rspSem
);
if
(
pRequest
->
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -417,7 +417,7 @@ STscObj* taosConnectImpl(const char *ip, const char *user, const char *auth, con
taos_close
(
pTscObj
);
pTscObj
=
NULL
;
}
else
{
tscDebug
(
"0x%"
PRIx64
" connection is opening, connId:%d, dnodeConn:%p, reqId:0x%"
PRIx64
,
pTscObj
->
id
,
pTscObj
->
connId
,
pTscObj
->
pTransporter
,
pRequest
->
requestId
);
tscDebug
(
"0x%"
PRIx64
" connection is opening, connId:%d, dnodeConn:%p, reqId:0x%"
PRIx64
,
pTscObj
->
id
,
pTscObj
->
connId
,
pTscObj
->
p
AppInfo
->
p
Transporter
,
pRequest
->
requestId
);
destroyRequest
(
pRequest
);
}
...
...
@@ -585,7 +585,7 @@ void* doFetchRow(SRequestObj* pRequest) {
int64_t
transporterId
=
0
;
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
asyncSendMsgToServer
(
pTscObj
->
pTransporter
,
&
pTscObj
->
pAppInfo
->
mgmtEp
.
epSet
,
&
transporterId
,
body
);
asyncSendMsgToServer
(
pTscObj
->
p
AppInfo
->
p
Transporter
,
&
pTscObj
->
pAppInfo
->
mgmtEp
.
epSet
,
&
transporterId
,
body
);
tsem_wait
(
&
pRequest
->
body
.
rspSem
);
pRequest
->
type
=
TDMT_VND_SHOW_TABLES_FETCH
;
...
...
@@ -595,7 +595,7 @@ void* doFetchRow(SRequestObj* pRequest) {
int64_t
transporterId
=
0
;
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
asyncSendMsgToServer
(
pTscObj
->
pTransporter
,
&
pTscObj
->
pAppInfo
->
mgmtEp
.
epSet
,
&
transporterId
,
body
);
asyncSendMsgToServer
(
pTscObj
->
p
AppInfo
->
p
Transporter
,
&
pTscObj
->
pAppInfo
->
mgmtEp
.
epSet
,
&
transporterId
,
body
);
tsem_wait
(
&
pRequest
->
body
.
rspSem
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录