提交 8eae8112 编写于 作者: H Hongze Cheng

more

上级 e3478a52
......@@ -75,7 +75,7 @@ SMeta *metaOpen(const char *path, const SMetaCfg *pOptions);
void metaClose(SMeta *pMeta);
void metaRemove(const char *path);
int metaCreateTable(SMeta *pMeta, STbCfg *pTbCfg);
int metaDropTable(SMeta *pMeta, const void *pReq, const int len);
int metaDropTable(SMeta *pMeta, tb_uid_t uid);
int metaCommit(SMeta *pMeta);
// Options
......
......@@ -23,9 +23,10 @@
#include "vnode.h"
#include "vnodeBufferPool.h"
#include "vnodeCfg.h"
#include "vnodeCommit.h"
#include "vnodeFS.h"
#include "vnodeCfg.h"
#include "vnodeRequest.h"
#include "vnodeStateMgr.h"
#include "vnodeSync.h"
......
......@@ -22,8 +22,12 @@
extern "C" {
#endif
// SVCreateTableReq
int vnodeBuildCreateTableReq(const SVCreateTableReq *pReq, char *msg, int len);
int vnodeParseCreateTableReq(const char *msg, int len, SVCreateTableReq *pReq);
// SVDropTableReq
int vnodeBuildDropTableReq(const SVDropTableReq *pReq, char *msg, int len);
int vnodeParseDropTableReq(const char *msg, int len, SVDropTableReq *pReq);
#ifdef __cplusplus
}
......
......@@ -38,6 +38,7 @@ int vnodeProcessWMsgs(SVnode *pVnode, SArray *pMsgs) {
pMsg = *(SRpcMsg **)taosArrayGet(pMsgs, i);
pVnodeReq = (SVnodeReq *)(pMsg->pCont);
SVCreateTableReq ctReq;
SVDropTableReq dtReq;
// Apply the request
{
......@@ -49,7 +50,7 @@ int vnodeProcessWMsgs(SVnode *pVnode, SArray *pMsgs) {
memcpy(ptr, pVnodeReq, pMsg->contLen);
// todo: change the interface here
if (tqPushMsg(pVnode->pTq, pVnodeReq->req, pVnodeReq->ver) < 0) {
if (tqPushMsg(pVnode->pTq, ptr, pVnodeReq->ver) < 0) {
// TODO: handle error
}
......@@ -66,7 +67,13 @@ int vnodeProcessWMsgs(SVnode *pVnode, SArray *pMsgs) {
// TODO: maybe need to clear the requst struct
break;
case TSDB_MSG_TYPE_DROP_TABLE:
/* code */
if (vnodeParseDropTableReq(pVnodeReq->req, pMsg->contLen - sizeof(pVnodeReq->ver), &(dtReq)) < 0) {
// TODO: handle error
}
if (metaDropTable(pVnode->pMeta, dtReq.uid) < 0) {
// TODO: handle error
}
break;
case TSDB_MSG_TYPE_SUBMIT:
/* code */
......
......@@ -37,8 +37,7 @@ int metaCreateTable(SMeta *pMeta, STbCfg *pTbCfg) {
return 0;
}
int metaDropTable(SMeta *pMeta, const void *pCont, const int len) {
tb_uid_t uid;
int metaDropTable(SMeta *pMeta, tb_uid_t uid) {
if (metaRemoveTableFromIdx(pMeta, uid) < 0) {
// TODO: handle error
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册