mnode.h 1.9 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_H
#define TDENGINE_MNODE_H
H
hzcheng 已提交
18 19 20 21 22

#ifdef __cplusplus
extern "C" {
#endif

S
Shengliang Guan 已提交
23 24
#include "trpc.h"

25 26 27 28 29 30 31
struct SAcctObj;
struct SDnodeObj;
struct SUserObj;
struct SDbObj;
struct SVgObj;
struct STableObj;

S
Shengliang Guan 已提交
32
typedef struct {
S
Shengliang Guan 已提交
33 34
  int32_t len;
  void *  rsp;
S
Shengliang Guan 已提交
35 36
} SMnodeRsp;

37
typedef struct SMnodeMsg {
S
Shengliang Guan 已提交
38
  SRpcMsg   rpcMsg;
S
Shengliang Guan 已提交
39
  SMnodeRsp rpcRsp;
40 41 42 43 44
  int8_t    received;
  int8_t    successed;
  int8_t    expected;
  int8_t    retry;
  int32_t   code;
S
Shengliang Guan 已提交
45
  void *    pObj;
46 47 48 49 50 51
  struct SAcctObj * pAcct;
  struct SDnodeObj *pDnode;
  struct SUserObj * pUser;
  struct SDbObj *   pDb;
  struct SVgObj *   pVgroup;
  struct STableObj *pTable;
52
  struct SSuperTableObj *pSTable;
S
Shengliang Guan 已提交
53 54
} SMnodeMsg;

S
Shengliang Guan 已提交
55
void    mnodeCreateMsg(SMnodeMsg *pMsg, SRpcMsg *rpcMsg);
56 57
int32_t mnodeInitMsg(SMnodeMsg *pMsg);
void    mnodeCleanupMsg(SMnodeMsg *pMsg);
S
Shengliang Guan 已提交
58

59 60 61
int32_t mnodeInitSystem();
int32_t mnodeStartSystem();
void    mnodeCleanupSystem();
S
Shengliang Guan 已提交
62
void    mnodeStopSystem();
S
TD-1671  
Shengliang Guan 已提交
63
void    sdbUpdateSync(void *pMnodes);
S
Shengliang Guan 已提交
64 65 66
bool    mnodeIsRunning();
int32_t mnodeProcessRead(SMnodeMsg *pMsg);
int32_t mnodeProcessWrite(SMnodeMsg *pMsg);
67
int32_t mnodeProcessPeerReq(SMnodeMsg *pMsg);
S
Shengliang Guan 已提交
68
void    mnodeProcessPeerRsp(SRpcMsg *pMsg);
69
int32_t mnodeRetriveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey);
S
Shengliang Guan 已提交
70

H
hzcheng 已提交
71 72 73 74
#ifdef __cplusplus
}
#endif

S
#1177  
slguan 已提交
75
#endif