mnode.h 1.8 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 45 46 47 48 49 50
  int8_t    received;
  int8_t    successed;
  int8_t    expected;
  int8_t    retry;
  int32_t   code;
  struct SAcctObj * pAcct;
  struct SDnodeObj *pDnode;
  struct SUserObj * pUser;
  struct SDbObj *   pDb;
  struct SVgObj *   pVgroup;
  struct STableObj *pTable;
S
Shengliang Guan 已提交
51 52
} SMnodeMsg;

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

57 58 59
int32_t mnodeInitSystem();
int32_t mnodeStartSystem();
void    mnodeCleanupSystem();
S
slguan 已提交
60
void    mgmtStopSystem();
S
slguan 已提交
61
void    sdbUpdateSync();
S
Shengliang Guan 已提交
62 63 64
bool    mnodeIsRunning();
int32_t mnodeProcessRead(SMnodeMsg *pMsg);
int32_t mnodeProcessWrite(SMnodeMsg *pMsg);
65
int32_t mnodeProcessPeerReq(SMnodeMsg *pMsg);
S
Shengliang Guan 已提交
66
void    mnodeProcessPeerRsp(SRpcMsg *pMsg);
67
int32_t mnodeRetriveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey);
S
Shengliang Guan 已提交
68

H
hzcheng 已提交
69 70 71 72
#ifdef __cplusplus
}
#endif

S
#1177  
slguan 已提交
73
#endif