From daf5d4239458d4c316b4af797a0713613d02a8d9 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Fri, 26 Aug 2022 17:05:17 +0800 Subject: [PATCH] more code --- source/dnode/vnode/src/tsdb/tsdbCommit.c | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/source/dnode/vnode/src/tsdb/tsdbCommit.c b/source/dnode/vnode/src/tsdb/tsdbCommit.c index ce31acc331..9af25338e5 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCommit.c +++ b/source/dnode/vnode/src/tsdb/tsdbCommit.c @@ -1439,6 +1439,18 @@ _exit: return code; } +static int32_t tsdbCommitAheadBlock(SCommitter *pCommitter, SBlock *pBlock) { + int32_t code = 0; + // TODO + return code; +} + +static int32_t tsdbCommitMergeBlock(SCommitter *pCommitter, SBlock *pBlock) { + int32_t code = 0; + // TODO + return code; +} + static int32_t tsdbMergeTableData(SCommitter *pCommitter, TABLEID id) { int32_t code = 0; SBlockIdx *pBlockIdx = pCommitter->dReader.pBlockIdx; @@ -1468,7 +1480,23 @@ static int32_t tsdbMergeTableData(SCommitter *pCommitter, TABLEID id) { pBlock = NULL; } } else if (c > 0) { + code = tsdbCommitAheadBlock(pCommitter, pBlock); + if (code) goto _err; + + pRowInfo = tsdbGetCommitRow(pCommitter); + if (pRowInfo && (pRowInfo->suid != id.suid || pRowInfo->uid != id.uid)) pRowInfo = NULL; } else { + code = tsdbCommitMergeBlock(pCommitter, pBlock); + if (code) goto _err; + + iBlock++; + if (iBlock < pCommitter->dReader.mBlock.nItem) { + tMapDataGetItemByIdx(&pCommitter->dReader.mBlock, iBlock, pBlock, tGetBlock); + } else { + pBlock = NULL; + } + pRowInfo = tsdbGetCommitRow(pCommitter); + if (pRowInfo && (pRowInfo->suid != id.suid || pRowInfo->uid != id.uid)) pRowInfo = NULL; } } -- GitLab