提交 25706973 编写于 作者: H Hongze Cheng

more tsdb integration

上级 02837954
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "tlockfree.h" #include "tlockfree.h"
#include "tmacro.h" #include "tmacro.h"
#include "wal.h" #include "wal.h"
#include "tfs.h"
#include "vnode.h" #include "vnode.h"
......
...@@ -24,6 +24,13 @@ int vnodeInit(uint16_t nthreads) { ...@@ -24,6 +24,13 @@ int vnodeInit(uint16_t nthreads) {
return 0; return 0;
} }
SDiskCfg dCfg;
strcpy(dCfg.dir, tsDataDir);
dCfg.level = 0;
dCfg.primary = 1;
tfsInit(&dCfg, 1);
// Start commit handers // Start commit handers
if (nthreads > 0) { if (nthreads > 0) {
vnodeMgr.nthreads = nthreads; vnodeMgr.nthreads = nthreads;
...@@ -72,6 +79,7 @@ void vnodeClear() { ...@@ -72,6 +79,7 @@ void vnodeClear() {
tfree(vnodeMgr.threads); tfree(vnodeMgr.threads);
pthread_cond_destroy(&(vnodeMgr.hasTask)); pthread_cond_destroy(&(vnodeMgr.hasTask));
pthread_mutex_destroy(&(vnodeMgr.mutex)); pthread_mutex_destroy(&(vnodeMgr.mutex));
tfsDestroy();
} }
int vnodeScheduleTask(SVnodeTask* pTask) { int vnodeScheduleTask(SVnodeTask* pTask) {
......
...@@ -24,9 +24,9 @@ STsdb *tsdbOpen(const char *path, const STsdbCfg *pTsdbCfg, SMemAllocatorFactory ...@@ -24,9 +24,9 @@ STsdb *tsdbOpen(const char *path, const STsdbCfg *pTsdbCfg, SMemAllocatorFactory
STsdb *pTsdb = NULL; STsdb *pTsdb = NULL;
// Set default TSDB Options // Set default TSDB Options
if (pTsdbCfg == NULL) { // if (pTsdbCfg == NULL) {
pTsdbCfg = &defautlTsdbOptions; pTsdbCfg = &defautlTsdbOptions;
} // }
// Validate the options // Validate the options
if (tsdbValidateOptions(pTsdbCfg) < 0) { if (tsdbValidateOptions(pTsdbCfg) < 0) {
......
...@@ -15,7 +15,16 @@ ...@@ -15,7 +15,16 @@
#include "tsdbDef.h" #include "tsdbDef.h"
const STsdbCfg defautlTsdbOptions = {.lruCacheSize = 0}; const STsdbCfg defautlTsdbOptions = {.precision = 0,
.lruCacheSize = 0,
.daysPerFile = 10,
.minRowsPerFileBlock = 100,
.maxRowsPerFileBlock = 4096,
.keep = 3650,
.keep1 = 3650,
.keep2 = 3650,
.update = 0,
.compression = TWO_STAGE_COMP};
int tsdbOptionsInit(STsdbCfg *pTsdbOptions) { int tsdbOptionsInit(STsdbCfg *pTsdbOptions) {
// TODO // TODO
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册