提交 2abbf436 编写于 作者: S slguan

#1177

上级 0fb0d0bd
......@@ -2,7 +2,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine)
IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/dnode/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/mnode/detail/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/vnode/detail/inc)
......@@ -11,7 +14,6 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/modules/monitor/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/inc)
INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/util/cluster/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(inc)
AUX_SOURCE_DIRECTORY(src SRC)
......
......@@ -33,6 +33,8 @@ enum _module {
TSDB_MOD_MGMT,
TSDB_MOD_HTTP,
TSDB_MOD_MONITOR,
TSDB_MOD_DCLUSTER,
TSDB_MOD_MSTORAGE,
TSDB_MOD_MAX
};
......@@ -54,9 +56,6 @@ void dnodeAllocModules();
int32_t dnodeInitModules();
void dnodeCleanUpModules();
extern void (*dnodeStartModules)();
void dnodeStartModulesEdgeImp();
#ifdef __cplusplus
}
#endif
......
......@@ -20,9 +20,6 @@
extern "C" {
#endif
void (*dnodeParseParameterK)();
void dnodeParseParameterKComImp();
#ifdef __cplusplus
}
#endif
......
......@@ -26,9 +26,6 @@ extern "C" {
extern pthread_mutex_t dmutex;
extern bool tsDnodeStopping;
extern int (*dnodeInitStorage)();
extern void (*dnodeCleanupStorage)();
extern int (*dnodeCheckSystem)();
int dnodeInitSystem();
void dnodeCleanUpSystem();
......
......@@ -23,9 +23,11 @@
#include "httpSystem.h"
#include "mgmtSystem.h"
#include "dcluster.h"
#include "mstorage.h"
SModule tsModule[TSDB_MOD_MAX] = {0};
uint32_t tsModuleStatus = 0;
void (*dnodeStartModules)() = NULL;
void dnodeAllocModules() {
tsModule[TSDB_MOD_MGMT].name = "mgmt";
......@@ -116,7 +118,7 @@ int32_t dnodeInitModules() {
return 0;
}
void dnodeStartModulesEdgeImp() {
void dnodeStartModulesImp() {
for (int mod = 1; mod < TSDB_MOD_MAX; ++mod) {
if (tsModule[mod].num != 0 && tsModule[mod].startFp) {
if ((*tsModule[mod].startFp)() != 0) {
......@@ -129,3 +131,4 @@ void dnodeStartModulesEdgeImp() {
(*tsModule[TSDB_MOD_MGMT].cleanUpFp)();
}
}
void (*dnodeStartModules)() = dnodeStartModulesImp;
......@@ -14,16 +14,37 @@
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "dnodeSystem.h"
#include "tglobalcfg.h"
#include "tsdb.h"
#include "vnode.h"
#include "dnodeSystem.h"
#ifdef CLUSTER
#include "dnodeCluster.h"
#include "httpAdmin.h"
#include "mnodeAccount.h"
#include "mnodeBalance.h"
#include "mnodeCluster.h"
#include "mnodeReplica.h"
#include "multilevelStorage.h"
#include "vnodeCluster.h"
#include "vnodeReplica.h"
void init() {
dnodeClusterInit();
httpAdminInit();
mnodeAccountInit();
mnodeBalanceInit();
mnodeClusterInit();
mnodeReplicaInit();
multilevelStorageInit();
vnodeClusterInit();
vnodeReplicaInit();
}
#endif
void (*dnodeParseParameterK)() = NULL;
void dnodeParseParameterKComImp() {}
void dnodeParseParameterKImp() {}
void (*dnodeParseParameterK)() = dnodeParseParameterKImp;
/* Termination handler */
void signal_handler(int signum, siginfo_t *sigInfo, void *context) {
......
......@@ -18,6 +18,7 @@
#include "tsdb.h"
#include "tlog.h"
#include "ttimer.h"
#include "dnode.h"
#include "dnodeMgmt.h"
#include "dnodeModule.h"
#include "dnodeService.h"
......@@ -285,11 +286,9 @@ void dnodeInitPlugin() {
taosSendMsgToMnode = taosSendMsgToMnodeEdgeImp;
taosSendSimpleRspToMnode = taosSendSimpleRspToMnodeEdgeImp;
dnodeParseParameterK = dnodeParseParameterKComImp;
dnodeCheckSystem = dnodeCheckSystemComImp;
dnodeInitStorage = dnodeInitStorageComImp;
dnodeCleanupStorage = dnodeCleanupStorageComImp;
dnodeStartModules = dnodeStartModulesEdgeImp;
}
/*
* 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_H
#define TDENGINE_DNODE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <pthread.h>
extern pthread_mutex_t dmutex;
// dnodeCluster
extern void (*dnodeStartModules)();
extern void (*dnodeParseParameterK)();
extern int32_t (*dnodeCheckSystem)();
// multilevelStorage
extern int32_t (*dnodeInitStorage)();
extern void (*dnodeCleanupStorage)();
void dnodeCheckDbRunning(const char* dir);
#ifdef __cplusplus
}
#endif
#endif
......@@ -262,6 +262,9 @@ SGlobalConfig *tsGetConfigOption(const char *option);
#define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize)
extern char mgmtDirectory[];
#ifdef __cplusplus
}
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册