diff --git a/include/dnode/vnode/tsdb2/tsdb.h b/include/dnode/vnode/tsdb2/tsdb.h index 7fd8ea4212427c1380fe88dd44ade347d7e4f8c4..986faffedf134748008dd6a468c53ee7be9928bd 100644 --- a/include/dnode/vnode/tsdb2/tsdb.h +++ b/include/dnode/vnode/tsdb2/tsdb.h @@ -104,8 +104,8 @@ STsdbCfg *tsdbGetCfg(const STsdb *repo); // --------- TSDB REPOSITORY DEFINITION int32_t tsdbCreateRepo(int repoid); int32_t tsdbDropRepo(int repoid); -STsdb * tsdbOpenRepo(STsdbCfg *pCfg, STsdbAppH *pAppH); -int tsdbCloseRepo(STsdb *repo, int toCommit); +STsdb * tsdbOpen(STsdbCfg *pCfg, STsdbAppH *pAppH); +int tsdbClose(STsdb *repo, int toCommit); int32_t tsdbConfigRepo(STsdb *repo, STsdbCfg *pCfg); int tsdbGetState(STsdb *repo); int8_t tsdbGetCompactState(STsdb *repo); diff --git a/source/dnode/vnode/tsdb2/src/tsdbMain.c b/source/dnode/vnode/tsdb2/src/tsdbMain.c index bde453b738b6cc035027f35366b96d2035c806c5..07e79f6d9c7b9239c2f6b2581fc76585ea58368c 100644 --- a/source/dnode/vnode/tsdb2/src/tsdbMain.c +++ b/source/dnode/vnode/tsdb2/src/tsdbMain.c @@ -63,7 +63,7 @@ int32_t tsdbDropRepo(int repoid) { return tfsRmdir(tsdbDir); } -STsdb *tsdbOpenRepo(STsdbCfg *pCfg, STsdbAppH *pAppH) { +STsdb *tsdbOpen(STsdbCfg *pCfg, STsdbAppH *pAppH) { STsdb *pRepo; STsdbCfg config = *pCfg; @@ -85,27 +85,27 @@ STsdb *tsdbOpenRepo(STsdbCfg *pCfg, STsdbAppH *pAppH) { // Open meta if (tsdbOpenMeta(pRepo) < 0) { tsdbError("vgId:%d failed to open TSDB repository while opening Meta since %s", config.tsdbId, tstrerror(terrno)); - tsdbCloseRepo(pRepo, false); + tsdbClose(pRepo, false); return NULL; } if (tsdbOpenBufPool(pRepo) < 0) { tsdbError("vgId:%d failed to open TSDB repository while opening buffer pool since %s", config.tsdbId, tstrerror(terrno)); - tsdbCloseRepo(pRepo, false); + tsdbClose(pRepo, false); return NULL; } if (tsdbOpenFS(pRepo) < 0) { tsdbError("vgId:%d failed to open TSDB repository while opening FS since %s", config.tsdbId, tstrerror(terrno)); - tsdbCloseRepo(pRepo, false); + tsdbClose(pRepo, false); return NULL; } // TODO: Restore information from data if ((!(pRepo->state & TSDB_STATE_BAD_DATA)) && tsdbRestoreInfo(pRepo) < 0) { tsdbError("vgId:%d failed to open TSDB repository while restore info since %s", config.tsdbId, tstrerror(terrno)); - tsdbCloseRepo(pRepo, false); + tsdbClose(pRepo, false); return NULL; } @@ -119,7 +119,7 @@ STsdb *tsdbOpenRepo(STsdbCfg *pCfg, STsdbAppH *pAppH) { } // Note: all working thread and query thread must stopped when calling this function -int tsdbCloseRepo(STsdb *repo, int toCommit) { +int tsdbClose(STsdb *repo, int toCommit) { if (repo == NULL) return 0; STsdb *pRepo = repo;