mnodeMnode.h 1.5 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

34 35 36
int32_t mnodeAddMnode(int32_t dnodeId);
int32_t mnodeDropMnode(int32_t dnodeId);
void    mnodeDropMnodeLocal(int32_t dnodeId);
S
slguan 已提交
37

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

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

49
void    mnodeGetMnodeInfos(void *mnodes);
50
void    mnodeUpdateMnodeEpSet();
51

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

S
#1177  
slguan 已提交
56
#endif