提交 0b6d32a3 编写于 作者: S Shengliang Guan

rename file

上级 aac15d18
......@@ -89,10 +89,10 @@ typedef struct {
int vnodeInit(const SVnodeOpt *pOption);
/**
* @brief clear a vnode
* @brief Cleanup the vnode module
*
*/
void vnodeClear();
void vnodeCleanup();
/**
* @brief Open a VNODE.
......
......@@ -49,7 +49,7 @@ typedef struct {
} STierMeta;
int tfsInit(SDiskCfg *pDiskCfg, int ndisk);
void tfsDestroy();
void tfsCleanup();
void tfsUpdateInfo(SFSMeta *pFSMeta, STierMeta *tierMetas, int8_t numLevels);
void tfsGetMeta(SFSMeta *pMeta);
void tfsAllocDisk(int expLevel, int *level, int *id);
......
......@@ -173,18 +173,6 @@ SDnode *dndCreate(SDnodeObjCfg *pCfg) {
return NULL;
}
if (rpcInit() != 0) {
dError("failed to init rpc since %s", terrstr());
dndClose(pDnode);
return NULL;
}
if (walInit() != 0) {
dError("failed to init wal since %s", terrstr());
dndClose(pDnode);
return NULL;
}
SDiskCfg dCfg;
strcpy(dCfg.dir, pDnode->cfg.dataDir);
dCfg.level = 0;
......@@ -277,10 +265,8 @@ void dndClose(SDnode *pDnode) {
dndCleanupQnode(pDnode);
dndCleanupVnodes(pDnode);
dndCleanupMgmt(pDnode);
vnodeClear();
tfsDestroy();
walCleanUp();
rpcCleanup();
vnodeCleanup();
tfsCleanup();
dndCloseImp(pDnode);
free(pDnode);
......@@ -298,6 +284,18 @@ int32_t dndInit(const SDnodeEnvCfg *pCfg) {
taosBlockSIGPIPE();
taosResolveCRC();
if (rpcInit() != 0) {
dError("failed to init rpc since %s", terrstr());
dndCleanup();
return -1;
}
if (walInit() != 0) {
dError("failed to init wal since %s", terrstr());
dndCleanup();
return -1;
}
memcpy(&dndEnv.cfg, pCfg, sizeof(SDnodeEnvCfg));
dInfo("dnode env is initialized");
return 0;
......@@ -309,6 +307,9 @@ void dndCleanup() {
return;
}
walCleanUp();
rpcCleanup();
taosStopCacheRefreshWorker();
dInfo("dnode env is cleaned up");
}
\ No newline at end of file
......@@ -56,7 +56,7 @@ int vnodeInit(const SVnodeOpt *pOption) {
return 0;
}
void vnodeClear() {
void vnodeCleanup() {
if (TD_CHECK_AND_SET_MOD_CLEAR(&(vnodeMgr.vnodeInitFlag)) == TD_MOD_UNINITIALIZED) {
return;
}
......
......@@ -227,7 +227,7 @@ TEST(vnodeApiTest, vnode_simple_create_table_test) {
// CLOSE THE VNODE
vnodeClose(pVnode);
vnodeClear();
vnodeCleanup();
taosArrayDestroy(pMsgArr);
}
......@@ -279,7 +279,7 @@ TEST(vnodeApiTest, vnode_simple_insert_test) {
// Close the vnode
vnodeClose(pVnode);
vnodeClear();
vnodeCleanup();
taosArrayDestroy(pMsgArr);
}
\ No newline at end of file
......@@ -85,19 +85,19 @@ int tfsInit(SDiskCfg *pDiskCfg, int ndisk) {
taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK);
if (pfs->map == NULL) {
terrno = TSDB_CODE_FS_OUT_OF_MEMORY;
tfsDestroy();
tfsCleanup();
return -1;
}
for (int idisk = 0; idisk < ndisk; idisk++) {
if (tfsMount(pDiskCfg + idisk) < 0) {
tfsDestroy();
tfsCleanup();
return -1;
}
}
if (tfsCheck() < 0) {
tfsDestroy();
tfsCleanup();
return -1;
}
......@@ -109,7 +109,7 @@ int tfsInit(SDiskCfg *pDiskCfg, int ndisk) {
return 0;
}
void tfsDestroy() {
void tfsCleanup() {
taosHashCleanup(pfs->map);
pfs->map = NULL;
......
......@@ -49,7 +49,7 @@ typedef struct {
} STierMeta;
int tfsInit(SDiskCfg *pDiskCfg, int ndisk);
void tfsDestroy();
void tfsCleanup();
void tfsUpdateInfo(SFSMeta *pFSMeta, STierMeta *tierMetas, int8_t numLevels);
void tfsGetMeta(SFSMeta *pMeta);
void tfsAllocDisk(int expLevel, int *level, int *id);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册