提交 fbb9ebfd 编写于 作者: H Hongze Cheng

more work

上级 79e23420
...@@ -50,6 +50,8 @@ typedef struct { ...@@ -50,6 +50,8 @@ typedef struct {
SDelFWriter *pDelFWriter; SDelFWriter *pDelFWriter;
SMapData nDelIdxMap; // SMapData<SDelIdx>, new SMapData nDelIdxMap; // SMapData<SDelIdx>, new
SMapData nDelDataMap; // SMapData<SDelData>, new SMapData nDelDataMap; // SMapData<SDelData>, new
SArray *aDelIdx;
SArray *aDelData;
} SCommitter; } SCommitter;
static int32_t tsdbStartCommit(STsdb *pTsdb, SCommitter *pCommitter); static int32_t tsdbStartCommit(STsdb *pTsdb, SCommitter *pCommitter);
...@@ -926,63 +928,59 @@ static int32_t tsdbCommitFileDataImpl(SCommitter *pCommitter) { ...@@ -926,63 +928,59 @@ static int32_t tsdbCommitFileDataImpl(SCommitter *pCommitter) {
int32_t c = tTABLEIDCmprFn(pTbData, pBlockIdx); int32_t c = tTABLEIDCmprFn(pTbData, pBlockIdx);
if (c == 0) { if (c == 0) {
code = tsdbCommitTableData(pCommitter, pTbData, pBlockIdx); goto _commit_table_mem_and_disk;
if (code) goto _err;
iBlockIdx++;
if (iBlockIdx < nBlockIdx) {
tMapDataGetItemByIdx(&pCommitter->oBlockIdxMap, iBlockIdx, pBlockIdx, tGetBlockIdx);
} else {
pBlockIdx = NULL;
}
iTbData++;
if (iTbData < nTbData) {
pTbData = (STbData *)taosArrayGetP(pMemTable->aTbData, iTbData);
} else {
pTbData = NULL;
}
} else if (c < 0) { } else if (c < 0) {
code = tsdbCommitTableData(pCommitter, NULL, pBlockIdx); goto _commit_table_mem_data;
if (code) goto _err;
iBlockIdx++;
if (iBlockIdx < nBlockIdx) {
tMapDataGetItemByIdx(&pCommitter->oBlockIdxMap, iBlockIdx, pBlockIdx, tGetBlockIdx);
} else {
pBlockIdx = NULL;
}
} else { } else {
code = tsdbCommitTableData(pCommitter, pTbData, NULL); goto _commit_table_disk_data;
if (code) goto _err;
iTbData++;
if (iTbData < nTbData) {
pTbData = (STbData *)taosArrayGetP(pMemTable->aTbData, iTbData);
} else {
pTbData = NULL;
}
} }
} else if (pBlockIdx) { } else if (pBlockIdx) {
code = tsdbCommitTableData(pCommitter, NULL, pBlockIdx); goto _commit_table_disk_data;
if (code) goto _err; } else {
goto _commit_table_mem_data;
}
iBlockIdx++; _commit_table_mem_data:
if (iBlockIdx < nBlockIdx) { code = tsdbCommitTableData(pCommitter, pTbData, NULL);
tMapDataGetItemByIdx(&pCommitter->oBlockIdxMap, iBlockIdx, pBlockIdx, tGetBlockIdx); if (code) goto _err;
} else {
pBlockIdx = NULL; iTbData++;
} if (iTbData < nTbData) {
pTbData = (STbData *)taosArrayGetP(pMemTable->aTbData, iTbData);
} else { } else {
code = tsdbCommitTableData(pCommitter, pTbData, NULL); pTbData = NULL;
if (code) goto _err; }
continue;
iTbData++; _commit_table_disk_data:
if (iTbData < nTbData) { code = tsdbCommitTableData(pCommitter, NULL, pBlockIdx);
pTbData = (STbData *)taosArrayGetP(pMemTable->aTbData, iTbData); if (code) goto _err;
} else {
pTbData = NULL; iBlockIdx++;
} if (iBlockIdx < nBlockIdx) {
tMapDataGetItemByIdx(&pCommitter->oBlockIdxMap, iBlockIdx, pBlockIdx, tGetBlockIdx);
} else {
pBlockIdx = NULL;
} }
continue;
_commit_table_mem_and_disk:
code = tsdbCommitTableData(pCommitter, pTbData, pBlockIdx);
if (code) goto _err;
iBlockIdx++;
if (iBlockIdx < nBlockIdx) {
tMapDataGetItemByIdx(&pCommitter->oBlockIdxMap, iBlockIdx, pBlockIdx, tGetBlockIdx);
} else {
pBlockIdx = NULL;
}
iTbData++;
if (iTbData < nTbData) {
pTbData = (STbData *)taosArrayGetP(pMemTable->aTbData, iTbData);
} else {
pTbData = NULL;
}
continue;
} }
return code; return code;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册