bmInt.h 2.6 KB
Newer Older
H
refact  
Hongze Cheng 已提交
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 18
#ifndef _TD_DND_BNODE_INT_H_
#define _TD_DND_BNODE_INT_H_

S
shm  
Shengliang Guan 已提交
19 20
#include "mm.h"
#include "dm.h"
H
refact  
Hongze Cheng 已提交
21 22 23 24

#ifdef __cplusplus
extern "C" {
#endif
S
Shengliang Guan 已提交
25

S
shm  
Shengliang Guan 已提交
26
typedef struct SBnodeMgmt {
S
shm  
Shengliang Guan 已提交
27 28 29 30 31 32 33 34 35
  int32_t       refCount;
  int8_t        deployed;
  int8_t        dropped;
  SBnode       *pBnode;
  SDnode       *pDnode;
  SMgmtWrapper *pWrapper;
  const char   *path;
  SRWLatch      latch;
  SDnodeWorker  writeWorker;
S
shm  
Shengliang Guan 已提交
36 37
} SBnodeMgmt;

S
shm  
Shengliang Guan 已提交
38 39 40 41 42 43 44 45 46 47 48 49 50
// mmFile.c
int32_t bmReadFile(SBnodeMgmt *pMgmt);
int32_t bmWriteFile(SBnodeMgmt *pMgmt);

SBnode *bmAcquire(SBnodeMgmt *pMgmt);
void    bmRelease(SBnodeMgmt *pMgmt, SBnode *pBnode);

// SBnode *mmAcquire(SMnodeMgmt *pMgmt);
// void    mmRelease(SMnodeMgmt *pMgmt, SBnode *pMnode);
// int32_t mmOpen(SMnodeMgmt *pMgmt, SMnodeOpt *pOption);
// int32_t mmAlter(SMnodeMgmt *pMgmt, SMnodeOpt *pOption);
// int32_t mmDrop(SMnodeMgmt *pMgmt);

S
shm  
Shengliang Guan 已提交
51

S
shm  
Shengliang Guan 已提交
52
// void bmGetMgmtFp(SMgmtWrapper *pMgmt);
S
Shengliang Guan 已提交
53

S
shm  
Shengliang Guan 已提交
54 55
// int32_t dndInitBnode(SDnode *pDnode);
// void    dndCleanupBnode(SDnode *pDnode);
H
refact  
Hongze Cheng 已提交
56

S
shm  
Shengliang Guan 已提交
57 58 59
// void    dndProcessBnodeWriteMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet);
// int32_t bmProcessCreateReq(SBnodeMgmt *pMgmt, SNodeMsg *pRpcMsg);
// int32_t bmProcessDropReq(SBnodeMgmt *pMgmt, SNodeMsg *pRpcMsg);
S
shm  
Shengliang Guan 已提交
60

S
shm  
Shengliang Guan 已提交
61
// void bmInitMsgHandles(SMgmtWrapper *pWrapper);
S
shm  
Shengliang Guan 已提交
62

S
shm  
Shengliang Guan 已提交
63 64 65 66 67 68 69 70
// int32_t bmStartWorker(SDnode *pDnode);
// void    bmStopWorker(SDnode *pDnode);
// void    bmInitMsgFp(SMnodeMgmt *pMgmt);
// void    bmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet);
// int32_t bmPutMsgToWriteQueue(SDnode *pDnode, SRpcMsg *pRpcMsg);
// int32_t bmPutMsgToReadQueue(SDnode *pDnode, SRpcMsg *pRpcMsg);
// void    bmConsumeChildQueue(SDnode *pDnode, SNodeMsg *pMsg, int32_t msgLen, void *pCont, int32_t contLen);
// void    bmConsumeParentQueue(SDnode *pDnode, SRpcMsg *pMsg, int32_t msgLen, void *pCont, int32_t contLen);
S
shm  
Shengliang Guan 已提交
71

S
shm  
Shengliang Guan 已提交
72 73 74
// void bmProcessWriteMsg(SMgmtWrapper *pWrapper, SNodeMsg *pMsg);
// void bmProcessSyncMsg(SMgmtWrapper *pWrapper, SNodeMsg *pMsg);
// void bmProcessReadMsg(SMgmtWrapper *pWrapper, SNodeMsg *pMsg);
S
shm  
Shengliang Guan 已提交
75

H
refact  
Hongze Cheng 已提交
76 77 78 79
#ifdef __cplusplus
}
#endif

S
shm  
Shengliang Guan 已提交
80
#endif /*_TD_DND_BNODE_INT_H_*/