diff --git a/source/dnode/vnode/src/tsdb/dev/inc/tsdbFSet.h b/source/dnode/vnode/src/tsdb/dev/inc/tsdbFSet.h index 8d3889a098..d7218c505d 100644 --- a/source/dnode/vnode/src/tsdb/dev/inc/tsdbFSet.h +++ b/source/dnode/vnode/src/tsdb/dev/inc/tsdbFSet.h @@ -37,8 +37,7 @@ int32_t tsdbFileSetToJson(const STFileSet *fset, cJSON *json); int32_t tsdbFileSetFromJson(const cJSON *json, STFileSet *fset); int32_t tsdbFileSetCreate(int32_t fid, STFileSet **ppSet); -int32_t tsdbFileSetEdit(STFileSet *pSet, STFileOp *pOp); -int32_t tsdbEditFileSet(STFileSet *pFileSet, const STFileOp *pOp); +int32_t tsdbFSetEdit(STFileSet *pSet, const STFileOp *pOp); int32_t tsdbFSetCmprFn(const STFileSet *pSet1, const STFileSet *pSet2); diff --git a/source/dnode/vnode/src/tsdb/dev/tsdbFS.c b/source/dnode/vnode/src/tsdb/dev/tsdbFS.c index bfc522b040..b25502fca7 100644 --- a/source/dnode/vnode/src/tsdb/dev/tsdbFS.c +++ b/source/dnode/vnode/src/tsdb/dev/tsdbFS.c @@ -433,7 +433,7 @@ static int32_t fset_cmpr_fn(const struct STFileSet *pSet1, const struct STFileSe static int32_t edit_fs(STFileSystem *pFS, const SArray *aFileOp) { int32_t code = 0; - int32_t lino; + int32_t lino = 0; STFileSet *pSet = NULL; for (int32_t iop = 0; iop < taosArrayGetSize(aFileOp); iop++) { @@ -444,7 +444,13 @@ static int32_t edit_fs(STFileSystem *pFS, const SArray *aFileOp) { pSet = taosArraySearch(pFS->nstate, &fset, (__compar_fn_t)tsdbFSetCmprFn, TD_EQ); } - // TODO + if (pSet == NULL) { + ASSERT(op->oState.size == 0 && op->nState.size > 0); + // TODO + } + + code = tsdbFSetEdit(pSet, op); + TSDB_CHECK_CODE(code, lino, _exit) } _exit: diff --git a/source/dnode/vnode/src/tsdb/dev/tsdbFSet.c b/source/dnode/vnode/src/tsdb/dev/tsdbFSet.c index 3f909c0609..92a0ba0dd9 100644 --- a/source/dnode/vnode/src/tsdb/dev/tsdbFSet.c +++ b/source/dnode/vnode/src/tsdb/dev/tsdbFSet.c @@ -58,12 +58,6 @@ _exit: return code; } -int32_t tsdbFileSetEdit(struct STFileSet *pSet, struct STFileOp *pOp) { - int32_t code = 0; - // TODO - return code; -} - int32_t tsdbFileSetToJson(const STFileSet *fset, cJSON *json) { int32_t code = 0; @@ -126,15 +120,13 @@ int32_t tsdbFileSetFromJson(const cJSON *json, STFileSet *fset) { return 0; } -int32_t tsdbEditFileSet(struct STFileSet *pFileSet, const struct STFileOp *pOp) { - int32_t code = 0; - ASSERTS(0, "TODO: Not implemented yet"); - // TODO - return code; -} - int32_t tsdbFSetCmprFn(const STFileSet *pSet1, const STFileSet *pSet2) { if (pSet1->fid < pSet2->fid) return -1; if (pSet1->fid > pSet2->fid) return 1; return 0; +} + +int32_t tsdbFSetEdit(STFileSet *pSet, const STFileOp *pOp) { + // TODO + return 0; } \ No newline at end of file