提交 d0e0034a 编写于 作者: C Cary Xu

code optimization

上级 562e1442
...@@ -75,7 +75,8 @@ typedef struct { ...@@ -75,7 +75,8 @@ typedef struct {
uint64_t aggrStat : 3; \ uint64_t aggrStat : 3; \
uint64_t blkVer : 5; \ uint64_t blkVer : 5; \
uint64_t aggrOffset : 56; \ uint64_t aggrOffset : 56; \
uint32_t aggrLen uint32_t aggrLen; \
uint32_t reserved
typedef struct { typedef struct {
SBlockFieldsP0; SBlockFieldsP0;
...@@ -118,6 +119,7 @@ typedef struct { ...@@ -118,6 +119,7 @@ typedef struct {
char padding[1]; char padding[1];
} SBlockColV0; } SBlockColV0;
typedef struct { typedef struct {
int16_t colId; int16_t colId;
uint8_t offsetH; uint8_t offsetH;
...@@ -125,8 +127,7 @@ typedef struct { ...@@ -125,8 +127,7 @@ typedef struct {
int32_t len; int32_t len;
uint32_t type : 8; uint32_t type : 8;
uint32_t offset : 24; uint32_t offset : 24;
// char padding[]; } SBlockColV1; // size
} SBlockColV1;
#define SBlockCol SBlockColV1 // latest SBlockCol definition #define SBlockCol SBlockColV1 // latest SBlockCol definition
......
...@@ -1263,7 +1263,7 @@ static int tsdbCommitMemData(SCommitH *pCommith, SCommitIter *pIter, TSKEY keyLi ...@@ -1263,7 +1263,7 @@ static int tsdbCommitMemData(SCommitH *pCommith, SCommitIter *pIter, TSKEY keyLi
int32_t defaultRows = TSDB_COMMIT_DEFAULT_ROWS(pCommith); int32_t defaultRows = TSDB_COMMIT_DEFAULT_ROWS(pCommith);
SDFile * pDFile; SDFile * pDFile;
bool isLast; bool isLast;
SBlock block = {0}; SBlock block;
while (true) { while (true) {
tsdbLoadDataFromCache(pIter->pTable, pIter->pIter, keyLimit, defaultRows, pCommith->pDataCols, NULL, 0, tsdbLoadDataFromCache(pIter->pTable, pIter->pIter, keyLimit, defaultRows, pCommith->pDataCols, NULL, 0,
...@@ -1363,7 +1363,7 @@ static int tsdbMergeMemData(SCommitH *pCommith, SCommitIter *pIter, int bidx) { ...@@ -1363,7 +1363,7 @@ static int tsdbMergeMemData(SCommitH *pCommith, SCommitIter *pIter, int bidx) {
static int tsdbMoveBlock(SCommitH *pCommith, int bidx) { static int tsdbMoveBlock(SCommitH *pCommith, int bidx) {
SBlock *pBlock = pCommith->readh.pBlkInfo->blocks + bidx; SBlock *pBlock = pCommith->readh.pBlkInfo->blocks + bidx;
SDFile *pDFile; SDFile *pDFile;
SBlock block = {0}; SBlock block;
bool isSameFile; bool isSameFile;
ASSERT(pBlock->numOfSubBlocks > 0); ASSERT(pBlock->numOfSubBlocks > 0);
...@@ -1416,7 +1416,7 @@ static int tsdbCommitAddBlock(SCommitH *pCommith, const SBlock *pSupBlock, const ...@@ -1416,7 +1416,7 @@ static int tsdbCommitAddBlock(SCommitH *pCommith, const SBlock *pSupBlock, const
static int tsdbMergeBlockData(SCommitH *pCommith, SCommitIter *pIter, SDataCols *pDataCols, TSKEY keyLimit, bool isLastOneBlock) { static int tsdbMergeBlockData(SCommitH *pCommith, SCommitIter *pIter, SDataCols *pDataCols, TSKEY keyLimit, bool isLastOneBlock) {
STsdbRepo *pRepo = TSDB_COMMIT_REPO(pCommith); STsdbRepo *pRepo = TSDB_COMMIT_REPO(pCommith);
STsdbCfg * pCfg = REPO_CFG(pRepo); STsdbCfg * pCfg = REPO_CFG(pRepo);
SBlock block = {0}; SBlock block;
SDFile * pDFile; SDFile * pDFile;
bool isLast; bool isLast;
int32_t defaultRows = TSDB_COMMIT_DEFAULT_ROWS(pCommith); int32_t defaultRows = TSDB_COMMIT_DEFAULT_ROWS(pCommith);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册