diff --git a/src/vnode/tsdb/inc/tsdb.h b/src/vnode/tsdb/inc/tsdb.h index 198618978ecb1d8ecfa80170d5354c5a0cdc7e26..8478becaf226cc66559bcaff3dab91104e365876 100644 --- a/src/vnode/tsdb/inc/tsdb.h +++ b/src/vnode/tsdb/inc/tsdb.h @@ -35,25 +35,6 @@ typedef struct { char data[]; } SSubmitBlock; -// Retention policy. -typedef struct { - // TODO: Need a more fancy description - int32_t keep1; - int32_t keep2; - int32_t keep3; -} SRetentionPolicy; - -// Data sharding policy. -typedef struct { - // TODO: Need a more fancy description - int32_t daysPerFile; -} SDataShardPolicy; - -// Rows in file block policy -typedef struct { - // TODO: Need a more fancy description -} SBlockRowsPolicy; - // the TSDB repository configuration typedef struct { char * rootDir; // TSDB repository root directory, TODO: need to adjust here @@ -62,7 +43,8 @@ typedef struct { int32_t daysPerFile; // day per file sharding policy int32_t minRowsPerFileBlock; // minimum rows per file block int32_t maxRowsPerFileBlock; // maximum rows per file block - int32_t keep; // Day of data to keep + int32_t keep; // day of data to keep + int64_t maxCacheSize; // maximum cache size this TSDB can use void * cachePool; // the cache pool the repository to use } STsdbCfg; diff --git a/src/vnode/tsdb/src/tsdbMain.c b/src/vnode/tsdb/src/tsdbMain.c index 0cc77c7b99f4c8192165ef66511033fe7651b522..826592bce684d11a50a662c88a996667c83435fc 100644 --- a/src/vnode/tsdb/src/tsdbMain.c +++ b/src/vnode/tsdb/src/tsdbMain.c @@ -46,24 +46,6 @@ typedef struct _tsdb_repo { #define TSDB_IS_REPO_ACTIVE(pRepo) ((pRepo)->state == TSDB_REPO_STATE_ACTIVE) #define TSDB_IS_REPO_CLOSED(pRepo) ((pRepo)->state == TSDB_REPO_STATE_CLOSED) -// Check the correctness of the TSDB configuration -static int32_t tsdbCheckCfg(STsdbCfg *pCfg) { - if (pCfg->rootDir == NULL) return -1; - - if (access(pCfg->rootDir, F_OK|R_OK|W_OK) == -1) { - return -1; - } - // TODO - return 0; -} - -static int32_t tsdbCreateFiles(STsdbRepo *pRepo) { - // TODO -} - -static int32_t tsdbClearFiles(STsdbRepo *pRepo) { - // TODO -} tsdb_repo_t *tsdbCreateRepo(STsdbCfg *pCfg) { @@ -201,4 +183,23 @@ STableInfo *tsdbGetTableInfo(tsdb_repo_t *pRepo, STableId tid, int32_t *error) { int32_t tsdbInsertData(tsdb_repo_t *pRepo, STableId tid, char *pData, int32_t *error) { // TODO +} + +// Check the correctness of the TSDB configuration +static int32_t tsdbCheckCfg(STsdbCfg *pCfg) { + if (pCfg->rootDir == NULL) return -1; + + if (access(pCfg->rootDir, F_OK|R_OK|W_OK) == -1) { + return -1; + } + // TODO + return 0; +} + +static int32_t tsdbCreateFiles(STsdbRepo *pRepo) { + // TODO +} + +static int32_t tsdbClearFiles(STsdbRepo *pRepo) { + // TODO } \ No newline at end of file