mmInt.h 1.8 KB
Newer Older
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/>.
 */

S
shm  
Shengliang Guan 已提交
16 17
#ifndef _TD_DND_MNODE_INT_H_
#define _TD_DND_MNODE_INT_H_
18

S
shm  
Shengliang Guan 已提交
19 20
#include "dndInt.h"

21 22 23 24
#ifdef __cplusplus
extern "C" {
#endif

S
shm  
Shengliang Guan 已提交
25

S
shm  
Shengliang Guan 已提交
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

typedef struct SMnodeMgmt {
  int32_t      refCount;
  int8_t       deployed;
  int8_t       dropped;
  SMnode      *pMnode;
  SRWLatch     latch;
  SDnodeWorker readWorker;
  SDnodeWorker writeWorker;
  SDnodeWorker syncWorker;
  int8_t       replica;
  int8_t       selfIndex;
  SReplica     replicas[TSDB_MAX_REPLICA];

  //
  SMsgHandle  msgHandles[TDMT_MAX];
  SProcObj *pProcess;
  bool      singleProc;
} SMnodeMgmt;


S
shm  
Shengliang Guan 已提交
47
// interface
S
shm  
Shengliang Guan 已提交
48 49
SMgmtFp mmGetMgmtFp();

S
shm  
Shengliang Guan 已提交
50 51
int32_t mmInit(SDnode *pDnode);
void    mmCleanup(SDnode *pDnode);
S
shm  
Shengliang Guan 已提交
52 53 54
int32_t mmProcessCreateMnodeReq(SDnode *pDnode, SRpcMsg *pRpcMsg);
int32_t mmProcessAlterMnodeReq(SDnode *pDnode, SRpcMsg *pRpcMsg);
int32_t mmProcessDropMnodeReq(SDnode *pDnode, SRpcMsg *pRpcMsg);
S
shm  
Shengliang Guan 已提交
55

S
shm  
Shengliang Guan 已提交
56
int32_t mmGetUserAuth(SMgmtWrapper *pWrapper, char *user, char *spi, char *encrypt, char *secret, char *ckey);
S
shm  
Shengliang Guan 已提交
57
int32_t mmGetMonitorInfo(SDnode *pDnode, SMonClusterInfo *pClusterInfo, SMonVgroupInfo *pVgroupInfo,
S
shm  
Shengliang Guan 已提交
58
                         SMonGrantInfo *pGrantInfo);
S
monitor  
Shengliang Guan 已提交
59

S
shm  
Shengliang Guan 已提交
60

61 62 63 64
#ifdef __cplusplus
}
#endif

S
shm  
Shengliang Guan 已提交
65
#endif /*_TD_DND_MNODE_INT_H_*/