From c8ed7d15692d9e8c58d596298cc577a26bed80cb Mon Sep 17 00:00:00 2001 From: hzcheng Date: Fri, 13 Mar 2020 10:19:48 +0800 Subject: [PATCH] resolve interface change conflict --- src/vnode/tsdb/src/tsdbMeta.c | 6 +++--- src/vnode/tsdb/src/tsdbMetaFile.c | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/vnode/tsdb/src/tsdbMeta.c b/src/vnode/tsdb/src/tsdbMeta.c index 8dc00ade02..5c5c5c50f0 100644 --- a/src/vnode/tsdb/src/tsdbMeta.c +++ b/src/vnode/tsdb/src/tsdbMeta.c @@ -86,7 +86,7 @@ STsdbMeta *tsdbInitMeta(const char *rootDir, int32_t maxTables) { return NULL; } - pMeta->map = taosInitHashTable(maxTables * TSDB_META_HASH_FRACTION, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false); + pMeta->map = taosHashInit(maxTables * TSDB_META_HASH_FRACTION, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false); if (pMeta->map == NULL) { free(pMeta->tables); free(pMeta); @@ -95,7 +95,7 @@ STsdbMeta *tsdbInitMeta(const char *rootDir, int32_t maxTables) { pMeta->mfh = tsdbInitMetaFile(rootDir, maxTables); if (pMeta->mfh == NULL) { - taosCleanUpHashTable(pMeta->map); + taosHashCleanup(pMeta->map); free(pMeta->tables); free(pMeta); return NULL; @@ -260,7 +260,7 @@ static int32_t tsdbCheckTableCfg(STableCfg *pCfg) { } STable *tsdbGetTableByUid(STsdbMeta *pMeta, int64_t uid) { - void *ptr = taosHashGet(pMeta->tableMap, (char *)(&uid), sizeof(uid)); + void *ptr = taosHashGet(pMeta->map, (char *)(&uid), sizeof(uid)); if (ptr == NULL) return NULL; diff --git a/src/vnode/tsdb/src/tsdbMetaFile.c b/src/vnode/tsdb/src/tsdbMetaFile.c index 8f99afdcdd..ee173d7d71 100644 --- a/src/vnode/tsdb/src/tsdbMetaFile.c +++ b/src/vnode/tsdb/src/tsdbMetaFile.c @@ -42,7 +42,7 @@ SMetaFile *tsdbInitMetaFile(char *rootDir, int32_t maxTables) { // OPEN MAP mfh->map = - taosInitHashTable(maxTables * TSDB_META_HASH_FRACTION, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false); + taosHashInit(maxTables * TSDB_META_HASH_FRACTION, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false); if (mfh->map == NULL) { free(mfh); return NULL; @@ -52,13 +52,13 @@ SMetaFile *tsdbInitMetaFile(char *rootDir, int32_t maxTables) { if (access(fname, F_OK) < 0) { // file not exists mfh->fd = tsdbCreateMetaFile(fname); if (mfh->fd < 0) { - taosCleanUpHashTable(mfh->map); + taosHashCleanup(mfh->map); free(mfh); return NULL; } } else { // file exists, recover from file if (tsdbRestoreFromMetaFile(fname, mfh) < 0) { - taosCleanUpHashTable(mfh->map); + taosHashCleanup(mfh->map); free(mfh); return NULL; } @@ -68,7 +68,7 @@ SMetaFile *tsdbInitMetaFile(char *rootDir, int32_t maxTables) { } int32_t tsdbInsertMetaRecord(SMetaFile *mfh, int64_t uid, void *cont, int32_t contLen) { - if (taosGetDataFromHashTable(mfh->map, (char *)(&uid), sizeof(uid)) != NULL) { + if (taosHashGet(mfh->map, (char *)(&uid), sizeof(uid)) != NULL) { return -1; } @@ -78,7 +78,7 @@ int32_t tsdbInsertMetaRecord(SMetaFile *mfh, int64_t uid, void *cont, int32_t co mfh->size += (contLen + sizeof(SRecordInfo)); - if (taosAddToHashTable(mfh->map, (char *)(&uid), sizeof(uid), (void *)(&info), sizeof(SRecordInfo)) < 0) { + if (taosHashPut(mfh->map, (char *)(&uid), sizeof(uid), (void *)(&info), sizeof(SRecordInfo)) < 0) { return -1; } @@ -103,13 +103,13 @@ int32_t tsdbInsertMetaRecord(SMetaFile *mfh, int64_t uid, void *cont, int32_t co } int32_t tsdbDeleteMetaRecord(SMetaFile *mfh, int64_t uid) { - char *ptr = taosGetDataFromHashTable(mfh->map, (char *)(&uid), sizeof(uid)); + char *ptr = taosHashGet(mfh->map, (char *)(&uid), sizeof(uid)); if (ptr == NULL) return -1; SRecordInfo info = *(SRecordInfo *)ptr; // Remove record from hash table - taosDeleteFromHashTable(mfh->map, (char *)(&uid), sizeof(uid)); + taosHashRemove(mfh->map, (char *)(&uid), sizeof(uid)); // Remove record from file @@ -130,12 +130,12 @@ int32_t tsdbDeleteMetaRecord(SMetaFile *mfh, int64_t uid) { } int32_t tsdbUpdateMetaRecord(SMetaFile *mfh, int64_t uid, void *cont, int32_t contLen) { - char *ptr = taosGetDataFromHashTable(mfh->map, (char *)(&uid), sizeof(uid)); + char *ptr = taosHashGet(mfh->map, (char *)(&uid), sizeof(uid)); if (ptr == NULL) return -1; SRecordInfo info = *(SRecordInfo *)ptr; // Update the hash table - if (taosAddToHashTable(mfh->map, (char *)(&uid), sizeof(uid), (void *)(&info), sizeof(SRecordInfo)) < 0) { + if (taosHashPut(mfh->map, (char *)(&uid), sizeof(uid), (void *)(&info), sizeof(SRecordInfo)) < 0) { return -1; } @@ -166,7 +166,7 @@ void tsdbCloseMetaFile(SMetaFile *mfh) { if (mfh == NULL) return; close(mfh); - taosCleanUpHashTable(mfh->map); + taosHashCleanup(mfh->map); } static int32_t tsdbGetMetaFileName(char *rootDir, char *fname) { -- GitLab