Merge pull request #1523 from taosdata/hotfix/headfile
re-arrange the head file to make it more logical
This commit is contained in:
commit
ca0c8b2fd8
|
@ -23,8 +23,6 @@ extern "C" {
|
||||||
int32_t dnodeInitRead();
|
int32_t dnodeInitRead();
|
||||||
void dnodeCleanupRead();
|
void dnodeCleanupRead();
|
||||||
void dnodeRead(SRpcMsg *pMsg);
|
void dnodeRead(SRpcMsg *pMsg);
|
||||||
void * dnodeAllocateRqueue();
|
|
||||||
void dnodeFreeRqueue(void *rqueue);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,6 @@ extern "C" {
|
||||||
int32_t dnodeInitWrite();
|
int32_t dnodeInitWrite();
|
||||||
void dnodeCleanupWrite();
|
void dnodeCleanupWrite();
|
||||||
void dnodeWrite(SRpcMsg *pMsg);
|
void dnodeWrite(SRpcMsg *pMsg);
|
||||||
void * dnodeAllocateWqueue();
|
|
||||||
void dnodeFreeWqueue(void *worker);
|
|
||||||
void dnodeSendWriteResponse(void *pVnode, void *param, int32_t code);
|
void dnodeSendWriteResponse(void *pVnode, void *param, int32_t code);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -53,8 +53,6 @@ SWriteWorkerPool wWorkerPool;
|
||||||
|
|
||||||
int32_t dnodeInitWrite() {
|
int32_t dnodeInitWrite() {
|
||||||
|
|
||||||
vnodeInitWrite();
|
|
||||||
|
|
||||||
wWorkerPool.max = tsNumOfCores;
|
wWorkerPool.max = tsNumOfCores;
|
||||||
wWorkerPool.writeWorker = (SWriteWorker *)calloc(sizeof(SWriteWorker), wWorkerPool.max);
|
wWorkerPool.writeWorker = (SWriteWorker *)calloc(sizeof(SWriteWorker), wWorkerPool.max);
|
||||||
if (wWorkerPool.writeWorker == NULL) return -1;
|
if (wWorkerPool.writeWorker == NULL) return -1;
|
||||||
|
@ -217,7 +215,6 @@ static void *dnodeProcessWriteQueue(void *param) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void dnodeHandleIdleWorker(SWriteWorker *pWorker) {
|
static void dnodeHandleIdleWorker(SWriteWorker *pWorker) {
|
||||||
int32_t num = taosGetQueueNumber(pWorker->qset);
|
int32_t num = taosGetQueueNumber(pWorker->qset);
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,13 @@ typedef enum {
|
||||||
SDnodeRunStatus dnodeGetRunStatus();
|
SDnodeRunStatus dnodeGetRunStatus();
|
||||||
SDnodeStatisInfo dnodeGetStatisInfo();
|
SDnodeStatisInfo dnodeGetStatisInfo();
|
||||||
|
|
||||||
|
void *dnodeAllocateWqueue(void *pVnode);
|
||||||
|
void dnodeFreeWqueue(void *queue);
|
||||||
|
void *dnodeAllocateRqueue(void *pVnode);
|
||||||
|
void dnodeFreeRqueue(void *rqueue);
|
||||||
|
void dnodeSendWriteResponse(void *pVnode, void *param, int32_t code);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -25,15 +25,14 @@ typedef struct {
|
||||||
void *rsp;
|
void *rsp;
|
||||||
} SRspRet;
|
} SRspRet;
|
||||||
|
|
||||||
int32_t vnodeInitWrite();
|
|
||||||
int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg);
|
int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg);
|
||||||
int32_t vnodeDrop(int32_t vgId);
|
int32_t vnodeDrop(int32_t vgId);
|
||||||
int32_t vnodeOpen(int32_t vnode, char *rootDir);
|
int32_t vnodeOpen(int32_t vnode, char *rootDir);
|
||||||
int32_t vnodeClose(void *pVnode);
|
int32_t vnodeClose(void *pVnode);
|
||||||
|
|
||||||
void vnodeRelease(void *pVnode);
|
void vnodeRelease(void *pVnode);
|
||||||
|
|
||||||
void* vnodeGetVnode(int32_t vgId);
|
void* vnodeGetVnode(int32_t vgId);
|
||||||
|
|
||||||
void* vnodeGetRqueue(void *);
|
void* vnodeGetRqueue(void *);
|
||||||
void* vnodeGetWqueue(int32_t vgId);
|
void* vnodeGetWqueue(int32_t vgId);
|
||||||
void* vnodeGetWal(void *pVnode);
|
void* vnodeGetWal(void *pVnode);
|
||||||
|
|
|
@ -44,6 +44,7 @@ typedef struct {
|
||||||
} SVnodeObj;
|
} SVnodeObj;
|
||||||
|
|
||||||
int vnodeWriteToQueue(void *param, SWalHead *pHead, int type);
|
int vnodeWriteToQueue(void *param, SWalHead *pHead, int type);
|
||||||
|
void vnodeInitWriteFp(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,11 +25,6 @@
|
||||||
#include "ttime.h"
|
#include "ttime.h"
|
||||||
#include "ttimer.h"
|
#include "ttimer.h"
|
||||||
#include "twal.h"
|
#include "twal.h"
|
||||||
#include "dnodeMClient.h"
|
|
||||||
#include "dnodeMgmt.h"
|
|
||||||
#include "dnodeRead.h"
|
|
||||||
#include "dnodeWrite.h"
|
|
||||||
#include "vnode.h"
|
|
||||||
#include "vnodeInt.h"
|
#include "vnodeInt.h"
|
||||||
|
|
||||||
extern void *tsDnodeVnodesHash;
|
extern void *tsDnodeVnodesHash;
|
||||||
|
@ -100,6 +95,9 @@ int32_t vnodeDrop(int32_t vgId) {
|
||||||
int32_t vnodeOpen(int32_t vnode, char *rootDir) {
|
int32_t vnodeOpen(int32_t vnode, char *rootDir) {
|
||||||
char temp[TSDB_FILENAME_LEN];
|
char temp[TSDB_FILENAME_LEN];
|
||||||
|
|
||||||
|
static pthread_once_t vnodeInitWrite = PTHREAD_ONCE_INIT;
|
||||||
|
pthread_once(&vnodeInitWrite, vnodeInitWriteFp);
|
||||||
|
|
||||||
SVnodeObj vnodeObj = {0};
|
SVnodeObj vnodeObj = {0};
|
||||||
vnodeObj.vgId = vnode;
|
vnodeObj.vgId = vnode;
|
||||||
vnodeObj.status = VN_STATUS_INIT;
|
vnodeObj.status = VN_STATUS_INIT;
|
||||||
|
|
|
@ -23,8 +23,6 @@
|
||||||
#include "tsdb.h"
|
#include "tsdb.h"
|
||||||
#include "twal.h"
|
#include "twal.h"
|
||||||
#include "dataformat.h"
|
#include "dataformat.h"
|
||||||
#include "dnodeWrite.h"
|
|
||||||
#include "dnodeMgmt.h"
|
|
||||||
#include "vnode.h"
|
#include "vnode.h"
|
||||||
#include "vnodeInt.h"
|
#include "vnodeInt.h"
|
||||||
|
|
||||||
|
@ -35,14 +33,12 @@ static int32_t vnodeProcessDropTableMsg(SVnodeObj *pVnode, void *pMsg, SRspRet
|
||||||
static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pMsg, SRspRet *);
|
static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pMsg, SRspRet *);
|
||||||
static int32_t vnodeProcessDropStableMsg(SVnodeObj *pVnode, void *pMsg, SRspRet *);
|
static int32_t vnodeProcessDropStableMsg(SVnodeObj *pVnode, void *pMsg, SRspRet *);
|
||||||
|
|
||||||
int32_t vnodeInitWrite() {
|
void vnodeInitWriteFp(void) {
|
||||||
vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_SUBMIT] = vnodeProcessSubmitMsg;
|
vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_SUBMIT] = vnodeProcessSubmitMsg;
|
||||||
vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_MD_CREATE_TABLE] = vnodeProcessCreateTableMsg;
|
vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_MD_CREATE_TABLE] = vnodeProcessCreateTableMsg;
|
||||||
vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_MD_DROP_TABLE] = vnodeProcessDropTableMsg;
|
vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_MD_DROP_TABLE] = vnodeProcessDropTableMsg;
|
||||||
vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_MD_ALTER_TABLE] = vnodeProcessAlterTableMsg;
|
vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_MD_ALTER_TABLE] = vnodeProcessAlterTableMsg;
|
||||||
vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_MD_DROP_STABLE] = vnodeProcessDropStableMsg;
|
vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_MD_DROP_STABLE] = vnodeProcessDropStableMsg;
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t vnodeProcessWrite(void *param, int qtype, SWalHead *pHead, void *item) {
|
int32_t vnodeProcessWrite(void *param, int qtype, SWalHead *pHead, void *item) {
|
||||||
|
|
Loading…
Reference in New Issue