提交 1faccd42 编写于 作者: J Jun Li

Add init to waltest and make it work

上级 f48783df
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "tglobal.h" #include "tglobal.h"
#include "tlog.h" #include "tlog.h"
#include "twal.h" #include "twal.h"
#include "tfile.h"
int64_t ver = 0; int64_t ver = 0;
void *pWal = NULL; void *pWal = NULL;
...@@ -36,7 +37,7 @@ int writeToQueue(void *pVnode, void *data, int type, void *pMsg) { ...@@ -36,7 +37,7 @@ int writeToQueue(void *pVnode, void *data, int type, void *pMsg) {
} }
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
char path[128] = "/home/jhtao/test/wal"; char path[128] = {0};
int level = 2; int level = 2;
int total = 5; int total = 5;
int rows = 10000; int rows = 10000;
...@@ -72,9 +73,11 @@ int main(int argc, char *argv[]) { ...@@ -72,9 +73,11 @@ int main(int argc, char *argv[]) {
printf(" [-h help]: print out this help\n\n"); printf(" [-h help]: print out this help\n\n");
exit(0); exit(0);
} }
} }
taosInitLog("wal.log", 100000, 10); taosInitLog("wal.log", 100000, 10);
tfInit();
walInit();
SWalCfg walCfg = {0}; SWalCfg walCfg = {0};
walCfg.walLevel = level; walCfg.walLevel = level;
...@@ -122,13 +125,13 @@ int main(int argc, char *argv[]) { ...@@ -122,13 +125,13 @@ int main(int argc, char *argv[]) {
printf("index:%" PRId64 " wal:%s\n", index, name); printf("index:%" PRId64 " wal:%s\n", index, name);
if (code == 0) break; if (code == 0) break;
index++;
} }
getchar(); getchar();
walClose(pWal); walClose(pWal);
walCleanUp();
tfCleanup();
return 0; return 0;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册