Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冷面1992
TDengine
提交
abb7731a
TDengine
项目概览
冷面1992
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
abb7731a
编写于
2月 05, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#1177
上级
2f7883b1
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
197 addition
and
22 deletion
+197
-22
src/dnode/inc/dnodeMgmt.h
src/dnode/inc/dnodeMgmt.h
+38
-0
src/dnode/inc/dnodePlugin.h
src/dnode/inc/dnodePlugin.h
+44
-0
src/dnode/inc/dnodeSystem.h
src/dnode/inc/dnodeSystem.h
+1
-1
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+1
-1
src/dnode/src/dnodePlugin.c
src/dnode/src/dnodePlugin.c
+32
-14
src/dnode/src/dnodeRead.c
src/dnode/src/dnodeRead.c
+17
-0
src/dnode/src/dnodeSystem.c
src/dnode/src/dnodeSystem.c
+42
-1
src/dnode/src/dnodeWrite.c
src/dnode/src/dnodeWrite.c
+17
-0
src/dnode/src/vnodeMgmt.c
src/dnode/src/vnodeMgmt.c
+1
-1
src/mnode/lite/src/mgmtDnodeInt.spec.c
src/mnode/lite/src/mgmtDnodeInt.spec.c
+2
-2
src/vnode/detail/inc/vnode.h
src/vnode/detail/inc/vnode.h
+1
-1
src/vnode/detail/inc/vnodeSystem.h
src/vnode/detail/inc/vnodeSystem.h
+1
-1
未找到文件。
src/dnode/inc/dnodeMgmt.h
0 → 100644
浏览文件 @
abb7731a
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_VNODEMGMT_H
#define TDENGINE_VNODEMGMT_H
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
{
char
id
[
20
];
char
sid
;
void
*
thandle
;
int
mgmtIndex
;
char
status
;
// 0:offline, 1:online
}
SMgmtObj
;
int
vnodeProcessCreateMeterRequest
(
char
*
pMsg
,
int
msgLen
,
SMgmtObj
*
pMgmtObj
);
int
vnodeProcessRemoveMeterRequest
(
char
*
pMsg
,
int
msgLen
,
SMgmtObj
*
pMgmtObj
);
#ifdef __cplusplus
}
#endif
#endif // TDENGINE_VNODEMGMT_H
src/dnode/
src/dnodeSystem.spec.c
→
src/dnode/
inc/dnodePlugin.h
浏览文件 @
abb7731a
...
...
@@ -13,44 +13,32 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "mgmt.h"
#include "dnodeSystem.h"
extern
SModule
tsModule
[
TSDB_MOD_MAX
];
int
taosCreateTierDirectory
()
{
struct
stat
dirstat
;
strcpy
(
tsDirectory
,
dataDir
);
if
(
stat
(
dataDir
,
&
dirstat
)
<
0
)
{
mkdir
(
dataDir
,
0755
);
}
#ifndef TDENGINE_DNODE_PLUGIN_H
#define TDENGINE_DNODE_PLUGIN_H
char
fileName
[
128
];
#ifdef __cplusplus
extern
"C"
{
#endif
sprintf
(
fileName
,
"%s/tsdb"
,
tsDirectory
);
mkdir
(
fileName
,
0755
);
#include <stdint.h>
#include <pthread.h>
sprintf
(
fileName
,
"%s/data"
,
tsDirectory
);
mkdir
(
fileName
,
0755
);
sprintf
(
mgmtDirectory
,
"%s/mgmt"
,
tsDirectory
);
sprintf
(
tsDirectory
,
"%s/tsdb"
,
dataDir
);
dnodeCheckDbRunning
(
dataDir
);
#include "tsched.h"
#include "mgmt.h"
return
0
;
}
char
*
(
*
taosBuildRspMsgToMnodeWithSize
)(
SMgmtObj
*
pObj
,
char
type
,
int
size
);
char
*
(
*
taosBuildReqMsgToMnodeWithSize
)(
SMgmtObj
*
pObj
,
char
type
,
int
size
);
char
*
(
*
taosBuildRspMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
);
char
*
(
*
taosBuildReqMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
);
int
(
*
taosSendMsgToMnode
)(
SMgmtObj
*
pObj
,
char
*
msg
,
int
msgLen
);
int
(
*
taosSendSimpleRspToMnode
)(
SMgmtObj
*
pObj
,
char
rsptype
,
char
code
);
int
dnodeInitSystemSpec
()
{
return
0
;
}
void
(
*
dnodeInitMgmtIp
)();
void
(
*
dnodeProcessMsgFromMgmt
)(
SSchedMsg
*
sched
);
int
(
*
dnodeInitMgmtConn
)();
void
dnodeStartModuleSpec
()
{
for
(
int
mod
=
1
;
mod
<
TSDB_MOD_MAX
;
++
mod
)
{
if
(
tsModule
[
mod
].
num
!=
0
&&
tsModule
[
mod
].
startFp
)
{
if
((
*
tsModule
[
mod
].
startFp
)()
!=
0
)
{
dError
(
"failed to start module:%d"
,
mod
);
}
}
}
#ifdef __cplusplus
}
#endif
void
dnodeParseParameterK
()
{}
\ No newline at end of file
#endif
src/dnode/inc/dnodeSystem.h
浏览文件 @
abb7731a
...
...
@@ -56,7 +56,7 @@ void dnodeCheckDbRunning(const char* dir);
void
vnodeCleanUpSystem
();
int
vnodeInitSystem
();
void
v
nodeInitMgmtIp
();
void
d
nodeInitMgmtIp
();
void
vnodeInitQHandle
();
int
mgmtInitSystem
();
...
...
src/dnode/src/dnodeMgmt.c
浏览文件 @
abb7731a
...
...
@@ -51,7 +51,7 @@ char *taosBuildReqMsgToMnode(SMgmtObj *pObj, char type);
int
taosSendSimpleRspToMnode
(
SMgmtObj
*
pObj
,
char
rsptype
,
char
code
);
int
taosSendMsgToMnode
(
SMgmtObj
*
pObj
,
char
*
msg
,
int
msgLen
);
void
vnodeProcessMsgFromMgmt
(
char
*
content
,
int
msgLen
,
int
msgType
,
SMgmtObj
*
pObj
)
{
void
dnodeProcessMsgFromMgmtImp
(
char
*
content
,
int
msgLen
,
int
msgType
,
SMgmtObj
*
pObj
)
{
if
(
msgType
==
TSDB_MSG_TYPE_CREATE
)
{
vnodeProcessCreateMeterRequest
(
content
,
msgLen
,
pObj
);
}
else
if
(
msgType
==
TSDB_MSG_TYPE_VPEERS
)
{
...
...
src/dnode/src/dnodePlugin.c
浏览文件 @
abb7731a
...
...
@@ -14,14 +14,16 @@
*/
#define _DEFAULT_SOURCE
#include "tsched.h"
#include "dnodePlugin.h"
#include "dnodeMgmt.h"
#include "vnode.h"
#include "vnodeMgmt.h"
void
*
vnodeProcessMsgFromMgmt
(
char
*
content
,
int
msgLen
,
int
msgType
,
SMgmtObj
*
pObj
);
void
mgmtProcessMsgFromDnodeSpec
(
SSchedMsg
*
sched
);
char
*
taosBuildRspMsgToMnodeWithSize
(
SMgmtObj
*
pObj
,
char
type
,
int
size
)
{
char
*
taosBuildRspMsgToMnodeWithSize
EdgeImp
(
SMgmtObj
*
pObj
,
char
type
,
int
size
)
{
char
*
pStart
=
(
char
*
)
malloc
(
size
);
if
(
pStart
==
NULL
)
{
return
NULL
;
...
...
@@ -31,7 +33,7 @@ char *taosBuildRspMsgToMnodeWithSize(SMgmtObj *pObj, char type, int size) {
return
pStart
+
1
;
}
char
*
taosBuildReqMsgToMnodeWithSize
(
SMgmtObj
*
pObj
,
char
type
,
int
size
)
{
char
*
taosBuildReqMsgToMnodeWithSize
EdgeImp
(
SMgmtObj
*
pObj
,
char
type
,
int
size
)
{
char
*
pStart
=
(
char
*
)
malloc
(
size
);
if
(
pStart
==
NULL
)
{
return
NULL
;
...
...
@@ -41,15 +43,15 @@ char *taosBuildReqMsgToMnodeWithSize(SMgmtObj *pObj, char type, int size) {
return
pStart
+
1
;
}
char
*
taosBuildRspMsgToMnode
(
SMgmtObj
*
pObj
,
char
type
)
{
char
*
taosBuildRspMsgToMnode
EdgeImp
(
SMgmtObj
*
pObj
,
char
type
)
{
return
taosBuildRspMsgToMnodeWithSize
(
pObj
,
type
,
256
);
}
char
*
taosBuildReqMsgToMnode
(
SMgmtObj
*
pObj
,
char
type
)
{
char
*
taosBuildReqMsgToMnode
EdgeImp
(
SMgmtObj
*
pObj
,
char
type
)
{
return
taosBuildReqMsgToMnodeWithSize
(
pObj
,
type
,
256
);
}
int
taosSendMsgToMnode
(
SMgmtObj
*
pObj
,
char
*
msg
,
int
msgLen
)
{
int
taosSendMsgToMnode
EdgeImp
(
SMgmtObj
*
pObj
,
char
*
msg
,
int
msgLen
)
{
dTrace
(
"msg:%s is sent to mnode"
,
taosMsg
[(
uint8_t
)(
*
(
msg
-
1
))]);
/*
...
...
@@ -65,7 +67,7 @@ int taosSendMsgToMnode(SMgmtObj *pObj, char *msg, int msgLen) {
return
0
;
}
int
taosSendSimpleRspToMnode
(
SMgmtObj
*
pObj
,
char
rsptype
,
char
code
)
{
int
taosSendSimpleRspToMnode
EdgeImp
(
SMgmtObj
*
pObj
,
char
rsptype
,
char
code
)
{
char
*
pStart
=
taosBuildRspMsgToMnode
(
0
,
rsptype
);
if
(
pStart
==
NULL
)
{
return
0
;
...
...
@@ -77,19 +79,35 @@ int taosSendSimpleRspToMnode(SMgmtObj *pObj, char rsptype, char code) {
return
0
;
}
void
vnodeProcessMsgFromMgmtSpec
(
SSchedMsg
*
sched
)
{
void
dnodeProcessMsgFromMgmtEdgeImp
(
SSchedMsg
*
sched
)
{
char
msgType
=
*
sched
->
msg
;
char
*
content
=
sched
->
msg
+
1
;
dTrace
(
"msg:%s is received from mgmt"
,
taosMsg
[(
uint8_t
)
msgType
]);
vnodeProcessMsgFromMgmt
(
content
,
0
,
msgType
,
0
);
dnodeProcessMsgFromMgmtImp
(
content
,
0
,
msgType
,
0
);
free
(
sched
->
msg
);
}
int
vnodeInitMgmt
()
{
return
0
;
}
int
dnodeInitMgmtConnEdgeImp
()
{
return
0
;
}
void
dnodeInitMgmtIpEdgeImp
()
{}
void
dnodeInitPlugin
()
{
dnodeInitMgmtConn
=
dnodeInitMgmtConnEdgeImp
;
dnodeInitMgmtIp
=
dnodeInitMgmtIpEdgeImp
;
dnodeProcessMsgFromMgmt
=
dnodeProcessMsgFromMgmtEdgeImp
;
taosBuildRspMsgToMnodeWithSize
=
taosBuildRspMsgToMnodeWithSizeEdgeImp
;
taosBuildReqMsgToMnodeWithSize
=
taosBuildReqMsgToMnodeWithSizeEdgeImp
;
taosBuildRspMsgToMnode
=
taosBuildRspMsgToMnodeEdgeImp
;
taosBuildReqMsgToMnode
=
taosBuildReqMsgToMnodeEdgeImp
;
taosSendMsgToMnode
=
taosSendMsgToMnodeEdgeImp
;
taosSendSimpleRspToMnode
=
taosSendSimpleRspToMnodeEdgeImp
;
}
void
vnodeInitMgmtIp
()
{}
int
vnodeSaveCreateMsgIntoQueue
(
SVnodeObj
*
pVnode
,
char
*
pMsg
,
int
msgLen
)
{
return
0
;
}
\ No newline at end of file
src/dnode/src/dnodeRead.c
0 → 100644
浏览文件 @
abb7731a
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
src/dnode/src/dnodeSystem.c
浏览文件 @
abb7731a
...
...
@@ -133,7 +133,7 @@ int dnodeInitSystem() {
return
-
1
;
}
v
nodeInitMgmtIp
();
d
nodeInitMgmtIp
();
tsPrintGlobalConfig
();
dPrint
(
"Server IP address is:%s"
,
tsPrivateIp
);
...
...
@@ -216,3 +216,44 @@ void dnodeCountRequest(SCountInfo *info) {
info
->
selectReqNum
=
atomic_exchange_32
(
&
vnodeSelectReqNum
,
0
);
info
->
insertReqNum
=
atomic_exchange_32
(
&
vnodeInsertReqNum
,
0
);
}
//spec
extern
SModule
tsModule
[
TSDB_MOD_MAX
];
int
taosCreateTierDirectory
()
{
struct
stat
dirstat
;
strcpy
(
tsDirectory
,
dataDir
);
if
(
stat
(
dataDir
,
&
dirstat
)
<
0
)
{
mkdir
(
dataDir
,
0755
);
}
char
fileName
[
128
];
sprintf
(
fileName
,
"%s/tsdb"
,
tsDirectory
);
mkdir
(
fileName
,
0755
);
sprintf
(
fileName
,
"%s/data"
,
tsDirectory
);
mkdir
(
fileName
,
0755
);
sprintf
(
mgmtDirectory
,
"%s/mgmt"
,
tsDirectory
);
sprintf
(
tsDirectory
,
"%s/tsdb"
,
dataDir
);
dnodeCheckDbRunning
(
dataDir
);
return
0
;
}
int
dnodeInitSystemSpec
()
{
return
0
;
}
void
dnodeStartModuleSpec
()
{
for
(
int
mod
=
1
;
mod
<
TSDB_MOD_MAX
;
++
mod
)
{
if
(
tsModule
[
mod
].
num
!=
0
&&
tsModule
[
mod
].
startFp
)
{
if
((
*
tsModule
[
mod
].
startFp
)()
!=
0
)
{
dError
(
"failed to start module:%d"
,
mod
);
}
}
}
}
void
dnodeParseParameterK
()
{}
src/dnode/src/dnodeWrite.c
0 → 100644
浏览文件 @
abb7731a
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
src/dnode/src/vnodeMgmt.c
浏览文件 @
abb7731a
...
...
@@ -80,7 +80,7 @@ int vnodeInitSystem() {
return
-
1
;
}
if
(
vnodeInitMgmt
()
<
0
)
{
if
(
dnodeInitMgmtConn
()
<
0
)
{
dError
(
"failed to init communication to mgmt"
);
return
-
1
;
}
...
...
src/mnode/lite/src/mgmtDnodeInt.spec.c
浏览文件 @
abb7731a
...
...
@@ -28,7 +28,7 @@
extern
void
*
dmQhandle
;
void
*
mgmtStatusTimer
=
NULL
;
void
mgmtProcessMsgFromDnode
(
char
*
content
,
int
msgLen
,
int
msgType
,
SDnodeObj
*
pObj
);
void
vnodeProcessMsgFromMgmtSpec
(
SSchedMsg
*
sched
);
void
dnodeProcessMsgFromMgmt
(
SSchedMsg
*
sched
);
char
*
taosBuildRspMsgToDnodeWithSize
(
SDnodeObj
*
pObj
,
char
type
,
int
size
)
{
char
*
pStart
=
(
char
*
)
malloc
(
size
);
...
...
@@ -67,7 +67,7 @@ int taosSendMsgToDnode(SDnodeObj *pObj, char *msg, int msgLen) {
* Lite version has no message header, so minus one
*/
SSchedMsg
schedMsg
;
schedMsg
.
fp
=
vnodeProcessMsgFromMgmtSpec
;
schedMsg
.
fp
=
dnodeProcessMsgFromMgmt
;
schedMsg
.
msg
=
msg
-
1
;
schedMsg
.
ahandle
=
NULL
;
schedMsg
.
thandle
=
NULL
;
...
...
src/vnode/detail/inc/vnode.h
浏览文件 @
abb7731a
...
...
@@ -524,7 +524,7 @@ SConnSec *vnodeGetMeterSec(int vnode, int sid);
int
vnodeCreateMeterObjFile
(
int
vnode
);
// mgmt
int
vnodeInitMgmt
();
int
dnodeInitMgmtConn
();
void
vnodeCleanUpMgmt
();
...
...
src/vnode/detail/inc/vnodeSystem.h
浏览文件 @
abb7731a
...
...
@@ -32,7 +32,7 @@ int vnodeInitStore();
int
vnodeInitPeer
(
int
numOfThreads
);
int
vnodeInitMgmt
();
int
dnodeInitMgmtConn
();
#ifdef __cplusplus
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录