refact
This commit is contained in:
parent
903236fa5e
commit
552051da5a
|
@ -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
|
||||
}
|
||||
|
|
|
@ -25,13 +25,13 @@ extern "C" {
|
|||
// Types exported
|
||||
typedef struct SMeta SMeta;
|
||||
typedef struct SMetaOptions SMetaOptions;
|
||||
typedef struct STableOptions STableOptions;
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#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};
|
Loading…
Reference in New Issue