TD-10430
This commit is contained in:
parent
3bdd41fb32
commit
ce7a1600eb
|
@ -1,27 +0,0 @@
|
||||||
/*
|
|
||||||
* 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 _TD_DNODE_H_
|
|
||||||
#define _TD_DNODE_H_
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /*_TD_DNODE_H_*/
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
/*
|
||||||
|
* 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 _TD_DNODE_H_
|
||||||
|
#define _TD_DNODE_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct SRpcMsg;
|
||||||
|
struct SRpcEpSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize and start the dnode module
|
||||||
|
*
|
||||||
|
* @return Error Code
|
||||||
|
*/
|
||||||
|
int32_t dnodeInit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stop and cleanup dnode module
|
||||||
|
*/
|
||||||
|
void dnodeCleanup();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send messages to other dnodes, such as create vnode message.
|
||||||
|
*
|
||||||
|
* @param epSet The endpoint list of the dnodes.
|
||||||
|
* @param rpcMsg Message to be sent.
|
||||||
|
*/
|
||||||
|
void dnodeSendMsgToDnode(SRpcEpSet *epSet, SRpcMsg *rpcMsg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send messages to mnode, such as config message.
|
||||||
|
*
|
||||||
|
* @param rpcMsg Message to be sent.
|
||||||
|
*/
|
||||||
|
void dnodeSendMsgToMnode(SRpcMsg *rpcMsg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the corresponding endpoint information from dnodeId.
|
||||||
|
*
|
||||||
|
* @param dnodeId
|
||||||
|
* @param ep The endpoint of dnode
|
||||||
|
* @param fqdn The fqdn of dnode
|
||||||
|
* @param port The port of dnode
|
||||||
|
*/
|
||||||
|
void dnodeGetDnodeEp(int32_t dnodeId, char *ep, char *fqdn, uint16_t *port);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Report to dnode the start-up steps of other modules
|
||||||
|
*
|
||||||
|
* @param name Name of the start-up phase.
|
||||||
|
* @param desc Description of the start-up phase.
|
||||||
|
*/
|
||||||
|
void dnodeReportStartup(char *name, char *desc);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /*_TD_DNODE_H_*/
|
|
@ -20,6 +20,47 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct SRpcMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deploy Mnode instances in Dnode.
|
||||||
|
*
|
||||||
|
* @return Error Code.
|
||||||
|
*/
|
||||||
|
int32_t mnodeDeploy();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete the Mnode instance deployed in Dnode.
|
||||||
|
*/
|
||||||
|
void mnodeUnDeploy();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start Mnode service.
|
||||||
|
*
|
||||||
|
* @return Error Code.
|
||||||
|
*/
|
||||||
|
int32_t mnodeStart();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stop Mnode service.
|
||||||
|
*/
|
||||||
|
int32_t mnodeStop();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface for processing messages.
|
||||||
|
*
|
||||||
|
* @param pMsg Message to be processed.
|
||||||
|
* @return Error code
|
||||||
|
*/
|
||||||
|
int32_t mnodeProcessMsg(SRpcMsg *pMsg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the Mnode is in service.
|
||||||
|
*
|
||||||
|
* @return Server status.
|
||||||
|
*/
|
||||||
|
bool mnodeIsServing();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -12,3 +12,51 @@
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* 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/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef _TD_VNODE_H_
|
||||||
|
#define _TD_VNODE_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct SRpcMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start Initialize Vnode module.
|
||||||
|
*
|
||||||
|
* @return Error Code.
|
||||||
|
*/
|
||||||
|
int32_t vnodeInit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cleanup Vnode module.
|
||||||
|
*/
|
||||||
|
void vnodeCleanup();
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int64_t queryMsgCount;
|
||||||
|
int64_t writeMsgCount;
|
||||||
|
} SVnodeStat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the statistical information of Vnode
|
||||||
|
*
|
||||||
|
* @param stat Statistical information.
|
||||||
|
* @return Error Code.
|
||||||
|
*/
|
||||||
|
int32_t vnodeGetStatistics(SVnodeStat *stat);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface for processing messages.
|
||||||
|
*
|
||||||
|
* @param pMsg Message to be processed.
|
||||||
|
* @return Error code
|
||||||
|
*/
|
||||||
|
int32_t vnodeProcessMsg(SRpcMsg *pMsg);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /*_TD_VNODE_H_*/
|
|
@ -2,7 +2,7 @@ add_subdirectory(mnode)
|
||||||
add_subdirectory(vnode)
|
add_subdirectory(vnode)
|
||||||
add_subdirectory(qnode)
|
add_subdirectory(qnode)
|
||||||
|
|
||||||
aux_source_directory(dnode TAOSD_SRC)
|
aux_source_directory(taosd TAOSD_SRC)
|
||||||
add_executable(taosd ${TAOSD_SRC})
|
add_executable(taosd ${TAOSD_SRC})
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
taosd
|
taosd
|
||||||
|
|
Loading…
Reference in New Issue