more code
This commit is contained in:
parent
66c18cb70b
commit
3eefc93830
|
@ -32,6 +32,11 @@ extern "C" {
|
|||
#define tsdbTrace(...) do { if (tsdbDebugFlag & DEBUG_TRACE) { taosPrintLog("TSDB ", DEBUG_TRACE, tsdbDebugFlag, __VA_ARGS__); }} while(0)
|
||||
// clang-format on
|
||||
|
||||
typedef struct TSDBKEY TSDBKEY;
|
||||
|
||||
// tsdbMemTable2.c ==============================================================================================
|
||||
typedef struct SMemTable SMemTable;
|
||||
|
||||
// tsdbMemTable ================
|
||||
typedef struct STsdbRow STsdbRow;
|
||||
typedef struct STbData STbData;
|
||||
|
@ -851,6 +856,11 @@ struct STsdbRow {
|
|||
STSRow row;
|
||||
};
|
||||
|
||||
struct TSDBKEY {
|
||||
int64_t version;
|
||||
TSKEY ts;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -15,27 +15,45 @@
|
|||
|
||||
#include "tsdb.h"
|
||||
|
||||
typedef struct SMemTable SMemTable;
|
||||
typedef struct SMemData SMemData;
|
||||
typedef struct SMemSkipList SMemSkipList;
|
||||
typedef struct SMemSkipListNode SMemSkipListNode;
|
||||
typedef struct SMemSkipListCurosr SMemSkipListCurosr;
|
||||
typedef struct SMemData SMemData;
|
||||
// typedef struct SMemSkipList SMemSkipList;
|
||||
// typedef struct SMemSkipListNode SMemSkipListNode;
|
||||
// typedef struct SMemSkipListCurosr SMemSkipListCurosr;
|
||||
|
||||
#define SL_MAX_LEVEL 5
|
||||
struct SMemData {
|
||||
tb_uid_t suid;
|
||||
tb_uid_t uid;
|
||||
TSDBKEY minKey;
|
||||
TSDBKEY maxKey;
|
||||
int64_t nRows;
|
||||
SMemData *pHashNext;
|
||||
};
|
||||
|
||||
struct SMemTable {
|
||||
STsdb *pTsdb;
|
||||
TSKEY minKey;
|
||||
TSKEY maxKey;
|
||||
int64_t minVer;
|
||||
int64_t maxVer;
|
||||
int64_t nRows;
|
||||
int32_t nHash;
|
||||
int32_t nBucket;
|
||||
SMemData **pBuckets;
|
||||
SMemSkipListCurosr *pSlc;
|
||||
STsdb *pTsdb;
|
||||
int32_t nRef;
|
||||
TSDBKEY minKey;
|
||||
TSDBKEY maxKey;
|
||||
int64_t nRows;
|
||||
SArray *pArray;
|
||||
};
|
||||
|
||||
int32_t tsdbMemTableCreate(STsdb *pTsdb, SMemTable **ppMemTable) {
|
||||
int32_t code = 0;
|
||||
// TODO
|
||||
return code;
|
||||
}
|
||||
|
||||
int32_t tsdbMemTableDestroy(SMemTable *pMemTable) {
|
||||
int32_t code = 0;
|
||||
// TODO
|
||||
return code;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
#define SL_MAX_LEVEL 5
|
||||
|
||||
struct SMemSkipListNode {
|
||||
int8_t level;
|
||||
SMemSkipListNode *forwards[1]; // Windows does not allow 0
|
||||
|
@ -49,18 +67,6 @@ struct SMemSkipList {
|
|||
SMemSkipListNode pHead[1]; // Windows does not allow 0
|
||||
};
|
||||
|
||||
struct SMemData {
|
||||
SMemData *pHashNext;
|
||||
tb_uid_t suid;
|
||||
tb_uid_t uid;
|
||||
TSKEY minKey;
|
||||
TSKEY maxKey;
|
||||
int64_t minVer;
|
||||
int64_t maxVer;
|
||||
int64_t nRows;
|
||||
SMemSkipList sl;
|
||||
};
|
||||
|
||||
struct SMemSkipListCurosr {
|
||||
SMemSkipList *pSl;
|
||||
SMemSkipListNode *pNodes[SL_MAX_LEVEL];
|
||||
|
@ -377,4 +383,5 @@ static SMemSkipListNode *tsdbMemSkipListNodeCreate(SVBufPool *pPool, SMemSkipLis
|
|||
}
|
||||
|
||||
return pNode;
|
||||
}
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue