Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
69a071d8
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
69a071d8
编写于
4年前
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix some warnings and format code
上级
fb92f93f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
34 addition
and
34 deletion
+34
-34
CMakeLists.txt
CMakeLists.txt
+2
-0
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+1
-0
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+23
-25
src/dnode/src/dnodeRead.c
src/dnode/src/dnodeRead.c
+1
-0
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+1
-1
src/dnode/src/dnodeWrite.c
src/dnode/src/dnodeWrite.c
+6
-8
未找到文件。
CMakeLists.txt
浏览文件 @
69a071d8
...
...
@@ -3,6 +3,8 @@ PROJECT(TDengine)
SET
(
TD_CLUSTER FALSE
)
SET
(
TD_ACCOUNT FALSE
)
SET
(
TD_VPEER FALSE
)
SET
(
TD_MPEER FALSE
)
SET
(
TD_GRANT FALSE
)
SET
(
TD_COVER FALSE
)
SET
(
TD_PAGMODE_LITE FALSE
)
...
...
This diff is collapsed.
Click to expand it.
src/dnode/src/dnodeMain.c
浏览文件 @
69a071d8
...
...
@@ -31,6 +31,7 @@
static
int32_t
dnodeInitSystem
();
static
int32_t
dnodeInitStorage
();
extern
void
grantParseParameter
();
static
void
dnodeCleanupStorage
();
static
void
dnodeCleanUpSystem
();
static
void
dnodeSetRunStatus
(
SDnodeRunStatus
status
);
...
...
This diff is collapsed.
Click to expand it.
src/dnode/src/dnodeMgmt.c
浏览文件 @
69a071d8
...
...
@@ -64,7 +64,7 @@ int32_t dnodeInitMgmt() {
dError
(
"failed to init dnode timer"
);
return
-
1
;
}
int32_t
code
=
dnodeOpenVnodes
();
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
-
1
;
...
...
@@ -104,7 +104,7 @@ void dnodeMgmt(SRpcMsg *pMsg) {
rpcFreeCont
(
pMsg
->
pCont
);
}
static
int
dnodeGetVnodeList
(
int32_t
vnodeList
[])
{
static
int
32_t
dnodeGetVnodeList
(
int32_t
vnodeList
[])
{
DIR
*
dir
=
opendir
(
tsVnodeDir
);
if
(
dir
==
NULL
)
{
return
TSDB_CODE_NO_WRITE_ACCESS
;
...
...
@@ -129,36 +129,36 @@ static int dnodeGetVnodeList(int32_t vnodeList[]) {
}
static
int32_t
dnodeOpenVnodes
()
{
char
vnodeDir
[
TSDB_FILENAME_LEN
*
3
];
int
failed
=
0
;
char
vnodeDir
[
TSDB_FILENAME_LEN
*
3
];
int32_t
failed
=
0
;
int32_t
*
vnodeList
=
(
int32_t
*
)
malloc
(
sizeof
(
int32_t
)
*
10000
);
int
numOfVnodes
=
dnodeGetVnodeList
(
vnodeList
);
for
(
int
i
=
0
;
i
<
numOfVnodes
;
++
i
)
{
snprintf
(
vnodeDir
,
TSDB_FILENAME_LEN
*
3
,
"%s/vnode%d"
,
tsVnodeDir
,
vnodeList
[
i
]);
if
(
vnodeOpen
(
vnodeList
[
i
],
vnodeDir
)
<
0
)
failed
++
;
}
int32_t
*
vnodeList
=
(
int32_t
*
)
malloc
(
sizeof
(
int32_t
)
*
10000
);
int32_t
numOfVnodes
=
dnodeGetVnodeList
(
vnodeList
);
free
(
vnodeList
);
for
(
int32_t
i
=
0
;
i
<
numOfVnodes
;
++
i
)
{
snprintf
(
vnodeDir
,
TSDB_FILENAME_LEN
*
3
,
"%s/vnode%d"
,
tsVnodeDir
,
vnodeList
[
i
]);
if
(
vnodeOpen
(
vnodeList
[
i
],
vnodeDir
)
<
0
)
failed
++
;
}
free
(
vnodeList
);
dPrint
(
"there are total vnodes:%d, failed to open:%d"
,
numOfVnodes
,
failed
);
return
TSDB_CODE_SUCCESS
;
dPrint
(
"there are total vnodes:%d, failed to open:%d"
,
numOfVnodes
,
failed
);
return
TSDB_CODE_SUCCESS
;
}
static
void
dnodeCloseVnodes
()
{
int32_t
*
vnodeList
=
(
int32_t
*
)
malloc
(
sizeof
(
int32_t
)
*
10000
);
int
numOfVnodes
=
dnodeGetVnodeList
(
vnodeList
);
for
(
int
i
=
0
;
i
<
numOfVnodes
;
++
i
)
vnodeClose
(
vnodeList
[
i
]);
int32_t
*
vnodeList
=
(
int32_t
*
)
malloc
(
sizeof
(
int32_t
)
*
10000
);
int32_t
numOfVnodes
=
dnodeGetVnodeList
(
vnodeList
);
for
(
int32_t
i
=
0
;
i
<
numOfVnodes
;
++
i
)
{
vnodeClose
(
vnodeList
[
i
]);
}
free
(
vnodeList
);
dPrint
(
"total vnodes:%d are all closed"
,
numOfVnodes
);
free
(
vnodeList
);
dPrint
(
"total vnodes:%d are all closed"
,
numOfVnodes
);
}
static
int32_t
dnodeProcessCreateVnodeMsg
(
SRpcMsg
*
rpcMsg
)
{
SMDCreateVnodeMsg
*
pCreate
=
rpcMsg
->
pCont
;
pCreate
->
cfg
.
vgId
=
htonl
(
pCreate
->
cfg
.
vgId
);
pCreate
->
cfg
.
maxSessions
=
htonl
(
pCreate
->
cfg
.
maxSessions
);
...
...
@@ -169,7 +169,6 @@ static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *rpcMsg) {
}
static
int32_t
dnodeProcessDropVnodeMsg
(
SRpcMsg
*
rpcMsg
)
{
SMDDropVnodeMsg
*
pDrop
=
rpcMsg
->
pCont
;
pDrop
->
vgId
=
htonl
(
pDrop
->
vgId
);
...
...
@@ -177,7 +176,6 @@ static int32_t dnodeProcessDropVnodeMsg(SRpcMsg *rpcMsg) {
}
static
int32_t
dnodeProcessAlterVnodeMsg
(
SRpcMsg
*
rpcMsg
)
{
SMDCreateVnodeMsg
*
pCreate
=
rpcMsg
->
pCont
;
pCreate
->
cfg
.
vgId
=
htonl
(
pCreate
->
cfg
.
vgId
);
pCreate
->
cfg
.
maxSessions
=
htonl
(
pCreate
->
cfg
.
maxSessions
);
...
...
@@ -206,7 +204,7 @@ static int32_t dnodeProcessConfigDnodeMsg(SRpcMsg *pMsg) {
static
void
dnodeSendStatusMsg
(
void
*
handle
,
void
*
tmrId
)
{
if
(
tsDnodeTmr
==
NULL
)
{
dError
(
"dnode timer is already released"
);
dError
(
"dnode timer is already released"
);
return
;
}
...
...
This diff is collapsed.
Click to expand it.
src/dnode/src/dnodeRead.c
浏览文件 @
69a071d8
...
...
@@ -192,6 +192,7 @@ static void dnodeHandleIdleReadWorker() {
}
}
UNUSED_FUNC
static
void
dnodeProcessReadResult
(
void
*
pVnode
,
SReadMsg
*
pRead
)
{
SRpcContext
*
pRpcContext
=
pRead
->
pRpcContext
;
int32_t
code
=
0
;
...
...
This diff is collapsed.
Click to expand it.
src/dnode/src/dnodeShell.c
浏览文件 @
69a071d8
...
...
@@ -37,7 +37,7 @@ int32_t dnodeInitShell() {
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_QUERY
]
=
dnodeRead
;
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_RETRIEVE
]
=
dnodeRead
;
int
numOfThreads
=
tsNumOfCores
*
tsNumOfThreadsPerCore
;
int
32_t
numOfThreads
=
tsNumOfCores
*
tsNumOfThreadsPerCore
;
numOfThreads
=
(
int32_t
)
((
1
.
0
-
tsRatioOfQueryThreads
)
*
numOfThreads
/
2
.
0
);
if
(
numOfThreads
<
1
)
{
numOfThreads
=
1
;
...
...
This diff is collapsed.
Click to expand it.
src/dnode/src/dnodeWrite.c
浏览文件 @
69a071d8
...
...
@@ -52,7 +52,6 @@ static void dnodeHandleIdleWorker(SWriteWorker *pWorker);
SWriteWorkerPool
wWorkerPool
;
int32_t
dnodeInitWrite
()
{
wWorkerPool
.
max
=
tsNumOfCores
;
wWorkerPool
.
writeWorker
=
(
SWriteWorker
*
)
calloc
(
sizeof
(
SWriteWorker
),
wWorkerPool
.
max
);
if
(
wWorkerPool
.
writeWorker
==
NULL
)
return
-
1
;
...
...
@@ -71,7 +70,7 @@ void dnodeCleanupWrite() {
}
void
dnodeWrite
(
SRpcMsg
*
pMsg
)
{
char
*
pCont
=
(
char
*
)
pMsg
->
pCont
;
char
*
pCont
=
(
char
*
)
pMsg
->
pCont
;
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_SUBMIT
||
pMsg
->
msgType
==
TSDB_MSG_TYPE_MD_DROP_STABLE
)
{
SMsgDesc
*
pDesc
=
(
SMsgDesc
*
)
pCont
;
...
...
@@ -80,16 +79,16 @@ void dnodeWrite(SRpcMsg *pMsg) {
}
SMsgHead
*
pHead
=
(
SMsgHead
*
)
pCont
;
pHead
->
vgId
=
htonl
(
pHead
->
vgId
);
pHead
->
contLen
=
htonl
(
pHead
->
contLen
);
pHead
->
vgId
=
htonl
(
pHead
->
vgId
);
pHead
->
contLen
=
htonl
(
pHead
->
contLen
);
taos_queue
queue
=
vnodeGetWqueue
(
pHead
->
vgId
);
if
(
queue
)
{
// put message into queue
SWriteMsg
*
pWrite
=
(
SWriteMsg
*
)
taosAllocateQitem
(
sizeof
(
SWriteMsg
));
pWrite
->
rpcMsg
=
*
pMsg
;
pWrite
->
pCont
=
pCont
;
pWrite
->
contLen
=
pHead
->
contLen
;
pWrite
->
rpcMsg
=
*
pMsg
;
pWrite
->
pCont
=
pCont
;
pWrite
->
contLen
=
pHead
->
contLen
;
taosWriteQitem
(
queue
,
TAOS_QTYPE_RPC
,
pWrite
);
}
else
{
...
...
@@ -227,4 +226,3 @@ static void dnodeHandleIdleWorker(SWriteWorker *pWorker) {
pthread_exit
(
NULL
);
}
}
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部