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

23 24 25 26 27 28 29 30
struct SAcctObj;
struct SDnodeObj;
struct SUserObj;
struct SDbObj;
struct SVgObj;
struct STableObj;
struct SRpcMsg;

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

36
typedef struct SMnodeMsg {
S
Shengliang Guan 已提交
37
  SMnodeRsp rpcRsp;
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
  uint8_t   msgType;
  int8_t    received;
  int8_t    successed;
  int8_t    expected;
  int8_t    retry;
  int8_t    maxRetry;
  int32_t   contLen;
  int32_t   code;
  void *    ahandle;
  void *    thandle;
  void *    pCont;
  struct SAcctObj * pAcct;
  struct SDnodeObj *pDnode;
  struct SUserObj * pUser;
  struct SDbObj *   pDb;
  struct SVgObj *   pVgroup;
  struct STableObj *pTable;
S
Shengliang Guan 已提交
55 56
} SMnodeMsg;

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

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

H
hzcheng 已提交
73 74 75 76
#ifdef __cplusplus
}
#endif

S
#1177  
slguan 已提交
77
#endif