[TD-335] sort include file
This commit is contained in:
parent
966fb02016
commit
453590e2ec
|
@ -34,7 +34,7 @@ void dnodeReleaseVnode(void *pVnode);
|
|||
|
||||
void dnodeSendRedirectMsg(SRpcMsg *rpcMsg, bool forShell);
|
||||
void dnodeGetMnodeIpSetForPeer(void *ipSet);
|
||||
void dnodeGetMnodeIpSetForShell(void *ipSe);
|
||||
void dnodeGetMnodeIpSetForShell(void *ipSet);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef TDENGINE_DNODE_DNODE_H
|
||||
#define TDENGINE_DNODE_DNODE_H
|
||||
#ifndef TDENGINE_DNODE_PEER_H
|
||||
#define TDENGINE_DNODE_PEER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "taosmsg.h"
|
||||
#include "tutil.h"
|
||||
#include "tqueue.h"
|
||||
#include "trpc.h"
|
||||
#include "twal.h"
|
||||
#include "tglobal.h"
|
||||
#include "mnode.h"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "taosmsg.h"
|
||||
#include "tutil.h"
|
||||
#include "tqueue.h"
|
||||
#include "trpc.h"
|
||||
#include "twal.h"
|
||||
#include "tglobal.h"
|
||||
#include "mnode.h"
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "tutil.h"
|
||||
#include "ttimer.h"
|
||||
#include "tqueue.h"
|
||||
#include "trpc.h"
|
||||
#include "twal.h"
|
||||
#include "tglobal.h"
|
||||
#include "mnode.h"
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "taosmsg.h"
|
||||
#include "ttime.h"
|
||||
#include "ttimer.h"
|
||||
#include "trpc.h"
|
||||
#include "tsdb.h"
|
||||
#include "twal.h"
|
||||
#include "tsync.h"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "os.h"
|
||||
#include "taosdef.h"
|
||||
#include "tglobal.h"
|
||||
#include "trpc.h"
|
||||
#include "mnode.h"
|
||||
#include "http.h"
|
||||
#include "mqtt.h"
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tglobal.h"
|
||||
#include "trpc.h"
|
||||
#include "mnode.h"
|
||||
#include "dnode.h"
|
||||
#include "dnodeInt.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "taoserror.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "trpc.h"
|
||||
#include "tglobal.h"
|
||||
#include "http.h"
|
||||
#include "mnode.h"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "taosmsg.h"
|
||||
#include "tutil.h"
|
||||
#include "tqueue.h"
|
||||
#include "trpc.h"
|
||||
#include "twal.h"
|
||||
#include "tglobal.h"
|
||||
#include "dnodeInt.h"
|
||||
|
@ -142,7 +141,7 @@ void dnodeDispatchToVnodeReadQueue(SRpcMsg *pMsg) {
|
|||
}
|
||||
}
|
||||
|
||||
void *dnodeAllocateRqueue(void *pVnode) {
|
||||
void *dnodeAllocateVnodeRqueue(void *pVnode) {
|
||||
taos_queue queue = taosOpenQueue();
|
||||
if (queue == NULL) return NULL;
|
||||
|
||||
|
@ -172,7 +171,7 @@ void *dnodeAllocateRqueue(void *pVnode) {
|
|||
return queue;
|
||||
}
|
||||
|
||||
void dnodeFreeRqueue(void *rqueue) {
|
||||
void dnodeFreeVnodeRqueue(void *rqueue) {
|
||||
taosCloseQueue(rqueue);
|
||||
|
||||
// dynamically adjust the number of threads
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
#include "trpc.h"
|
||||
#include "tsdb.h"
|
||||
#include "twal.h"
|
||||
#include "tdataformat.h"
|
||||
#include "tglobal.h"
|
||||
#include "vnode.h"
|
||||
#include "tdataformat.h"
|
||||
#include "dnodeInt.h"
|
||||
#include "dnodeVWrite.h"
|
||||
#include "dnodeMgmt.h"
|
||||
|
@ -122,7 +122,7 @@ void dnodeDispatchToVnodeWriteQueue(SRpcMsg *pMsg) {
|
|||
}
|
||||
}
|
||||
|
||||
void *dnodeAllocateWqueue(void *pVnode) {
|
||||
void *dnodeAllocateVnodeWqueue(void *pVnode) {
|
||||
SWriteWorker *pWorker = wWorkerPool.writeWorker + wWorkerPool.nextId;
|
||||
void *queue = taosOpenQueue();
|
||||
if (queue == NULL) return NULL;
|
||||
|
@ -157,13 +157,13 @@ void *dnodeAllocateWqueue(void *pVnode) {
|
|||
return queue;
|
||||
}
|
||||
|
||||
void dnodeFreeWqueue(void *wqueue) {
|
||||
void dnodeFreeVnodeWqueue(void *wqueue) {
|
||||
taosCloseQueue(wqueue);
|
||||
|
||||
// dynamically adjust the number of threads
|
||||
}
|
||||
|
||||
void dnodeSendRpcWriteRsp(void *pVnode, void *param, int32_t code) {
|
||||
void dnodeSendRpcVnodeWriteRsp(void *pVnode, void *param, int32_t code) {
|
||||
SWriteMsg *pWrite = (SWriteMsg *)param;
|
||||
|
||||
if (code > 0) return;
|
||||
|
@ -223,7 +223,7 @@ static void *dnodeProcessWriteQueue(void *param) {
|
|||
taosGetQitem(pWorker->qall, &type, &item);
|
||||
if (type == TAOS_QTYPE_RPC) {
|
||||
pWrite = (SWriteMsg *)item;
|
||||
dnodeSendRpcWriteRsp(pVnode, item, pWrite->rpcMsg.code);
|
||||
dnodeSendRpcVnodeWriteRsp(pVnode, item, pWrite->rpcMsg.code);
|
||||
} else {
|
||||
taosFreeQitem(item);
|
||||
vnodeRelease(pVnode);
|
||||
|
|
|
@ -37,12 +37,6 @@ typedef enum {
|
|||
SDnodeRunStatus dnodeGetRunStatus();
|
||||
SDnodeStatisInfo dnodeGetStatisInfo();
|
||||
|
||||
void *dnodeAllocateWqueue(void *pVnode);
|
||||
void dnodeFreeWqueue(void *queue);
|
||||
void *dnodeAllocateRqueue(void *pVnode);
|
||||
void dnodeFreeRqueue(void *rqueue);
|
||||
void dnodeSendRpcWriteRsp(void *pVnode, void *param, int32_t code);
|
||||
|
||||
bool dnodeIsFirstDeploy();
|
||||
char * dnodeGetMnodeMasterEp();
|
||||
void dnodeGetMnodeIpSetForPeer(void *ipSet);
|
||||
|
@ -54,13 +48,18 @@ void dnodeAddClientRspHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg));
|
|||
void dnodeSendMsgToDnode(SRpcIpSet *ipSet, SRpcMsg *rpcMsg);
|
||||
void dnodeSendMsgToDnodeRecv(SRpcMsg *rpcMsg, SRpcMsg *rpcRsp);
|
||||
|
||||
int32_t dnodeAllocateMnodeWqueue();
|
||||
void dnodeFreeMnodeWqueue();
|
||||
int32_t dnodeAllocateMnodeRqueue();
|
||||
void dnodeFreeMnodeRqueue();
|
||||
void *dnodeAllocateVnodeWqueue(void *pVnode);
|
||||
void dnodeFreeVnodeWqueue(void *queue);
|
||||
void *dnodeAllocateVnodeRqueue(void *pVnode);
|
||||
void dnodeFreeVnodeRqueue(void *rqueue);
|
||||
void dnodeSendRpcVnodeWriteRsp(void *pVnode, void *param, int32_t code);
|
||||
|
||||
int32_t dnodeAllocateMnodePqueue();
|
||||
void dnodeFreeMnodePqueue();
|
||||
|
||||
int32_t dnodeAllocateMnodeRqueue();
|
||||
void dnodeFreeMnodeRqueue();
|
||||
int32_t dnodeAllocateMnodeWqueue();
|
||||
void dnodeFreeMnodeWqueue();
|
||||
void dnodeSendRpcMnodeWriteRsp(void *pMsg, int32_t code);
|
||||
void dnodeReprocessMnodeWriteMsg(void *pMsg);
|
||||
void dnodeDelayReprocessMnodeWriteMsg(void *pMsg);
|
||||
|
|
|
@ -20,13 +20,14 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "trpc.h"
|
||||
|
||||
struct SAcctObj;
|
||||
struct SDnodeObj;
|
||||
struct SUserObj;
|
||||
struct SDbObj;
|
||||
struct SVgObj;
|
||||
struct STableObj;
|
||||
struct SRpcMsg;
|
||||
|
||||
typedef struct {
|
||||
int32_t len;
|
||||
|
@ -34,13 +35,13 @@ typedef struct {
|
|||
} SMnodeRsp;
|
||||
|
||||
typedef struct SMnodeMsg {
|
||||
SRpcMsg rpcMsg;
|
||||
SMnodeRsp rpcRsp;
|
||||
int8_t received;
|
||||
int8_t successed;
|
||||
int8_t expected;
|
||||
int8_t retry;
|
||||
int32_t code;
|
||||
struct SRpcMsg rpcMsg;
|
||||
struct SAcctObj * pAcct;
|
||||
struct SDnodeObj *pDnode;
|
||||
struct SUserObj * pUser;
|
||||
|
@ -49,7 +50,7 @@ typedef struct SMnodeMsg {
|
|||
struct STableObj *pTable;
|
||||
} SMnodeMsg;
|
||||
|
||||
void mnodeCreateMsg(SMnodeMsg *pMsg, struct SRpcMsg *rpcMsg);
|
||||
void mnodeCreateMsg(SMnodeMsg *pMsg, SRpcMsg *rpcMsg);
|
||||
int32_t mnodeInitMsg(SMnodeMsg *pMsg);
|
||||
void mnodeCleanupMsg(SMnodeMsg *pMsg);
|
||||
|
||||
|
@ -62,7 +63,7 @@ bool mnodeIsRunning();
|
|||
int32_t mnodeProcessRead(SMnodeMsg *pMsg);
|
||||
int32_t mnodeProcessWrite(SMnodeMsg *pMsg);
|
||||
int32_t mnodeProcessPeerReq(SMnodeMsg *pMsg);
|
||||
void mnodeProcessPeerRsp(struct SRpcMsg *pMsg);
|
||||
void mnodeProcessPeerRsp(SRpcMsg *pMsg);
|
||||
int32_t mnodeRetriveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
#define _DEFAULT_SOURCE
|
||||
#include "os.h"
|
||||
#include "trpc.h"
|
||||
#include "tgrant.h"
|
||||
#include "tbalance.h"
|
||||
#include "tglobal.h"
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#define _DEFAULT_SOURCE
|
||||
#include "os.h"
|
||||
#include "taoserror.h"
|
||||
#include "trpc.h"
|
||||
#include "tsched.h"
|
||||
#include "tsystem.h"
|
||||
#include "tutil.h"
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
#define _DEFAULT_SOURCE
|
||||
#include "os.h"
|
||||
#include "trpc.h"
|
||||
#include "taosdef.h"
|
||||
#include "tsched.h"
|
||||
#include "tbalance.h"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "os.h"
|
||||
#include "taoserror.h"
|
||||
#include "hash.h"
|
||||
#include "trpc.h"
|
||||
#include "tutil.h"
|
||||
#include "tbalance.h"
|
||||
#include "tqueue.h"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "os.h"
|
||||
#include "taosmsg.h"
|
||||
#include "taoserror.h"
|
||||
#include "trpc.h"
|
||||
#include "tsched.h"
|
||||
#include "tutil.h"
|
||||
#include "ttimer.h"
|
||||
|
|
|
@ -27,10 +27,10 @@ extern "C" {
|
|||
|
||||
extern int32_t vDebugFlag;
|
||||
|
||||
#define vError(...) if (vDebugFlag & DEBUG_ERROR) {taosPrintLog("ERROR VND ", 255, __VA_ARGS__); }
|
||||
#define vWarn(...) if (vDebugFlag & DEBUG_WARN) {taosPrintLog("WARN VND ", vDebugFlag, __VA_ARGS__); }
|
||||
#define vTrace(...) if (vDebugFlag & DEBUG_TRACE) {taosPrintLog("VND ", vDebugFlag, __VA_ARGS__); }
|
||||
#define vPrint(...) {taosPrintLog("VND ", 255, __VA_ARGS__); }
|
||||
#define vError(...) { if (vDebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR VND ", 255, __VA_ARGS__); }}
|
||||
#define vWarn(...) { if (vDebugFlag & DEBUG_WARN) { taosPrintLog("WARN VND ", vDebugFlag, __VA_ARGS__); }}
|
||||
#define vTrace(...) { if (vDebugFlag & DEBUG_TRACE) { taosPrintLog("VND ", vDebugFlag, __VA_ARGS__); }}
|
||||
#define vPrint(...) { taosPrintLog("VND ", 255, __VA_ARGS__); }
|
||||
|
||||
typedef struct {
|
||||
int32_t vgId; // global vnode group ID
|
||||
|
|
|
@ -24,20 +24,10 @@ extern "C" {
|
|||
|
||||
extern int32_t dDebugFlag;
|
||||
|
||||
#define dError(...) \
|
||||
if (dDebugFlag & DEBUG_ERROR) { \
|
||||
taosPrintLog("ERROR DND ", 255, __VA_ARGS__); \
|
||||
}
|
||||
#define dWarn(...) \
|
||||
if (dDebugFlag & DEBUG_WARN) { \
|
||||
taosPrintLog("WARN DND ", dDebugFlag, __VA_ARGS__); \
|
||||
}
|
||||
#define dTrace(...) \
|
||||
if (dDebugFlag & DEBUG_TRACE) { \
|
||||
taosPrintLog("DND ", dDebugFlag, __VA_ARGS__); \
|
||||
}
|
||||
#define dPrint(...) \
|
||||
{ taosPrintLog("DND ", 255, __VA_ARGS__); }
|
||||
#define dError(...) { if (dDebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR DND ", 255, __VA_ARGS__); }}
|
||||
#define dWarn(...) { if (dDebugFlag & DEBUG_WARN) { taosPrintLog("WARN DND ", dDebugFlag, __VA_ARGS__); }}
|
||||
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", dDebugFlag, __VA_ARGS__); }}
|
||||
#define dPrint(...) { taosPrintLog("DND ", 255, __VA_ARGS__); }
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -198,8 +198,8 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
|
|||
|
||||
pVnode->fversion = pVnode->version;
|
||||
|
||||
pVnode->wqueue = dnodeAllocateWqueue(pVnode);
|
||||
pVnode->rqueue = dnodeAllocateRqueue(pVnode);
|
||||
pVnode->wqueue = dnodeAllocateVnodeWqueue(pVnode);
|
||||
pVnode->rqueue = dnodeAllocateVnodeRqueue(pVnode);
|
||||
if (pVnode->wqueue == NULL || pVnode->rqueue == NULL) {
|
||||
vnodeCleanUp(pVnode);
|
||||
return terrno;
|
||||
|
@ -245,7 +245,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
|
|||
syncInfo.getWalInfo = vnodeGetWalInfo;
|
||||
syncInfo.getFileInfo = vnodeGetFileInfo;
|
||||
syncInfo.writeToCache = vnodeWriteToQueue;
|
||||
syncInfo.confirmForward = dnodeSendRpcWriteRsp;
|
||||
syncInfo.confirmForward = dnodeSendRpcVnodeWriteRsp;
|
||||
syncInfo.notifyRole = vnodeNotifyRole;
|
||||
syncInfo.notifyFileSynced = vnodeNotifyFileSynced;
|
||||
pVnode->sync = syncStart(&syncInfo);
|
||||
|
@ -404,11 +404,11 @@ static void vnodeCleanUp(SVnodeObj *pVnode) {
|
|||
pVnode->cq = NULL;
|
||||
|
||||
if (pVnode->wqueue)
|
||||
dnodeFreeWqueue(pVnode->wqueue);
|
||||
dnodeFreeVnodeWqueue(pVnode->wqueue);
|
||||
pVnode->wqueue = NULL;
|
||||
|
||||
if (pVnode->rqueue)
|
||||
dnodeFreeRqueue(pVnode->rqueue);
|
||||
dnodeFreeVnodeRqueue(pVnode->rqueue);
|
||||
pVnode->rqueue = NULL;
|
||||
|
||||
vnodeRelease(pVnode);
|
||||
|
|
Loading…
Reference in New Issue