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,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

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) {
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;
}