This commit is contained in:
Hongze Cheng 2021-11-02 17:54:55 +08:00
parent 36d3adc23f
commit 8fbd3f49ca
4 changed files with 21 additions and 8 deletions

View File

@ -16,12 +16,16 @@
#ifndef _TD_META_CACHE_H_ #ifndef _TD_META_CACHE_H_
#define _TD_META_CACHE_H_ #define _TD_META_CACHE_H_
#include "rocksdb/c.h"
#include "meta.h" #include "meta.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef rocksdb_cache_t meta_cache_t;
int metaOpenCache(SMeta *pMeta); int metaOpenCache(SMeta *pMeta);
void metaCloseCache(SMeta *pMeta); void metaCloseCache(SMeta *pMeta);

View File

@ -16,12 +16,16 @@
#ifndef _TD_META_DB_H_ #ifndef _TD_META_DB_H_
#define _TD_META_DB_H_ #define _TD_META_DB_H_
#include "rocksdb/c.h"
#include "meta.h" #include "meta.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef rocksdb_t meta_db_t;
int metaOpenDB(SMeta *pMeta); int metaOpenDB(SMeta *pMeta);
void metaCloseDB(SMeta *pMeta); void metaCloseDB(SMeta *pMeta);

View File

@ -16,8 +16,9 @@
#ifndef _TD_META_DEF_H_ #ifndef _TD_META_DEF_H_
#define _TD_META_DEF_H_ #define _TD_META_DEF_H_
#include "rocksdb/c.h" #include "metaCache.h"
#include "metaDB.h"
#include "metaIdx.h"
#include "metaTbUid.h" #include "metaTbUid.h"
#ifdef __cplusplus #ifdef __cplusplus
@ -25,12 +26,12 @@ extern "C" {
#endif #endif
struct SMeta { struct SMeta {
char * path; // path of current meta char* path; // path of current meta
SMetaOptions options; // meta option SMetaOptions options; // meta option
rocksdb_t * pDB; meta_db_t* pDB; // raw data db
rocksdb_t * pIdx; meta_index_t* pIdx; // tag index
rocksdb_cache_t *pCache; meta_cache_t* pCache; // LRU cache
STbUidGenerator uidGnrt; // meta table UID generator STbUidGenerator uidGnrt; // meta table UID generator
}; };
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -16,12 +16,16 @@
#ifndef _TD_META_IDX_H_ #ifndef _TD_META_IDX_H_
#define _TD_META_IDX_H_ #define _TD_META_IDX_H_
#include "rocksdb/c.h"
#include "meta.h" #include "meta.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef rocksdb_t meta_index_t;
int metaOpenIdx(SMeta *pMeta); int metaOpenIdx(SMeta *pMeta);
void metaCloseIdx(SMeta *pMeta); void metaCloseIdx(SMeta *pMeta);