more code

This commit is contained in:
Hongze Cheng 2023-05-15 15:56:13 +08:00
parent 066786e681
commit 23ad540035
2 changed files with 17 additions and 17 deletions

View File

@ -51,7 +51,7 @@ struct STFileOp {
}; };
typedef struct SSttLvl { typedef struct SSttLvl {
LISTD(struct SSttLvl) listNode; SRBTreeNode rbtn;
int32_t lvl; // level int32_t lvl; // level
int32_t nstt; // number of .stt files on this level int32_t nstt; // number of .stt files on this level
STFile *fstt; // .stt files STFile *fstt; // .stt files
@ -60,7 +60,7 @@ typedef struct SSttLvl {
struct STFileSet { struct STFileSet {
int32_t fid; int32_t fid;
STFile *farr[TSDB_FTYPE_MAX]; // file array STFile *farr[TSDB_FTYPE_MAX]; // file array
SSttLvl lvl0; // level 0 of .stt SRBTree lvlTree; // level tree of .stt
}; };
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -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) { static int32_t add_file(STFileSet *fset, STFile *f) {
if (f->type == TSDB_FTYPE_STT) { if (f->type == TSDB_FTYPE_STT) {
SSttLvl *lvl = &fset->lvl0; // TODO SSttLvl *lvl = NULL; // TODO
lvl->nstt++; lvl->nstt++;
lvl->fstt = f; lvl->fstt = f;
@ -78,15 +78,15 @@ int32_t tsdbFileSetToJson(const STFileSet *fset, cJSON *json) {
if (ajson == NULL) return TSDB_CODE_OUT_OF_MEMORY; if (ajson == NULL) return TSDB_CODE_OUT_OF_MEMORY;
SSttLvl *sttLvl; SSttLvl *sttLvl;
LISTD_FOREACH(&fset->lvl0, sttLvl, listNode) { // LISTD_FOREACH(&fset->lvl0, sttLvl, listNode) {
cJSON *ljson = cJSON_CreateObject(); // cJSON *ljson = cJSON_CreateObject();
if (ljson == NULL) return TSDB_CODE_OUT_OF_MEMORY; // if (ljson == NULL) return TSDB_CODE_OUT_OF_MEMORY;
code = stt_lvl_to_json(sttLvl, ljson); // code = stt_lvl_to_json(sttLvl, ljson);
if (code) return code; // if (code) return code;
cJSON_AddItemToArray(ajson, ljson); // cJSON_AddItemToArray(ajson, ljson);
} // }
return 0; return 0;
} }
@ -149,10 +149,10 @@ int32_t tsdbFileSetInit(STFileSet *pSet) {
pSet->farr[ftype] = NULL; pSet->farr[ftype] = NULL;
} }
LISTD_INIT(&pSet->lvl0, listNode); // LISTD_INIT(&pSet->lvl0, listNode);
pSet->lvl0.lvl = 0; // pSet->lvl0.lvl = 0;
pSet->lvl0.nstt = 0; // pSet->lvl0.nstt = 0;
pSet->lvl0.fstt = NULL; // pSet->lvl0.fstt = NULL;
return 0; return 0;
} }