This commit is contained in:
Hongze Cheng 2022-02-09 02:22:46 +00:00
parent 2b6210aec3
commit d4cb8e981d
5 changed files with 54 additions and 13 deletions

View File

@ -42,6 +42,7 @@ typedef struct STqCfg {
typedef struct SVnodeCfg {
int32_t vgId;
int64_t dbId;
SDnode * pDnode;
STfs * pTfs;
uint64_t wsize;

View File

@ -23,8 +23,8 @@
#include "tlist.h"
#include "tlockfree.h"
#include "tmacro.h"
#include "wal.h"
#include "tq.h"
#include "wal.h"
#include "vnode.h"
@ -175,7 +175,6 @@ void* vmaMalloc(SVMemAllocator* pVMA, uint64_t size);
void vmaFree(SVMemAllocator* pVMA, void* ptr);
bool vmaIsFull(SVMemAllocator* pVMA);
#ifdef __cplusplus
}
#endif

View File

@ -22,6 +22,13 @@
extern "C" {
#endif
typedef struct STDb TDB;
int tdbCreate(TDB **ppDb);
int tdbDestroy(TDB *pDb);
int tdbOpen(TDB **pDb);
int tdbClose(TDB *pDb);
#ifdef __cplusplus
}
#endif

View File

@ -19,3 +19,34 @@ struct STDb {
// TODO
SBTree *pBt;
};
int tdbCreate(TDB **ppDb) {
TDB *pDb;
pDb = (TDB *)calloc(1, sizeof(*pDb));
if (pDb == NULL) {
return -1;
}
/* TODO */
return 0;
}
int tdbDestroy(TDB *pDb) {
if (pDb) {
free(pDb);
}
/* TODO */
return 0;
}
int tdbOpen(TDB **pDb) {
// TODO
return 0;
}
int tdbClose(TDB *pDb) {
// TODO
return 0;
}

View File

@ -28,6 +28,9 @@ int btreeOpen(SBTree **ppBt);
int btreeClose(SBTree *pBt);
// SBtCursor
int btreeCursorOpen(SBtCursor *pBtCur, SBTree *pBt);
int btreeCursorClose(SBtCursor *pBtCur);
int btreeCursorMoveTo(SBtCursor *pBtCur);
#ifdef __cplusplus
}