提交 83fac242 编写于 作者: H Hongze Cheng

refact

上级 d1b6f2b2
......@@ -13,15 +13,46 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_TKV_INT_H_
#define _TD_TKV_INT_H_
#ifndef _TD_TKV_DEF_H_
#define _TD_TKV_DEF_H_
#ifdef USE_ROCKSDB
#include <rocksdb/c.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
struct STkvDb {
#ifdef USE_ROCKSDB
rocksdb_t *db;
#endif
};
struct STkvOpts {
#ifdef USE_ROCKSDB
rocksdb_options_t *opts;
#endif
};
struct STkvCache {
// TODO
};
struct STkvReadOpts {
#ifdef USE_ROCKSDB
rocksdb_readoptions_t *ropts;
#endif
};
struct STkvWriteOpts {
#ifdef USE_ROCKSDB
rocksdb_writeoptions_t *wopts;
#endif
};
#ifdef __cplusplus
}
#endif
#endif /*_TD_TKV_INT_H_*/
\ No newline at end of file
#endif /*_TD_TKV_DEF_H_*/
\ No newline at end of file
......@@ -13,39 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef USE_ROCKSDB
#include <rocksdb/c.h>
#endif
#include "tkv.h"
struct STkvDb {
#ifdef USE_ROCKSDB
rocksdb_t *db;
#endif
};
struct STkvOpts {
#ifdef USE_ROCKSDB
rocksdb_options_t *opts;
#endif
};
struct STkvCache {
// TODO
};
struct STkvReadOpts {
#ifdef USE_ROCKSDB
rocksdb_readoptions_t *ropts;
#endif
};
struct STkvWriteOpts {
#ifdef USE_ROCKSDB
rocksdb_writeoptions_t *wopts;
#endif
};
#include "tkvDef.h"
STkvDb *tkvOpen(const STkvOpts *options, const char *path) {
STkvDb *pDb = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册