Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
78d9ffd7
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看板
提交
78d9ffd7
编写于
2月 06, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#1177
上级
2abbf436
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
52 addition
and
115 deletion
+52
-115
src/CMakeLists.txt
src/CMakeLists.txt
+1
-0
src/dnode/inc/dnodeMgmt.h
src/dnode/inc/dnodeMgmt.h
+1
-26
src/dnode/inc/dnodeService.h
src/dnode/inc/dnodeService.h
+0
-27
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+22
-26
src/dnode/src/dnodeModule.c
src/dnode/src/dnodeModule.c
+0
-3
src/dnode/src/dnodeService.c
src/dnode/src/dnodeService.c
+1
-1
src/dnode/src/dnodeSystem.c
src/dnode/src/dnodeSystem.c
+7
-29
src/inc/dnode.h
src/inc/dnode.h
+18
-0
src/mnode/CMakeLists.txt
src/mnode/CMakeLists.txt
+0
-1
src/mnode/lite/src/mgmtDnodeInt.spec.c
src/mnode/lite/src/mgmtDnodeInt.spec.c
+2
-2
src/sdb/CMakeLists.txt
src/sdb/CMakeLists.txt
+0
-0
src/sdb/inc/hashint.h
src/sdb/inc/hashint.h
+0
-0
src/sdb/inc/hashstr.h
src/sdb/inc/hashstr.h
+0
-0
src/sdb/inc/sdbint.h
src/sdb/inc/sdbint.h
+0
-0
src/sdb/src/hashint.c
src/sdb/src/hashint.c
+0
-0
src/sdb/src/hashstr.c
src/sdb/src/hashstr.c
+0
-0
src/sdb/src/sdbEngine.c
src/sdb/src/sdbEngine.c
+0
-0
src/sdb/src/sdbstr.c
src/sdb/src/sdbstr.c
+0
-0
未找到文件。
src/CMakeLists.txt
浏览文件 @
78d9ffd7
...
...
@@ -7,6 +7,7 @@ ADD_SUBDIRECTORY(rpc)
ADD_SUBDIRECTORY
(
client
)
ADD_SUBDIRECTORY
(
kit
)
ADD_SUBDIRECTORY
(
modules
)
ADD_SUBDIRECTORY
(
sdb
)
ADD_SUBDIRECTORY
(
mnode
)
ADD_SUBDIRECTORY
(
dnode
)
ADD_SUBDIRECTORY
(
vnode
)
...
...
src/dnode/inc/dnodeMgmt.h
浏览文件 @
78d9ffd7
...
...
@@ -21,14 +21,7 @@ extern "C" {
#endif
#include "tsched.h"
typedef
struct
{
char
id
[
20
];
char
sid
;
void
*
thandle
;
int
mgmtIndex
;
char
status
;
// 0:offline, 1:online
}
SMgmtObj
;
#include "dnode.h"
int
vnodeProcessCreateMeterRequest
(
char
*
pMsg
,
int
msgLen
,
SMgmtObj
*
pMgmtObj
);
int
vnodeProcessRemoveMeterRequest
(
char
*
pMsg
,
int
msgLen
,
SMgmtObj
*
pMgmtObj
);
...
...
@@ -37,24 +30,6 @@ void dnodeDistributeMsgFromMgmt(char *content, int msgLen, int msgType, SMgmtObj
void
mgmtProcessMsgFromDnodeSpec
(
SSchedMsg
*
sched
);
extern
void
*
dmQhandle
;
extern
char
*
(
*
taosBuildRspMsgToMnodeWithSize
)(
SMgmtObj
*
pObj
,
char
type
,
int
size
);
extern
char
*
(
*
taosBuildReqMsgToMnodeWithSize
)(
SMgmtObj
*
pObj
,
char
type
,
int
size
);
extern
char
*
(
*
taosBuildRspMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
);
extern
char
*
(
*
taosBuildReqMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
);
extern
int
(
*
taosSendMsgToMnode
)(
SMgmtObj
*
pObj
,
char
*
msg
,
int
msgLen
);
extern
int
(
*
taosSendSimpleRspToMnode
)(
SMgmtObj
*
pObj
,
char
rsptype
,
char
code
);
extern
void
(
*
dnodeInitMgmtIp
)();
extern
int
(
*
dnodeInitMgmtConn
)();
char
*
taosBuildRspMsgToMnodeWithSizeEdgeImp
(
SMgmtObj
*
pObj
,
char
type
,
int
size
);
char
*
taosBuildReqMsgToMnodeWithSizeEdgeImp
(
SMgmtObj
*
pObj
,
char
type
,
int
size
);
char
*
taosBuildRspMsgToMnodeEdgeImp
(
SMgmtObj
*
pObj
,
char
type
);
char
*
taosBuildReqMsgToMnodeEdgeImp
(
SMgmtObj
*
pObj
,
char
type
);
int
taosSendMsgToMnodeEdgeImp
(
SMgmtObj
*
pObj
,
char
*
msg
,
int
msgLen
);
int
taosSendSimpleRspToMnodeEdgeImp
(
SMgmtObj
*
pObj
,
char
rsptype
,
char
code
);
void
dnodeInitMgmtIpEdgeImp
();
void
*
dnodeProcessMsgFromMgmtEdgeImp
(
SSchedMsg
*
sched
);
int
dnodeInitMgmtConnEdgeImp
();
#ifdef __cplusplus
}
...
...
src/dnode/inc/dnodeService.h
已删除
100644 → 0
浏览文件 @
2abbf436
/*
* 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_DNODE_SERVICE_H
#define TDENGINE_DNODE_SERVICE_H
#ifdef __cplusplus
extern
"C"
{
#endif
#ifdef __cplusplus
}
#endif
#endif
src/dnode/src/dnodeMgmt.c
浏览文件 @
78d9ffd7
...
...
@@ -17,6 +17,7 @@
#include "os.h"
#include "dnode.h"
#include "dnodeSystem.h"
#include "dnodeMgmt.h"
...
...
@@ -43,17 +44,7 @@ void vnodeUpdateHeadFile(int vnode, int oldTables, int newTables);
void
vnodeOpenVnode
(
int
vnode
);
void
vnodeCleanUpOneVnode
(
int
vnode
);
char
*
(
*
taosBuildRspMsgToMnodeWithSize
)(
SMgmtObj
*
pObj
,
char
type
,
int
size
)
=
NULL
;
char
*
(
*
taosBuildReqMsgToMnodeWithSize
)(
SMgmtObj
*
pObj
,
char
type
,
int
size
)
=
NULL
;
char
*
(
*
taosBuildRspMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
)
=
NULL
;
char
*
(
*
taosBuildReqMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
)
=
NULL
;
int
(
*
taosSendMsgToMnode
)(
SMgmtObj
*
pObj
,
char
*
msg
,
int
msgLen
)
=
NULL
;
int
(
*
taosSendSimpleRspToMnode
)(
SMgmtObj
*
pObj
,
char
rsptype
,
char
code
)
=
NULL
;
void
(
*
dnodeInitMgmtIp
)()
=
NULL
;
int
(
*
dnodeInitMgmtConn
)()
=
NULL
;
char
*
taosBuildRspMsgToMnodeWithSizeEdgeImp
(
SMgmtObj
*
pObj
,
char
type
,
int
size
)
{
char
*
taosBuildRspMsgToMnodeWithSizeImp
(
SMgmtObj
*
pObj
,
char
type
,
int
size
)
{
char
*
pStart
=
(
char
*
)
malloc
(
size
);
if
(
pStart
==
NULL
)
{
return
NULL
;
...
...
@@ -62,8 +53,9 @@ char *taosBuildRspMsgToMnodeWithSizeEdgeImp(SMgmtObj *pObj, char type, int size)
*
pStart
=
type
;
return
pStart
+
1
;
}
char
*
(
*
taosBuildRspMsgToMnodeWithSize
)(
SMgmtObj
*
pObj
,
char
type
,
int
size
)
=
taosBuildRspMsgToMnodeWithSizeImp
;
char
*
taosBuildReqMsgToMnodeWithSize
Edge
Imp
(
SMgmtObj
*
pObj
,
char
type
,
int
size
)
{
char
*
taosBuildReqMsgToMnodeWithSizeImp
(
SMgmtObj
*
pObj
,
char
type
,
int
size
)
{
char
*
pStart
=
(
char
*
)
malloc
(
size
);
if
(
pStart
==
NULL
)
{
return
NULL
;
...
...
@@ -72,16 +64,19 @@ char *taosBuildReqMsgToMnodeWithSizeEdgeImp(SMgmtObj *pObj, char type, int size)
*
pStart
=
type
;
return
pStart
+
1
;
}
char
*
(
*
taosBuildReqMsgToMnodeWithSize
)(
SMgmtObj
*
pObj
,
char
type
,
int
size
)
=
taosBuildReqMsgToMnodeWithSizeImp
;
char
*
taosBuildRspMsgToMnode
Edge
Imp
(
SMgmtObj
*
pObj
,
char
type
)
{
return
taosBuildRspMsgToMnodeWithSize
(
pObj
,
type
,
256
);
char
*
taosBuildRspMsgToMnodeImp
(
SMgmtObj
*
pObj
,
char
type
)
{
return
taosBuildRspMsgToMnodeWithSize
Imp
(
pObj
,
type
,
256
);
}
char
*
(
*
taosBuildRspMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
)
=
taosBuildRspMsgToMnodeImp
;
char
*
taosBuildReqMsgToMnode
Edge
Imp
(
SMgmtObj
*
pObj
,
char
type
)
{
return
taosBuildReqMsgToMnodeWithSize
(
pObj
,
type
,
256
);
char
*
taosBuildReqMsgToMnodeImp
(
SMgmtObj
*
pObj
,
char
type
)
{
return
taosBuildReqMsgToMnodeWithSize
Imp
(
pObj
,
type
,
256
);
}
char
*
(
*
taosBuildReqMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
)
=
taosBuildReqMsgToMnodeImp
;
int
taosSendMsgToMnode
Edge
Imp
(
SMgmtObj
*
pObj
,
char
*
msg
,
int
msgLen
)
{
int
taosSendMsgToMnodeImp
(
SMgmtObj
*
pObj
,
char
*
msg
,
int
msgLen
)
{
dTrace
(
"msg:%s is sent to mnode"
,
taosMsg
[(
uint8_t
)(
*
(
msg
-
1
))]);
/*
...
...
@@ -96,8 +91,9 @@ int taosSendMsgToMnodeEdgeImp(SMgmtObj *pObj, char *msg, int msgLen) {
return
0
;
}
int
(
*
taosSendMsgToMnode
)(
SMgmtObj
*
pObj
,
char
*
msg
,
int
msgLen
)
=
taosSendMsgToMnodeImp
;
int
taosSendSimpleRspToMnode
Edge
Imp
(
SMgmtObj
*
pObj
,
char
rsptype
,
char
code
)
{
int
taosSendSimpleRspToMnodeImp
(
SMgmtObj
*
pObj
,
char
rsptype
,
char
code
)
{
char
*
pStart
=
taosBuildRspMsgToMnode
(
0
,
rsptype
);
if
(
pStart
==
NULL
)
{
return
0
;
...
...
@@ -108,8 +104,15 @@ int taosSendSimpleRspToMnodeEdgeImp(SMgmtObj *pObj, char rsptype, char code) {
return
0
;
}
int
(
*
taosSendSimpleRspToMnode
)(
SMgmtObj
*
pObj
,
char
rsptype
,
char
code
)
=
taosSendSimpleRspToMnodeImp
;
int32_t
dnodeInitMgmtImp
()
{
return
0
;
}
int32_t
(
*
dnodeInitMgmt
)()
=
dnodeInitMgmtImp
;
void
*
dnodeProcessMsgFromMgmtEdgeImp
(
SSchedMsg
*
sched
)
{
void
dnodeInitMgmtIpImp
()
{}
void
(
*
dnodeInitMgmtIp
)()
=
dnodeInitMgmtIpImp
;
void
*
dnodeProcessMsgFromMgmtImp
(
SSchedMsg
*
sched
)
{
char
msgType
=
*
sched
->
msg
;
char
*
content
=
sched
->
msg
+
1
;
...
...
@@ -122,13 +125,6 @@ void* dnodeProcessMsgFromMgmtEdgeImp(SSchedMsg *sched) {
return
NULL
;
}
int
dnodeInitMgmtConnEdgeImp
()
{
return
0
;
}
void
dnodeInitMgmtIpEdgeImp
()
{}
void
dnodeDistributeMsgFromMgmt
(
char
*
content
,
int
msgLen
,
int
msgType
,
SMgmtObj
*
pObj
)
{
if
(
msgType
==
TSDB_MSG_TYPE_CREATE
)
{
vnodeProcessCreateMeterRequest
(
content
,
msgLen
,
pObj
);
...
...
src/dnode/src/dnodeModule.c
浏览文件 @
78d9ffd7
...
...
@@ -23,9 +23,6 @@
#include "httpSystem.h"
#include "mgmtSystem.h"
#include "dcluster.h"
#include "mstorage.h"
SModule
tsModule
[
TSDB_MOD_MAX
]
=
{
0
};
uint32_t
tsModuleStatus
=
0
;
...
...
src/dnode/src/dnodeService.c
浏览文件 @
78d9ffd7
...
...
@@ -36,7 +36,7 @@
mnodeAccountInit
();
mnodeBalanceInit
();
mnodeClusterInit
();
mnode
ReplicaInit
();
sdb
ReplicaInit
();
multilevelStorageInit
();
vnodeClusterInit
();
vnodeReplicaInit
();
...
...
src/dnode/src/dnodeSystem.c
浏览文件 @
78d9ffd7
...
...
@@ -21,7 +21,6 @@
#include "dnode.h"
#include "dnodeMgmt.h"
#include "dnodeModule.h"
#include "dnodeService.h"
#include "dnodeSystem.h"
#include "monitorSystem.h"
#include "httpSystem.h"
...
...
@@ -43,14 +42,10 @@ void * queryQhandle;
int
tsVnodePeers
=
TSDB_VNODES_SUPPORT
-
1
;
int
tsMaxQueues
;
uint32_t
tsRebootTime
;
int
(
*
dnodeInitStorage
)()
=
NULL
;
void
(
*
dnodeCleanupStorage
)()
=
NULL
;
int
(
*
dnodeCheckSystem
)()
=
NULL
;
int32_t
dnodeInitRpcQHandle
();
int32_t
dnodeInitQueryQHandle
();
int32_t
dnodeInitTmrCtl
();
void
dnodeInitPlugin
();
void
dnodeCountRequestImp
(
SCountInfo
*
info
);
void
dnodeCleanUpSystem
()
{
...
...
@@ -89,8 +84,6 @@ int dnodeInitSystem() {
char
temp
[
128
];
struct
stat
dirstat
;
dnodeInitPlugin
();
taosResolveCRC
();
tsRebootTime
=
taosGetTimestampSec
();
...
...
@@ -170,7 +163,7 @@ int dnodeInitSystem() {
return
-
1
;
}
if
(
dnodeInitMgmt
Conn
()
<
0
)
{
if
(
dnodeInitMgmt
()
<
0
)
{
dError
(
"failed to init communication to mgmt"
);
return
-
1
;
}
...
...
@@ -208,7 +201,7 @@ void dnodeCountRequestImp(SCountInfo *info) {
info
->
insertReqNum
=
atomic_exchange_32
(
&
vnodeInsertReqNum
,
0
);
}
int
dnodeInitStorage
Com
Imp
()
{
int
dnodeInitStorageImp
()
{
struct
stat
dirstat
;
strcpy
(
tsDirectory
,
dataDir
);
if
(
stat
(
dataDir
,
&
dirstat
)
<
0
)
{
...
...
@@ -229,8 +222,10 @@ int dnodeInitStorageComImp() {
return
0
;
}
int32_t
(
*
dnodeInitStorage
)()
=
dnodeInitStorageImp
;
void
dnodeCleanupStorageComImp
()
{}
void
dnodeCleanupStorageImp
()
{}
void
(
*
dnodeCleanupStorage
)()
=
dnodeCleanupStorageImp
;
int32_t
dnodeInitQueryQHandle
()
{
int
numOfThreads
=
tsRatioOfQueryThreads
*
tsNumOfCores
*
tsNumOfThreadsPerCore
;
...
...
@@ -271,24 +266,7 @@ int32_t dnodeInitRpcQHandle() {
}
int
dnodeCheckSystemComImp
()
{
return
0
;
}
void
dnodeInitPlugin
()
{
dnodeInitMgmtConn
=
dnodeInitMgmtConnEdgeImp
;
dnodeInitMgmtIp
=
dnodeInitMgmtIpEdgeImp
;
taosBuildRspMsgToMnodeWithSize
=
taosBuildRspMsgToMnodeWithSizeEdgeImp
;
taosBuildReqMsgToMnodeWithSize
=
taosBuildReqMsgToMnodeWithSizeEdgeImp
;
taosBuildRspMsgToMnode
=
taosBuildRspMsgToMnodeEdgeImp
;
taosBuildReqMsgToMnode
=
taosBuildReqMsgToMnodeEdgeImp
;
taosSendMsgToMnode
=
taosSendMsgToMnodeEdgeImp
;
taosSendSimpleRspToMnode
=
taosSendSimpleRspToMnodeEdgeImp
;
dnodeCheckSystem
=
dnodeCheckSystemComImp
;
dnodeInitStorage
=
dnodeInitStorageComImp
;
dnodeCleanupStorage
=
dnodeCleanupStorageComImp
;
}
int
dnodeCheckSystemImp
()
{
return
0
;
}
int
(
*
dnodeCheckSystem
)()
=
dnodeCheckSystemImp
;
src/inc/dnode.h
浏览文件 @
78d9ffd7
...
...
@@ -23,12 +23,30 @@ extern "C" {
#include <stdint.h>
#include <pthread.h>
typedef
struct
{
char
id
[
20
];
char
sid
;
void
*
thandle
;
int
mgmtIndex
;
char
status
;
// 0:offline, 1:online
}
SMgmtObj
;
// global variables
extern
pthread_mutex_t
dmutex
;
// dnodeCluster
extern
void
(
*
dnodeStartModules
)();
extern
void
(
*
dnodeParseParameterK
)();
extern
int32_t
(
*
dnodeCheckSystem
)();
extern
char
*
(
*
taosBuildRspMsgToMnodeWithSize
)(
SMgmtObj
*
pObj
,
char
type
,
int
size
);
extern
char
*
(
*
taosBuildReqMsgToMnodeWithSize
)(
SMgmtObj
*
pObj
,
char
type
,
int
size
);
extern
char
*
(
*
taosBuildRspMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
);
extern
char
*
(
*
taosBuildReqMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
);
extern
int
(
*
taosSendMsgToMnode
)(
SMgmtObj
*
pObj
,
char
*
msg
,
int
msgLen
);
extern
int
(
*
taosSendSimpleRspToMnode
)(
SMgmtObj
*
pObj
,
char
rsptype
,
char
code
);
extern
void
(
*
dnodeInitMgmtIp
)();
extern
int
(
*
dnodeInitMgmt
)();
// multilevelStorage
extern
int32_t
(
*
dnodeInitStorage
)();
...
...
src/mnode/CMakeLists.txt
浏览文件 @
78d9ffd7
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8
)
PROJECT
(
TDengine
)
ADD_SUBDIRECTORY
(
sdb
)
ADD_SUBDIRECTORY
(
detail
)
ADD_SUBDIRECTORY
(
lite
)
\ No newline at end of file
src/mnode/lite/src/mgmtDnodeInt.spec.c
浏览文件 @
78d9ffd7
...
...
@@ -28,7 +28,7 @@
extern
void
*
dmQhandle
;
void
*
mgmtStatusTimer
=
NULL
;
void
mgmtProcessMsgFromDnode
(
char
*
content
,
int
msgLen
,
int
msgType
,
SDnodeObj
*
pObj
);
void
*
dnodeProcessMsgFromMgmtEdge
Imp
(
SSchedMsg
*
sched
);
void
*
dnodeProcessMsgFromMgmt
Imp
(
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
=
dnodeProcessMsgFromMgmt
Edge
Imp
;
schedMsg
.
fp
=
dnodeProcessMsgFromMgmtImp
;
schedMsg
.
msg
=
msg
-
1
;
schedMsg
.
ahandle
=
NULL
;
schedMsg
.
thandle
=
NULL
;
...
...
src/
mnode/
sdb/CMakeLists.txt
→
src/sdb/CMakeLists.txt
浏览文件 @
78d9ffd7
文件已移动
src/
mnode/
sdb/inc/hashint.h
→
src/sdb/inc/hashint.h
浏览文件 @
78d9ffd7
文件已移动
src/
mnode/
sdb/inc/hashstr.h
→
src/sdb/inc/hashstr.h
浏览文件 @
78d9ffd7
文件已移动
src/
mnode/
sdb/inc/sdbint.h
→
src/sdb/inc/sdbint.h
浏览文件 @
78d9ffd7
文件已移动
src/
mnode/
sdb/src/hashint.c
→
src/sdb/src/hashint.c
浏览文件 @
78d9ffd7
文件已移动
src/
mnode/
sdb/src/hashstr.c
→
src/sdb/src/hashstr.c
浏览文件 @
78d9ffd7
文件已移动
src/
mnode/
sdb/src/sdbEngine.c
→
src/sdb/src/sdbEngine.c
浏览文件 @
78d9ffd7
文件已移动
src/
mnode/
sdb/src/sdbstr.c
→
src/sdb/src/sdbstr.c
浏览文件 @
78d9ffd7
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录