From f828d1b3215fb96beb06374323206bd195521ecc Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 20 Jun 2022 03:21:39 +0000 Subject: [PATCH] more refact --- source/dnode/vnode/src/inc/tsdb.h | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index 584a34d7ba..f3ede025c6 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -83,18 +83,16 @@ int32_t tTABLEIDCmprFn(const void *p1, const void *p2); // TSDBKEY int32_t tsdbKeyCmprFn(const void *p1, const void *p2); // KEYINFO -#define tKEYINFOInit() \ - ((KEYINFO){.maxKey = {.ts = TSKEY_MIN, .version = 0}, \ - .minKey = {.ts = TSKEY_MAX, .version = -1}, \ - .minVerion = INT64_MAX, \ - .maxKey = -1}) +#define tKEYINFOInit() \ + ((KEYINFO){.maxKey = {.ts = TSKEY_MIN, .version = -1}, \ + .minKey = {.ts = TSKEY_MAX, .version = INT64_MAX}, \ + .minVerion = INT64_MAX, \ + .maxVersion = -1}) int32_t tPutKEYINFO(uint8_t *p, KEYINFO *pKeyInfo); int32_t tGetKEYINFO(uint8_t *p, KEYINFO *pKeyInfo); -// SColdata -int32_t tColDataCmprFn(const void *p1, const void *p2); -// SBlockIdx -int32_t tPutBlockIdx(uint8_t *p, void *ph); -int32_t tGetBlockIdx(uint8_t *p, void *ph); +// SBlockCol +int32_t tPutBlockCol(uint8_t *p, void *ph); +int32_t tGetBlockCol(uint8_t *p, void *ph); // SBlock #define tBlockInit() ((SBlock){.info = tKEYINFOInit()}) void tBlockReset(SBlock *pBlock); @@ -102,9 +100,14 @@ void tBlockClear(SBlock *pBlock); int32_t tPutBlock(uint8_t *p, void *ph); int32_t tGetBlock(uint8_t *p, void *ph); int32_t tBlockCmprFn(const void *p1, const void *p2); -// SBlockCol -int32_t tPutBlockCol(uint8_t *p, void *ph); -int32_t tGetBlockCol(uint8_t *p, void *ph); +// SBlockIdx +int32_t tPutBlockIdx(uint8_t *p, void *ph); +int32_t tGetBlockIdx(uint8_t *p, void *ph); +// SColdata +#define tColDataInit() ((SColData){0}) +void tColDataReset(SColData *pColData); +void tColDataClear(SColData *pColData); +int32_t tColDataCmprFn(const void *p1, const void *p2); // SBlockData #define tsdbBlockDataCreate() ((SBlockData){0}) void tsdbBlockDataClear(SBlockData *pBlockData); -- GitLab