This commit is contained in:
Hongze Cheng 2022-01-14 06:55:24 +00:00
parent 1cc5236491
commit 523ba0ab98
4 changed files with 19 additions and 49 deletions

View File

@ -1,36 +0,0 @@
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_META_DB_H_
#define _TD_META_DB_H_
#include "meta.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SMetaDB SMetaDB;
int metaOpenDB(SMeta *pMeta);
void metaCloseDB(SMeta *pMeta);
int metaSaveTableToDB(SMeta *pMeta, STbCfg *pTbCfg);
int metaRemoveTableFromDb(SMeta *pMeta, tb_uid_t uid);
#ifdef __cplusplus
}
#endif
#endif /*_TD_META_DB_H_*/

View File

@ -19,7 +19,6 @@
#include "mallocator.h" #include "mallocator.h"
#include "meta.h" #include "meta.h"
#include "metaDB.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -27,6 +26,13 @@ extern "C" {
typedef struct SMetaCache SMetaCache; typedef struct SMetaCache SMetaCache;
typedef struct SMetaIdx SMetaIdx; typedef struct SMetaIdx SMetaIdx;
typedef struct SMetaDB SMetaDB;
// SMetaDB
int metaOpenDB(SMeta* pMeta);
void metaCloseDB(SMeta* pMeta);
int metaSaveTableToDB(SMeta* pMeta, STbCfg* pTbCfg);
int metaRemoveTableFromDb(SMeta* pMeta, tb_uid_t uid);
// SMetaCache // SMetaCache
int metaOpenCache(SMeta* pMeta); int metaOpenCache(SMeta* pMeta);
@ -35,7 +41,7 @@ void metaCloseCache(SMeta* pMeta);
// SMetaCfg // SMetaCfg
extern const SMetaCfg defaultMetaOptions; extern const SMetaCfg defaultMetaOptions;
// int metaValidateOptions(const SMetaCfg*); // int metaValidateOptions(const SMetaCfg*);
void metaOptionsCopy(SMetaCfg* pDest, const SMetaCfg* pSrc); void metaOptionsCopy(SMetaCfg* pDest, const SMetaCfg* pSrc);
// SMetaIdx // SMetaIdx
int metaOpenIdx(SMeta* pMeta); int metaOpenIdx(SMeta* pMeta);
@ -49,12 +55,12 @@ typedef struct STbUidGenerator {
} STbUidGenerator; } STbUidGenerator;
// STableUidGenerator // STableUidGenerator
int metaOpenUidGnrt(SMeta *pMeta); int metaOpenUidGnrt(SMeta* pMeta);
void metaCloseUidGnrt(SMeta *pMeta); void metaCloseUidGnrt(SMeta* pMeta);
// tb_uid_t // tb_uid_t
#define IVLD_TB_UID 0 #define IVLD_TB_UID 0
tb_uid_t metaGenerateUid(SMeta *pMeta); tb_uid_t metaGenerateUid(SMeta* pMeta);
struct SMeta { struct SMeta {
char* path; char* path;

View File

@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef _TD_VND_H_ #ifndef _TD_VNODE_DEF_H_
#define _TD_VND_H_ #define _TD_VNODE_DEF_H_
#include "mallocator.h" #include "mallocator.h"
// #include "sync.h" // #include "sync.h"
@ -176,4 +176,4 @@ bool vmaIsFull(SVMemAllocator* pVMA);
} }
#endif #endif
#endif /*_TD_VND_H_*/ #endif /*_TD_VNODE_DEF_H_*/

View File

@ -30,11 +30,11 @@ SMeta *metaOpen(const char *path, const SMetaCfg *pMetaCfg, SMemAllocatorFactory
pMetaCfg = &defaultMetaOptions; pMetaCfg = &defaultMetaOptions;
} }
// Validate the options // // Validate the options
if (metaValidateOptions(pMetaCfg) < 0) { // if (metaValidateOptions(pMetaCfg) < 0) {
// TODO: deal with error // // TODO: deal with error
return NULL; // return NULL;
} // }
// Allocate handle // Allocate handle
pMeta = metaNew(path, pMetaCfg, pMAF); pMeta = metaNew(path, pMetaCfg, pMAF);