bmInt.h 1.5 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
Shengliang 已提交
19
#include "dmUtil.h"
20

S
shm  
Shengliang Guan 已提交
21
#include "bnode.h"
H
refact  
Hongze Cheng 已提交
22 23 24 25

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

S
shm  
Shengliang Guan 已提交
27
typedef struct SBnodeMgmt {
S
shm  
Shengliang Guan 已提交
28
  SBnode       *pBnode;
S
Shengliang 已提交
29
  SMsgCb        msgCb;
S
shm  
Shengliang Guan 已提交
30
  const char   *path;
S
Shengliang 已提交
31 32
  const char   *name;
  int32_t       dnodeId;
S
Shengliang Guan 已提交
33
  SMultiWorker  writeWorker;
34
  SSingleWorker monitorWorker;
S
shm  
Shengliang Guan 已提交
35 36
} SBnodeMgmt;

S
Shengliang Guan 已提交
37
// bmHandle.c
S
Shengliang 已提交
38
SArray *bmGetMsgHandles();
S
Shengliang Guan 已提交
39 40 41
int32_t bmProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pReq);
int32_t bmProcessDropReq(SBnodeMgmt *pMgmt, SRpcMsg *pReq);
int32_t bmProcessGetMonBmInfoReq(SBnodeMgmt *pMgmt, SRpcMsg *pReq);
S
shm  
Shengliang Guan 已提交
42

S
shm  
Shengliang Guan 已提交
43 44 45
// bmWorker.c
int32_t bmStartWorker(SBnodeMgmt *pMgmt);
void    bmStopWorker(SBnodeMgmt *pMgmt);
S
Shengliang Guan 已提交
46 47
int32_t bmPutNodeMsgToWriteQueue(SBnodeMgmt *pMgmt, SRpcMsg *pMsg);
int32_t bmPutNodeMsgToMonitorQueue(SBnodeMgmt *pMgmt, SRpcMsg *pMsg);
S
shm  
Shengliang Guan 已提交
48

H
refact  
Hongze Cheng 已提交
49 50 51 52
#ifdef __cplusplus
}
#endif

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