提交 d4cb8e98 编写于 作者: H Hongze Cheng

more TDB

上级 2b6210ae
......@@ -42,8 +42,9 @@ typedef struct STqCfg {
typedef struct SVnodeCfg {
int32_t vgId;
SDnode *pDnode;
STfs *pTfs;
int64_t dbId;
SDnode * pDnode;
STfs * pTfs;
uint64_t wsize;
uint64_t ssize;
uint64_t lsize;
......@@ -59,9 +60,9 @@ typedef struct SVnodeCfg {
typedef struct {
int32_t sver;
const char *timezone;
const char *locale;
const char *charset;
const char * timezone;
const char * locale;
const char * charset;
uint16_t nthreads; // number of commit threads. 0 for no threads and a schedule queue should be given (TODO)
PutReqToVQueryQFp putReqToVQueryQFp;
SendReqToDnodeFp sendReqToDnodeFp;
......@@ -70,16 +71,16 @@ typedef struct {
typedef struct STqReadHandle {
int64_t ver;
uint64_t tbUid;
SHashObj *tbIdHash;
SHashObj * tbIdHash;
const SSubmitMsg *pMsg;
SSubmitBlk *pBlock;
SSubmitBlk * pBlock;
SSubmitMsgIter msgIter;
SSubmitBlkIter blkIter;
SMeta *pVnodeMeta;
SArray *pColIdList; // SArray<int32_t>
SMeta * pVnodeMeta;
SArray * pColIdList; // SArray<int32_t>
int32_t sver;
SSchemaWrapper *pSchemaWrapper;
STSchema *pSchema;
SSchemaWrapper * pSchemaWrapper;
STSchema * pSchema;
} STqReadHandle;
/* ------------------------ SVnode ------------------------ */
......
......@@ -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
......
......@@ -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
......
......@@ -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;
}
\ No newline at end of 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
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册