Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c067db1f
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看板
提交
c067db1f
编写于
7月 04, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] refactor code.
上级
838ffb5f
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
15 addition
and
13 deletion
+15
-13
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+1
-1
src/dnode/src/dnodeVRead.c
src/dnode/src/dnodeVRead.c
+5
-3
src/inc/dnode.h
src/inc/dnode.h
+1
-1
src/inc/vnode.h
src/inc/vnode.h
+2
-2
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+5
-5
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+1
-1
未找到文件。
src/dnode/src/dnodeMgmt.c
浏览文件 @
c067db1f
...
@@ -391,7 +391,7 @@ static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *rpcMsg) {
...
@@ -391,7 +391,7 @@ static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *rpcMsg) {
pCreate
->
nodes
[
j
].
nodeId
=
htonl
(
pCreate
->
nodes
[
j
].
nodeId
);
pCreate
->
nodes
[
j
].
nodeId
=
htonl
(
pCreate
->
nodes
[
j
].
nodeId
);
}
}
void
*
pVnode
=
vnodeAc
c
quireVnode
(
pCreate
->
cfg
.
vgId
);
void
*
pVnode
=
vnodeAcquireVnode
(
pCreate
->
cfg
.
vgId
);
if
(
pVnode
!=
NULL
)
{
if
(
pVnode
!=
NULL
)
{
int32_t
code
=
vnodeAlter
(
pVnode
,
pCreate
);
int32_t
code
=
vnodeAlter
(
pVnode
,
pCreate
);
vnodeRelease
(
pVnode
);
vnodeRelease
(
pVnode
);
...
...
src/dnode/src/dnodeVRead.c
浏览文件 @
c067db1f
...
@@ -98,7 +98,7 @@ void dnodeDispatchToVnodeReadQueue(SRpcMsg *pMsg) {
...
@@ -98,7 +98,7 @@ void dnodeDispatchToVnodeReadQueue(SRpcMsg *pMsg) {
pHead
->
vgId
=
htonl
(
pHead
->
vgId
);
pHead
->
vgId
=
htonl
(
pHead
->
vgId
);
pHead
->
contLen
=
htonl
(
pHead
->
contLen
);
pHead
->
contLen
=
htonl
(
pHead
->
contLen
);
pVnode
=
vnodeAc
c
quireVnode
(
pHead
->
vgId
);
pVnode
=
vnodeAcquireVnode
(
pHead
->
vgId
);
if
(
pVnode
==
NULL
)
{
if
(
pVnode
==
NULL
)
{
leftLen
-=
pHead
->
contLen
;
leftLen
-=
pHead
->
contLen
;
...
@@ -175,13 +175,15 @@ void dnodeFreeVnodeRqueue(void *rqueue) {
...
@@ -175,13 +175,15 @@ void dnodeFreeVnodeRqueue(void *rqueue) {
// dynamically adjust the number of threads
// dynamically adjust the number of threads
}
}
void
dnodePut
Qhandle
IntoReadQueue
(
void
*
pVnode
,
void
*
qhandle
)
{
void
dnodePut
Item
IntoReadQueue
(
void
*
pVnode
,
void
*
qhandle
)
{
SReadMsg
*
pRead
=
(
SReadMsg
*
)
taosAllocateQitem
(
sizeof
(
SReadMsg
));
SReadMsg
*
pRead
=
(
SReadMsg
*
)
taosAllocateQitem
(
sizeof
(
SReadMsg
));
pRead
->
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_QUERY
;
pRead
->
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_QUERY
;
pRead
->
pCont
=
qhandle
;
pRead
->
pCont
=
qhandle
;
pRead
->
contLen
=
0
;
pRead
->
contLen
=
0
;
taos_queue
queue
=
vnodeAccquireRqueue
(
pVnode
);
assert
(
pVnode
!=
NULL
);
taos_queue
queue
=
vnodeAcquireRqueue
(
pVnode
);
taosWriteQitem
(
queue
,
TAOS_QTYPE_QUERY
,
pRead
);
taosWriteQitem
(
queue
,
TAOS_QTYPE_QUERY
,
pRead
);
}
}
...
...
src/inc/dnode.h
浏览文件 @
c067db1f
...
@@ -53,7 +53,7 @@ void *dnodeAllocateVnodeWqueue(void *pVnode);
...
@@ -53,7 +53,7 @@ void *dnodeAllocateVnodeWqueue(void *pVnode);
void
dnodeFreeVnodeWqueue
(
void
*
queue
);
void
dnodeFreeVnodeWqueue
(
void
*
queue
);
void
*
dnodeAllocateVnodeRqueue
(
void
*
pVnode
);
void
*
dnodeAllocateVnodeRqueue
(
void
*
pVnode
);
void
dnodeFreeVnodeRqueue
(
void
*
rqueue
);
void
dnodeFreeVnodeRqueue
(
void
*
rqueue
);
void
dnodePut
Qhandle
IntoReadQueue
(
void
*
pVnode
,
void
*
qhandle
);
void
dnodePut
Item
IntoReadQueue
(
void
*
pVnode
,
void
*
qhandle
);
void
dnodeSendRpcVnodeWriteRsp
(
void
*
pVnode
,
void
*
param
,
int32_t
code
);
void
dnodeSendRpcVnodeWriteRsp
(
void
*
pVnode
,
void
*
param
,
int32_t
code
);
int32_t
dnodeAllocateMnodePqueue
();
int32_t
dnodeAllocateMnodePqueue
();
...
...
src/inc/vnode.h
浏览文件 @
c067db1f
...
@@ -49,10 +49,10 @@ int32_t vnodeAlter(void *pVnode, SMDCreateVnodeMsg *pVnodeCfg);
...
@@ -49,10 +49,10 @@ int32_t vnodeAlter(void *pVnode, SMDCreateVnodeMsg *pVnodeCfg);
int32_t
vnodeClose
(
int32_t
vgId
);
int32_t
vnodeClose
(
int32_t
vgId
);
void
vnodeRelease
(
void
*
pVnode
);
void
vnodeRelease
(
void
*
pVnode
);
void
*
vnodeAc
cquireVnode
(
int32_t
vgId
);
// add refcount
void
*
vnodeAc
quireVnode
(
int32_t
vgId
);
// add refcount
void
*
vnodeGetVnode
(
int32_t
vgId
);
// keep refcount unchanged
void
*
vnodeGetVnode
(
int32_t
vgId
);
// keep refcount unchanged
void
*
vnodeAc
c
quireRqueue
(
void
*
);
void
*
vnodeAcquireRqueue
(
void
*
);
void
*
vnodeGetRqueue
(
void
*
);
void
*
vnodeGetRqueue
(
void
*
);
void
*
vnodeGetWqueue
(
int32_t
vgId
);
void
*
vnodeGetWqueue
(
int32_t
vgId
);
void
*
vnodeGetWal
(
void
*
pVnode
);
void
*
vnodeGetWal
(
void
*
pVnode
);
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
c067db1f
...
@@ -293,7 +293,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
...
@@ -293,7 +293,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
}
}
int32_t
vnodeStartStream
(
int32_t
vnode
)
{
int32_t
vnodeStartStream
(
int32_t
vnode
)
{
SVnodeObj
*
pVnode
=
vnodeAc
c
quireVnode
(
vnode
);
SVnodeObj
*
pVnode
=
vnodeAcquireVnode
(
vnode
);
if
(
pVnode
!=
NULL
)
{
if
(
pVnode
!=
NULL
)
{
tsdbStartStream
(
pVnode
->
tsdb
);
tsdbStartStream
(
pVnode
->
tsdb
);
vnodeRelease
(
pVnode
);
vnodeRelease
(
pVnode
);
...
@@ -383,7 +383,7 @@ void *vnodeGetVnode(int32_t vgId) {
...
@@ -383,7 +383,7 @@ void *vnodeGetVnode(int32_t vgId) {
return
*
ppVnode
;
return
*
ppVnode
;
}
}
void
*
vnodeAc
c
quireVnode
(
int32_t
vgId
)
{
void
*
vnodeAcquireVnode
(
int32_t
vgId
)
{
SVnodeObj
*
pVnode
=
vnodeGetVnode
(
vgId
);
SVnodeObj
*
pVnode
=
vnodeGetVnode
(
vgId
);
if
(
pVnode
==
NULL
)
return
pVnode
;
if
(
pVnode
==
NULL
)
return
pVnode
;
...
@@ -393,7 +393,7 @@ void *vnodeAccquireVnode(int32_t vgId) {
...
@@ -393,7 +393,7 @@ void *vnodeAccquireVnode(int32_t vgId) {
return
pVnode
;
return
pVnode
;
}
}
void
*
vnodeAc
c
quireRqueue
(
void
*
param
)
{
void
*
vnodeAcquireRqueue
(
void
*
param
)
{
SVnodeObj
*
pVnode
=
param
;
SVnodeObj
*
pVnode
=
param
;
if
(
pVnode
==
NULL
)
return
NULL
;
if
(
pVnode
==
NULL
)
return
NULL
;
...
@@ -407,7 +407,7 @@ void *vnodeGetRqueue(void *pVnode) {
...
@@ -407,7 +407,7 @@ void *vnodeGetRqueue(void *pVnode) {
}
}
void
*
vnodeGetWqueue
(
int32_t
vgId
)
{
void
*
vnodeGetWqueue
(
int32_t
vgId
)
{
SVnodeObj
*
pVnode
=
vnodeAc
c
quireVnode
(
vgId
);
SVnodeObj
*
pVnode
=
vnodeAcquireVnode
(
vgId
);
if
(
pVnode
==
NULL
)
return
NULL
;
if
(
pVnode
==
NULL
)
return
NULL
;
return
pVnode
->
wqueue
;
return
pVnode
->
wqueue
;
}
}
...
@@ -451,7 +451,7 @@ void vnodeBuildStatusMsg(void *param) {
...
@@ -451,7 +451,7 @@ void vnodeBuildStatusMsg(void *param) {
void
vnodeSetAccess
(
SDMVgroupAccess
*
pAccess
,
int32_t
numOfVnodes
)
{
void
vnodeSetAccess
(
SDMVgroupAccess
*
pAccess
,
int32_t
numOfVnodes
)
{
for
(
int32_t
i
=
0
;
i
<
numOfVnodes
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfVnodes
;
++
i
)
{
pAccess
[
i
].
vgId
=
htonl
(
pAccess
[
i
].
vgId
);
pAccess
[
i
].
vgId
=
htonl
(
pAccess
[
i
].
vgId
);
SVnodeObj
*
pVnode
=
vnodeAc
c
quireVnode
(
pAccess
[
i
].
vgId
);
SVnodeObj
*
pVnode
=
vnodeAcquireVnode
(
pAccess
[
i
].
vgId
);
if
(
pVnode
!=
NULL
)
{
if
(
pVnode
!=
NULL
)
{
pVnode
->
accessState
=
pAccess
[
i
].
accessState
;
pVnode
->
accessState
=
pAccess
[
i
].
accessState
;
if
(
pVnode
->
accessState
!=
TSDB_VN_ALL_ACCCESS
)
{
if
(
pVnode
->
accessState
!=
TSDB_VN_ALL_ACCCESS
)
{
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
c067db1f
...
@@ -203,7 +203,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
...
@@ -203,7 +203,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
code
=
qDumpRetrieveResult
(
*
pQInfo
,
(
SRetrieveTableRsp
**
)
&
pRet
->
rsp
,
&
pRet
->
len
);
code
=
qDumpRetrieveResult
(
*
pQInfo
,
(
SRetrieveTableRsp
**
)
&
pRet
->
rsp
,
&
pRet
->
len
);
if
(
qHasMoreResultsToRetrieve
(
*
handle
))
{
if
(
qHasMoreResultsToRetrieve
(
*
handle
))
{
dnodePut
Qhandle
IntoReadQueue
(
pVnode
,
handle
);
dnodePut
Item
IntoReadQueue
(
pVnode
,
handle
);
pRet
->
qhandle
=
handle
;
pRet
->
qhandle
=
handle
;
code
=
TSDB_CODE_SUCCESS
;
code
=
TSDB_CODE_SUCCESS
;
}
else
{
// no further execution invoked, release the ref to vnode
}
else
{
// no further execution invoked, release the ref to vnode
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录