From 23ad5400358a4dbfa701588d6900b304dc26d20f Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 15 May 2023 15:56:13 +0800 Subject: [PATCH] more code --- .../dnode/vnode/src/tsdb/dev/inc/tsdbFSet.h | 10 ++++---- source/dnode/vnode/src/tsdb/dev/tsdbFSet.c | 24 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/dev/inc/tsdbFSet.h b/source/dnode/vnode/src/tsdb/dev/inc/tsdbFSet.h index 3896e5dd00..30de41b7f7 100644 --- a/source/dnode/vnode/src/tsdb/dev/inc/tsdbFSet.h +++ b/source/dnode/vnode/src/tsdb/dev/inc/tsdbFSet.h @@ -51,16 +51,16 @@ struct STFileOp { }; typedef struct SSttLvl { - LISTD(struct SSttLvl) listNode; - int32_t lvl; // level - int32_t nstt; // number of .stt files on this level - STFile *fstt; // .stt files + SRBTreeNode rbtn; + int32_t lvl; // level + int32_t nstt; // number of .stt files on this level + STFile *fstt; // .stt files } SSttLvl; struct STFileSet { int32_t fid; STFile *farr[TSDB_FTYPE_MAX]; // file array - SSttLvl lvl0; // level 0 of .stt + SRBTree lvlTree; // level tree of .stt }; #ifdef __cplusplus diff --git a/source/dnode/vnode/src/tsdb/dev/tsdbFSet.c b/source/dnode/vnode/src/tsdb/dev/tsdbFSet.c index ad35d2cb64..8d36236064 100644 --- a/source/dnode/vnode/src/tsdb/dev/tsdbFSet.c +++ b/source/dnode/vnode/src/tsdb/dev/tsdbFSet.c @@ -45,7 +45,7 @@ static int32_t stt_lvl_from_json(const cJSON *json, SSttLvl *lvl) { static int32_t add_file(STFileSet *fset, STFile *f) { if (f->type == TSDB_FTYPE_STT) { - SSttLvl *lvl = &fset->lvl0; // TODO + SSttLvl *lvl = NULL; // TODO lvl->nstt++; lvl->fstt = f; @@ -78,15 +78,15 @@ int32_t tsdbFileSetToJson(const STFileSet *fset, cJSON *json) { if (ajson == NULL) return TSDB_CODE_OUT_OF_MEMORY; SSttLvl *sttLvl; - LISTD_FOREACH(&fset->lvl0, sttLvl, listNode) { - cJSON *ljson = cJSON_CreateObject(); - if (ljson == NULL) return TSDB_CODE_OUT_OF_MEMORY; + // LISTD_FOREACH(&fset->lvl0, sttLvl, listNode) { + // cJSON *ljson = cJSON_CreateObject(); + // if (ljson == NULL) return TSDB_CODE_OUT_OF_MEMORY; - code = stt_lvl_to_json(sttLvl, ljson); - if (code) return code; + // code = stt_lvl_to_json(sttLvl, ljson); + // if (code) return code; - cJSON_AddItemToArray(ajson, ljson); - } + // cJSON_AddItemToArray(ajson, ljson); + // } return 0; } @@ -149,10 +149,10 @@ int32_t tsdbFileSetInit(STFileSet *pSet) { pSet->farr[ftype] = NULL; } - LISTD_INIT(&pSet->lvl0, listNode); - pSet->lvl0.lvl = 0; - pSet->lvl0.nstt = 0; - pSet->lvl0.fstt = NULL; + // LISTD_INIT(&pSet->lvl0, listNode); + // pSet->lvl0.lvl = 0; + // pSet->lvl0.nstt = 0; + // pSet->lvl0.fstt = NULL; return 0; }