TDengine/include/server/dnode/dnode.h

80 lines
1.9 KiB
C
Raw Normal View History

2021-09-22 12:29:24 +00:00
/*
* 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
2021-10-04 12:47:39 +00:00
struct SRpcEpSet;
struct SRpcMsg;
2021-09-22 12:29:24 +00:00
/**
* Initialize and start the dnode module.
*
2021-10-05 05:16:54 +00:00
* @return Error code.
2021-09-22 12:29:24 +00:00
*/
2021-10-05 05:16:54 +00:00
int32_t dnodeInit();
2021-09-22 12:29:24 +00:00
/**
* Stop and cleanup dnode module.
2021-09-22 12:29:24 +00:00
*/
2021-10-05 05:16:54 +00:00
void dnodeCleanup();
2021-09-22 12:29:24 +00:00
/**
* Send messages to other dnodes, such as create vnode message.
*
* @param epSet, the endpoint list of the dnodes.
* @param rpcMsg, message to be sent.
2021-09-22 12:29:24 +00:00
*/
2021-10-05 05:16:54 +00:00
void dnodeSendMsgToDnode(struct SRpcEpSet *epSet, struct SRpcMsg *rpcMsg);
2021-09-22 12:29:24 +00:00
/**
* Send messages to mnode, such as config message.
*
* @param rpcMsg, message to be sent.
2021-09-22 12:29:24 +00:00
*/
2021-10-05 05:16:54 +00:00
void dnodeSendMsgToMnode(struct SRpcMsg *rpcMsg);
2021-09-22 12:29:24 +00:00
/**
* Send redirect message to dnode or shell.
2021-09-22 12:29:24 +00:00
*
* @param rpcMsg, message to be sent.
* @param forShell, used to identify whether to send to shell or dnode.
2021-09-22 12:29:24 +00:00
*/
2021-10-05 05:16:54 +00:00
void dnodeSendRedirectMsg(struct SRpcMsg *rpcMsg, bool forShell);
2021-09-22 12:29:24 +00:00
/**
* Get the corresponding endpoint information from dnodeId.
2021-09-22 12:29:24 +00:00
*
* @param dnodeId, the id ot dnode.
* @param ep, the endpoint of dnode.
* @param fqdn, the fqdn of dnode.
* @param port, the port of dnode.
2021-09-22 12:29:24 +00:00
*/
2021-10-25 09:39:21 +00:00
void dnodeGetEp(int32_t dnodeId, char *ep, char *fqdn, uint16_t *port);
2021-09-22 12:29:24 +00:00
2021-10-28 03:46:27 +00:00
/**
* Report the startup progress.
*/
void dnodeReportStartup(char *name, char *desc);
2021-09-22 12:29:24 +00:00
#ifdef __cplusplus
}
#endif
#endif /*_TD_DNODE_H_*/