提交 f8220e8b 编写于 作者: H Hongze Cheng

more code

上级 68f07c4b
...@@ -59,7 +59,7 @@ typedef struct SSttLvl { ...@@ -59,7 +59,7 @@ typedef struct SSttLvl {
struct STFileSet { struct STFileSet {
int32_t fid; int32_t fid;
STFile *farr[TSDB_FTYPE_MAX]; // file array STFileObj *farr[TSDB_FTYPE_MAX]; // file array
SRBTree lvlTree; // level tree of .stt SRBTree lvlTree; // level tree of .stt
}; };
......
...@@ -23,6 +23,7 @@ extern "C" { ...@@ -23,6 +23,7 @@ extern "C" {
#endif #endif
typedef struct STFile STFile; typedef struct STFile STFile;
typedef struct STFileObj STFileObj;
typedef enum { typedef enum {
TSDB_FTYPE_HEAD = 0, // .head TSDB_FTYPE_HEAD = 0, // .head
......
...@@ -50,7 +50,7 @@ static int32_t add_file(STFileSet *fset, STFile *f) { ...@@ -50,7 +50,7 @@ static int32_t add_file(STFileSet *fset, STFile *f) {
// lvl->nstt++; // lvl->nstt++;
// lvl->fstt = f; // lvl->fstt = f;
} else { } else {
fset->farr[f->type] = f; // fset->farr[f->type] = f;
} }
return 0; return 0;
...@@ -69,8 +69,8 @@ int32_t tsdbFileSetToJson(const STFileSet *fset, cJSON *json) { ...@@ -69,8 +69,8 @@ int32_t tsdbFileSetToJson(const STFileSet *fset, cJSON *json) {
continue; continue;
} }
code = tsdbTFileToJson(fset->farr[ftype], json); // code = tsdbTFileToJson(fset->farr[ftype], json);
if (code) return code; // if (code) return code;
} }
// each level // each level
...@@ -103,8 +103,8 @@ int32_t tsdbFileSetFromJson(const cJSON *json, STFileSet *fset) { ...@@ -103,8 +103,8 @@ int32_t tsdbFileSetFromJson(const cJSON *json, STFileSet *fset) {
} }
for (int32_t ftype = TSDB_FTYPE_MIN; ftype < TSDB_FTYPE_MAX; ++ftype) { for (int32_t ftype = TSDB_FTYPE_MIN; ftype < TSDB_FTYPE_MAX; ++ftype) {
int32_t code = tsdbTFileFromJson(json, ftype, &fset->farr[ftype]); // int32_t code = tsdbTFileFromJson(json, ftype, &fset->farr[ftype]->f);
if (code) return code; // if (code) return code;
} }
// each level // each level
...@@ -131,11 +131,11 @@ int32_t tsdbFSetEdit(STFileSet *fset, const STFileOp *op) { ...@@ -131,11 +131,11 @@ int32_t tsdbFSetEdit(STFileSet *fset, const STFileOp *op) {
if (op->oState.size == 0) { if (op->oState.size == 0) {
// create // create
STFile *f; // STFile *f;
code = tsdbTFileCreate(&op->nState, &f); // code = tsdbTFileCreate(&op->nState, &f);
if (code) return code; // if (code) return code;
add_file(fset, f); // add_file(fset, f);
} else if (op->nState.size == 0) { } else if (op->nState.size == 0) {
// delete // delete
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册