提交 757dea61 编写于 作者: H Hongze Cheng

more

上级 b97e8808
...@@ -63,6 +63,19 @@ typedef struct SVnodeCfg { ...@@ -63,6 +63,19 @@ typedef struct SVnodeCfg {
} SVnodeCfg; } SVnodeCfg;
/* ------------------------ SVnode ------------------------ */ /* ------------------------ SVnode ------------------------ */
/**
* @brief Initialize the vnode module
*
* @return int 0 for success and -1 for failure
*/
int vnodeInit();
/**
* @brief clear a vnode
*
*/
void vnodeClear();
/** /**
* @brief Open a VNODE. * @brief Open a VNODE.
* *
......
...@@ -20,6 +20,19 @@ static void vnodeFree(SVnode *pVnode); ...@@ -20,6 +20,19 @@ static void vnodeFree(SVnode *pVnode);
static int vnodeOpenImpl(SVnode *pVnode); static int vnodeOpenImpl(SVnode *pVnode);
static void vnodeCloseImpl(SVnode *pVnode); static void vnodeCloseImpl(SVnode *pVnode);
int vnodeInit() {
// TODO
if (walInit() < 0) {
return -1;
}
return 0;
}
void vnodeClear() {
walCleanUp();
}
SVnode *vnodeOpen(const char *path, const SVnodeCfg *pVnodeCfg) { SVnode *vnodeOpen(const char *path, const SVnodeCfg *pVnodeCfg) {
SVnode *pVnode = NULL; SVnode *pVnode = NULL;
......
...@@ -4,12 +4,20 @@ ...@@ -4,12 +4,20 @@
#include "vnode.h" #include "vnode.h"
TEST(vnodeApiTest, vnodeOpen_vnodeClose_test) { TEST(vnodeApiTest, vnodeOpen_vnodeClose_test) {
GTEST_ASSERT_GE(vnodeInit(), 0);
// Create and open a vnode // Create and open a vnode
SVnode *pVnode = vnodeOpen("vnode1", NULL); SVnode *pVnode = vnodeOpen("vnode1", NULL);
ASSERT_NE(pVnode, nullptr); ASSERT_NE(pVnode, nullptr);
// Create table
// SArray *pArray = taosArrayInit()
// vnodeProcessWMsgs(pVnode, );
// Close the vnode // Close the vnode
vnodeClose(pVnode); vnodeClose(pVnode);
vnodeClear();
} }
TEST(vnodeApiTest, vnode_process_create_table) { TEST(vnodeApiTest, vnode_process_create_table) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册