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 26 27 28
typedef struct SMnodeMgmt {
  int32_t      refCount;
  int8_t       deployed;
  int8_t       dropped;
S
rename  
Shengliang Guan 已提交
29 30 31
  int8_t       replica;
  int8_t       selfIndex;
  SReplica     replicas[TSDB_MAX_REPLICA];
S
shm  
Shengliang Guan 已提交
32
  SMnode      *pMnode;
S
rename  
Shengliang Guan 已提交
33 34
  SProcObj    *pProcess;
  bool         singleProc;
S
shm  
Shengliang Guan 已提交
35 36 37 38 39 40
  SRWLatch     latch;
  SDnodeWorker readWorker;
  SDnodeWorker writeWorker;
  SDnodeWorker syncWorker;
} SMnodeMgmt;

S
rename  
Shengliang Guan 已提交
41
// mmInt.h
S
shm  
Shengliang Guan 已提交
42
void mmGetMgmtFp(SMgmtWrapper *pMgmt);
S
shm  
Shengliang Guan 已提交
43

S
rename  
Shengliang Guan 已提交
44
// mmMgmt.h
S
shm  
Shengliang Guan 已提交
45 46
int32_t mmInit(SDnode *pDnode);
void    mmCleanup(SDnode *pDnode);
S
shm  
Shengliang Guan 已提交
47 48 49 50 51

// mmHandle.h
int32_t mmProcessCreateReq(SDnode *pDnode, SRpcMsg *pRpcMsg);
int32_t mmProcessAlterReq(SDnode *pDnode, SRpcMsg *pRpcMsg);
int32_t mmProcessDropReq(SDnode *pDnode, SRpcMsg *pRpcMsg);
S
shm  
Shengliang Guan 已提交
52

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

S
shm  
Shengliang Guan 已提交
57

58 59 60 61
#ifdef __cplusplus
}
#endif

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