more tsdb integration
This commit is contained in:
parent
02837954d0
commit
2570697369
|
@ -23,6 +23,7 @@
|
|||
#include "tlockfree.h"
|
||||
#include "tmacro.h"
|
||||
#include "wal.h"
|
||||
#include "tfs.h"
|
||||
|
||||
#include "vnode.h"
|
||||
|
||||
|
|
|
@ -24,6 +24,13 @@ int vnodeInit(uint16_t nthreads) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
SDiskCfg dCfg;
|
||||
strcpy(dCfg.dir, tsDataDir);
|
||||
dCfg.level = 0;
|
||||
dCfg.primary = 1;
|
||||
|
||||
tfsInit(&dCfg, 1);
|
||||
|
||||
// Start commit handers
|
||||
if (nthreads > 0) {
|
||||
vnodeMgr.nthreads = nthreads;
|
||||
|
@ -72,6 +79,7 @@ void vnodeClear() {
|
|||
tfree(vnodeMgr.threads);
|
||||
pthread_cond_destroy(&(vnodeMgr.hasTask));
|
||||
pthread_mutex_destroy(&(vnodeMgr.mutex));
|
||||
tfsDestroy();
|
||||
}
|
||||
|
||||
int vnodeScheduleTask(SVnodeTask* pTask) {
|
||||
|
|
|
@ -24,9 +24,9 @@ STsdb *tsdbOpen(const char *path, const STsdbCfg *pTsdbCfg, SMemAllocatorFactory
|
|||
STsdb *pTsdb = NULL;
|
||||
|
||||
// Set default TSDB Options
|
||||
if (pTsdbCfg == NULL) {
|
||||
pTsdbCfg = &defautlTsdbOptions;
|
||||
}
|
||||
// if (pTsdbCfg == NULL) {
|
||||
pTsdbCfg = &defautlTsdbOptions;
|
||||
// }
|
||||
|
||||
// Validate the options
|
||||
if (tsdbValidateOptions(pTsdbCfg) < 0) {
|
||||
|
|
|
@ -15,7 +15,16 @@
|
|||
|
||||
#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) {
|
||||
// TODO
|
||||
|
|
Loading…
Reference in New Issue