提交 552051da 编写于 作者: H Hongze Cheng

refact

上级 903236fa
......@@ -29,6 +29,7 @@ struct SMetaOptions {
size_t lruCacheSize; // LRU cache size
};
#if 0
typedef enum { META_INIT_TABLE = 0, META_SUPER_TABLE = 1, META_CHILD_TABLE = 2, META_NORMAL_TABLE = 3 } EMetaTableT;
typedef struct SSuperTableOpts {
tb_uid_t uid;
......@@ -54,6 +55,7 @@ struct STableOptions {
SNormalTableOpts normalOpts;
};
};
#endif
#ifdef __cplusplus
}
......
......@@ -23,15 +23,15 @@ extern "C" {
#endif
// Types exported
typedef struct SMeta SMeta;
typedef struct SMetaOptions SMetaOptions;
typedef struct STableOptions STableOptions;
typedef struct SMeta SMeta;
typedef struct SMetaOptions SMetaOptions;
typedef struct STbOptions STbOptions;
// SMeta operations
SMeta *metaOpen(const char *path, const SMetaOptions *);
void metaClose(SMeta *);
void metaRemove(const char *path);
int metaCreateTable(SMeta *pMeta, const STableOptions *);
int metaCreateTable(SMeta *pMeta, const STbOptions *);
int metaDropTable(SMeta *pMeta, tb_uid_t uid);
int metaCommit(SMeta *);
......@@ -41,11 +41,11 @@ void metaOptionsClear(SMetaOptions *);
// STableOpts
#define META_TABLE_OPTS_DECLARE(name) STableOpts name = {0}
void metaNormalTableOptsInit(STableOptions *, const char *name, const STSchema *pSchema);
void metaSuperTableOptsInit(STableOptions *, const char *name, tb_uid_t uid, const STSchema *pSchema,
void metaNormalTableOptsInit(STbOptions *, const char *name, const STSchema *pSchema);
void metaSuperTableOptsInit(STbOptions *, const char *name, tb_uid_t uid, const STSchema *pSchema,
const STSchema *pTagSchema);
void metaChildTableOptsInit(STableOptions *, const char *name, tb_uid_t suid, const SKVRow tags);
void metaTableOptsClear(STableOptions *);
void metaChildTableOptsInit(STbOptions *, const char *name, tb_uid_t suid, const SKVRow tags);
void metaTableOptsClear(STbOptions *);
#ifdef __cplusplus
}
......
......@@ -27,6 +27,7 @@ int metaOpenDB(SMeta *pMeta) {
if (pMeta->pCache) {
rocksdb_options_set_row_cache(options, pMeta->pCache);
}
rocksdb_options_set_create_if_missing(options, 1);
pMeta->pDB = rocksdb_open(options, dbDir, &err);
if (pMeta->pDB == NULL) {
......
......@@ -27,6 +27,7 @@ int metaOpenIdx(SMeta *pMeta) {
if (pMeta->pCache) {
rocksdb_options_set_row_cache(options, pMeta->pCache);
}
rocksdb_options_set_create_if_missing(options, 1);
pMeta->pIdx = rocksdb_open(options, idxDir, &err);
if (pMeta->pIdx == NULL) {
......
......@@ -15,7 +15,7 @@
#include "meta.h"
int metaCreateTable(SMeta *pMeta, const STableOptions *pTbOptions) {
int metaCreateTable(SMeta *pMeta, const STbOptions *pTbOptions) {
// TODO
return 0;
}
......
#if 0
#include <gtest/gtest.h>
#include <string.h>
#include <iostream>
#include "meta.h"
#if 0
static STSchema *metaGetSimpleSchema() {
STSchema * pSchema = NULL;
STSchemaBuilder sb = {0};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册