refact
This commit is contained in:
parent
1cc5236491
commit
523ba0ab98
|
@ -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_*/
|
|
|
@ -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);
|
||||||
|
|
|
@ -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_*/
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue