From 26a96ba78d31a8f91c173888fb9caffc5872d106 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 29 Sep 2021 13:48:55 +0800 Subject: [PATCH] [TD-10430] header file for the dnode module --- include/server/dnode/dnode.h | 43 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/include/server/dnode/dnode.h b/include/server/dnode/dnode.h index fae60495e9..711b6d92a5 100644 --- a/include/server/dnode/dnode.h +++ b/include/server/dnode/dnode.h @@ -20,56 +20,59 @@ extern "C" { #endif -struct SRpcMsg; -struct SRpcEpSet; - /** * Initialize and start the dnode module - * - * @return Error Code + * + * @return Instance of dnode module */ -int32_t dnodeInit(); +struct Dnode *dnodeCreateInstance(); /** * Stop and cleanup dnode module + * + * @param dnode Instance of dnode module */ -void dnodeCleanup(); +void dnodeCleanupInstance(struct Dnode *dnode); /** * Send messages to other dnodes, such as create vnode message. * + * @param dnode The instance of Dnode module * @param epSet The endpoint list of the dnodes. * @param rpcMsg Message to be sent. */ -void dnodeSendMsgToDnode(SRpcEpSet *epSet, SRpcMsg *rpcMsg); +void dnodeSendMsgToDnode(struct Dnode *dnode, struct SRpcEpSet *epSet, struct SRpcMsg *rpcMsg); /** * Send messages to mnode, such as config message. * + * @param dnode The instance of dnode module * @param rpcMsg Message to be sent. */ -void dnodeSendMsgToMnode(SRpcMsg *rpcMsg); +void dnodeSendMsgToMnode(struct Dnode *dnode, struct SRpcMsg *rpcMsg); /** - * Get the corresponding endpoint information from dnodeId. + * Send redirect message to dnode or shell. * - * @param dnodeId - * @param ep The endpoint of dnode - * @param fqdn The fqdn of dnode - * @param port The port of dnode + * @param dnode The instance of dnode module + * @param rpcMsg Message to be sent. + * @param forShell Used to identify whether to send to shell or dnode. */ -void dnodeGetDnodeEp(int32_t dnodeId, char *ep, char *fqdn, uint16_t *port); +void dnodeSendRedirectMsg(struct Dnode *dnode, struct SRpcMsg *rpcMsg, bool forShell); /** - * Report to dnode the start-up steps of other modules + * Get the corresponding endpoint information from dnodeId. * - * @param name Name of the start-up phase. - * @param desc Description of the start-up phase. + * @param dnode The instance of Dnode module + * @param dnodeId The id ot dnode + * @param ep The endpoint of dnode + * @param fqdn The fqdn of dnode + * @param port The port of dnode */ -void dnodeReportStartup(char *name, char *desc); +void dnodeGetDnodeEp(struct Dnode *dnode, int32_t dnodeId, char *ep, char *fqdn, uint16_t *port); #ifdef __cplusplus } #endif -#endif /*_TD_DNODE_H_*/ \ No newline at end of file +#endif /*_TD_DNODE_H_*/ -- GitLab