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

#include "cJSON.h"
H
Haojun Liao 已提交
26
#include "monitor.h"
S
Shengliang Guan 已提交
27 28
#include "tcache.h"
#include "tcrc32c.h"
H
Haojun Liao 已提交
29 30
#include "tdatablock.h"
#include "tglobal.h"
S
Shengliang Guan 已提交
31
#include "thash.h"
S
Shengliang Guan 已提交
32
#include "tlockfree.h"
S
Shengliang Guan 已提交
33
#include "tlog.h"
S
Shengliang Guan 已提交
34
#include "tmsg.h"
S
Shengliang Guan 已提交
35
#include "tqueue.h"
S
Shengliang Guan 已提交
36 37 38
#include "trpc.h"
#include "tthread.h"
#include "ttime.h"
S
Shengliang Guan 已提交
39
#include "tworker.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 52 53 54 55
#define dFatal(...) { if (dDebugFlag & DEBUG_FATAL) { taosPrintLog("DND FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }}
#define dError(...) { if (dDebugFlag & DEBUG_ERROR) { taosPrintLog("DND ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }}
#define dWarn(...)  { if (dDebugFlag & DEBUG_WARN)  { taosPrintLog("DND WARN ", DEBUG_WARN, 255, __VA_ARGS__); }}
#define dInfo(...)  { if (dDebugFlag & DEBUG_INFO)  { taosPrintLog("DND ", DEBUG_INFO, 255, __VA_ARGS__); }}
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
S
Shengliang Guan 已提交
56

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

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

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

#ifdef __cplusplus
}
#endif

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