From 903236fa5ef4412af6022a041ccd3a50029178a7 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 3 Nov 2021 11:42:17 +0800 Subject: [PATCH] more --- include/server/vnode/tsdb/impl/tsdbImpl.h | 1 + source/dnode/vnode/tsdb/inc/tsdbOptions.h | 4 ++++ source/dnode/vnode/tsdb/src/tsdbMain.c | 18 +++++++++++++++++- source/dnode/vnode/tsdb/src/tsdbOptions.c | 20 +++++++++++++++++++- 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/include/server/vnode/tsdb/impl/tsdbImpl.h b/include/server/vnode/tsdb/impl/tsdbImpl.h index 15f611c703..04d2ec43c9 100644 --- a/include/server/vnode/tsdb/impl/tsdbImpl.h +++ b/include/server/vnode/tsdb/impl/tsdbImpl.h @@ -23,6 +23,7 @@ extern "C" { #endif struct STsdbOptions { + size_t lruCacheSize; /* TODO */ }; diff --git a/source/dnode/vnode/tsdb/inc/tsdbOptions.h b/source/dnode/vnode/tsdb/inc/tsdbOptions.h index 4d6a250424..a186482939 100644 --- a/source/dnode/vnode/tsdb/inc/tsdbOptions.h +++ b/source/dnode/vnode/tsdb/inc/tsdbOptions.h @@ -20,6 +20,10 @@ extern "C" { #endif +extern const STsdbOptions defautlTsdbOptions; + +int tsdbValidateOptions(const STsdbOptions *); + #ifdef __cplusplus } #endif diff --git a/source/dnode/vnode/tsdb/src/tsdbMain.c b/source/dnode/vnode/tsdb/src/tsdbMain.c index 61e887dd45..9f473c3be1 100644 --- a/source/dnode/vnode/tsdb/src/tsdbMain.c +++ b/source/dnode/vnode/tsdb/src/tsdbMain.c @@ -13,4 +13,20 @@ * along with this program. If not, see . */ -#include "tsdbDef.h" \ No newline at end of file +#include "tsdbDef.h" + +STsdb *tsdbOpen(const char *path, const STsdbOptions *pTsdbOptions) { + STsdb *pTsdb = NULL; + /* TODO */ + return pTsdb; +} + +void tsdbClose(STsdb *pTsdb) { + if (pTsdb) { + /* TODO */ + } +} + +void tsdbRemove(const char *path) { taosRemoveDir(path); } + +/* ------------------------ STATIC METHODS ------------------------ */ \ No newline at end of file diff --git a/source/dnode/vnode/tsdb/src/tsdbOptions.c b/source/dnode/vnode/tsdb/src/tsdbOptions.c index 6dea4a4e57..1e1a859285 100644 --- a/source/dnode/vnode/tsdb/src/tsdbOptions.c +++ b/source/dnode/vnode/tsdb/src/tsdbOptions.c @@ -11,4 +11,22 @@ * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . - */ \ No newline at end of file + */ + +#include "tsdbDef.h" + +const STsdbOptions defautlTsdbOptions = {.lruCacheSize = 0}; + +int tsdbOptionsInit(STsdbOptions *pTsdbOptions) { + // TODO + return 0; +} + +void tsdbOptionsClear(STsdbOptions *pTsdbOptions) { + // TODO +} + +int tsdbValidateOptions(const STsdbOptions *pTsdbOptions) { + // TODO + return 0; +} -- GitLab