diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index bda3afe538..41c3574954 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -48,9 +48,9 @@ typedef struct SMapData SMapData; typedef struct SBlockSMA SBlockSMA; typedef struct SBlockIdx SBlockIdx; typedef struct SBlock SBlock; -typedef struct SBlockCol SBlockCol; typedef struct SBlockStatis SBlockStatis; typedef struct SAggrBlkCol SAggrBlkCol; +typedef struct SColData SColData; typedef struct SBlockData SBlockData; typedef struct SReadH SReadH; @@ -305,14 +305,6 @@ struct SBlock { SSubBlock sBlocks[TSDB_MAX_SUBBLOCKS]; }; -struct SBlockCol { - int16_t colId; - uint16_t type : 6; - uint16_t blen : 10; // 0 no bitmap if all rows are NORM, > 0 bitmap length - uint32_t len; // data length + bitmap length - uint32_t offset; -}; - struct SAggrBlkCol { int16_t colId; int16_t maxIndex; @@ -323,12 +315,20 @@ struct SAggrBlkCol { int64_t min; }; -struct SBlockData { - int32_t nRow; - SBlockCol cols[]; +struct SColData { + int16_t cid; + int8_t type; + int32_t bytes; + uint8_t flags; + uint8_t *pBitMap; + uint32_t nData; + uint8_t *pData; }; -typedef void SAggrBlkData; // SBlockCol cols[]; +struct SBlockData { + int32_t nRow; + SArray *aColData; +}; // ================== TSDB global config extern bool tsdbForceKeepFile; diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 8ba4b04e3f..9286063fb6 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -258,7 +258,7 @@ struct SSma { #define SMA_CFG(s) (&(s)->pVnode->config) #define SMA_TSDB_CFG(s) (&(s)->pVnode->config.tsdbCfg) -#define SMA_RETENTION(s) ((SRetention *)&(s)->pVnode->config.tsdbCfg.retentions) +#define SMA_RETENTION(s) ((SRetention*)&(s)->pVnode->config.tsdbCfg.retentions) #define SMA_LOCKED(s) ((s)->locked) #define SMA_META(s) ((s)->pVnode->pMeta) #define SMA_VID(s) TD_VID((s)->pVnode) diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil.c b/source/dnode/vnode/src/tsdb/tsdbUtil.c index 931f5f9a76..cfe5259971 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil.c @@ -164,7 +164,7 @@ int32_t tsdbRealloc(uint8_t **ppBuf, int64_t size) { if (bsize >= size) goto _exit; - if (bsize == 0) bsize = 128; + if (bsize == 0) bsize = 16; while (bsize < size) { bsize *= 2; } @@ -543,4 +543,6 @@ int32_t tGetKEYINFO(uint8_t *p, KEYINFO *pKeyInfo) { n += tGetI64v(p + n, &pKeyInfo->maxVersion); return n; -} \ No newline at end of file +} + +// SBlockData ====================================================== \ No newline at end of file