mnodeMnode.h 1.6 KB
Newer Older
H
hzcheng 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * 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/>.
 */

16 17
#ifndef TDENGINE_MNODE_MNODE_H
#define TDENGINE_MNODE_MNODE_H
S
#1177  
slguan 已提交
18 19 20 21 22

#ifdef __cplusplus
extern "C" {
#endif

S
slguan 已提交
23
struct SMnodeObj;
S
slguan 已提交
24

S
slguan 已提交
25
typedef enum {
S
slguan 已提交
26 27 28
  TAOS_MN_STATUS_OFFLINE,
  TAOS_MN_STATUS_DROPPING,
  TAOS_MN_STATUS_READY
S
slguan 已提交
29
} EMnodeStatus;
S
slguan 已提交
30

31
int32_t mnodeInitMnodes();
S
Shengliang Guan 已提交
32
void    mnodeCleanupMnodes();
S
slguan 已提交
33

S
TD-1671  
Shengliang Guan 已提交
34
void    mnodeCreateMnode(int32_t dnodeId, char *dnodeEp, bool needConfirm);
35 36
int32_t mnodeDropMnode(int32_t dnodeId);
void    mnodeDropMnodeLocal(int32_t dnodeId);
S
slguan 已提交
37

38 39 40
void *  mnodeGetMnode(int32_t mnodeId);
int32_t mnodeGetMnodesNum();
void *  mnodeGetNextMnode(void *pIter, struct SMnodeObj **pMnode);
S
Shengliang Guan 已提交
41
void    mnodeCancelGetNextMnode(void *pIter);
42 43
void    mnodeIncMnodeRef(struct SMnodeObj *pMnode);
void    mnodeDecMnodeRef(struct SMnodeObj *pMnode);
S
slguan 已提交
44

45
char *  mnodeGetMnodeRoleStr();
46 47
void    mnodeGetMnodeEpSetForPeer(SRpcEpSet *epSet);
void    mnodeGetMnodeEpSetForShell(SRpcEpSet *epSet);
H
Hui Li 已提交
48
char*   mnodeGetMnodeMasterEp();
S
Shengliang Guan 已提交
49

50
void    mnodeGetMnodeInfos(void *mnodes);
S
TD-2331  
Shengliang Guan 已提交
51
void    mnodeUpdateMnodeEpSet(SMInfos *pMnodes);
52

S
#1177  
slguan 已提交
53 54 55
#ifdef __cplusplus
}
#endif
H
hzcheng 已提交
56

S
#1177  
slguan 已提交
57
#endif