dndInt.h 2.4 KB
Newer Older
S
Shengliang Guan 已提交
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
Shengliang Guan 已提交
16 17
#ifndef _TD_DND_INT_H_
#define _TD_DND_INT_H_
S
Shengliang Guan 已提交
18 19 20 21

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

S
Shengliang Guan 已提交
23
#include "os.h"
S
Shengliang Guan 已提交
24 25 26 27

#include "cJSON.h"
#include "tcache.h"
#include "tcrc32c.h"
S
Shengliang Guan 已提交
28
#include "tep.h"
S
Shengliang Guan 已提交
29
#include "thash.h"
S
Shengliang Guan 已提交
30
#include "tlockfree.h"
S
Shengliang Guan 已提交
31
#include "tlog.h"
S
Shengliang Guan 已提交
32
#include "tmsg.h"
S
Shengliang Guan 已提交
33
#include "tqueue.h"
S
Shengliang Guan 已提交
34 35 36
#include "trpc.h"
#include "tthread.h"
#include "ttime.h"
S
Shengliang Guan 已提交
37
#include "tworker.h"
S
Shengliang Guan 已提交
38
#include "tglobal.h"
S
monitor  
Shengliang Guan 已提交
39
#include "monitor.h"
S
Shengliang Guan 已提交
40 41

#include "dnode.h"
S
Shengliang Guan 已提交
42 43

#include "bnode.h"
S
Shengliang Guan 已提交
44
#include "mnode.h"
S
Shengliang Guan 已提交
45 46
#include "qnode.h"
#include "snode.h"
S
Shengliang Guan 已提交
47
#include "vnode.h"
S
Shengliang Guan 已提交
48
#include "tfs.h"
S
Shengliang Guan 已提交
49 50 51

extern int32_t dDebugFlag;

S
Shengliang Guan 已提交
52 53 54 55 56 57
#define dFatal(...) { if (dDebugFlag & DEBUG_FATAL) { taosPrintLog("DND FATAL ", 255, __VA_ARGS__); }}
#define dError(...) { if (dDebugFlag & DEBUG_ERROR) { taosPrintLog("DND ERROR ", 255, __VA_ARGS__); }}
#define dWarn(...)  { if (dDebugFlag & DEBUG_WARN)  { taosPrintLog("DND WARN ", 255, __VA_ARGS__); }}
#define dInfo(...)  { if (dDebugFlag & DEBUG_INFO)  { taosPrintLog("DND ", 255, __VA_ARGS__); }}
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", dDebugFlag, __VA_ARGS__); }}
S
Shengliang Guan 已提交
58

S
Shengliang Guan 已提交
59
typedef enum { DND_STAT_INIT, DND_STAT_RUNNING, DND_STAT_STOPPED } EStat;
S
Shengliang Guan 已提交
60
typedef enum { DND_WORKER_SINGLE, DND_WORKER_MULTI } EWorkerType;
S
Shengliang Guan 已提交
61
typedef enum { DND_ENV_INIT = 0, DND_ENV_READY = 1, DND_ENV_CLEANUP = 2 } EEnvStat;
S
Shengliang Guan 已提交
62
typedef void (*DndMsgFp)(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEps);
S
Shengliang Guan 已提交
63

S
Shengliang Guan 已提交
64 65 66
EStat       dndGetStat(SDnode *pDnode);
void        dndSetStat(SDnode *pDnode, EStat stat);
const char *dndStatStr(EStat stat);
S
Shengliang Guan 已提交
67

S
Shengliang Guan 已提交
68
void dndReportStartup(SDnode *pDnode, char *pName, char *pDesc);
S
Shengliang Guan 已提交
69
void dndGetStartup(SDnode *pDnode, SStartupReq *pStartup);
S
Shengliang Guan 已提交
70 71 72 73 74

#ifdef __cplusplus
}
#endif

S
Shengliang Guan 已提交
75
#endif /*_TD_DND_INT_H_*/