more work
This commit is contained in:
parent
79e23420b4
commit
fbb9ebfddc
|
@ -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,6 +928,43 @@ static int32_t tsdbCommitFileDataImpl(SCommitter *pCommitter) {
|
||||||
int32_t c = tTABLEIDCmprFn(pTbData, pBlockIdx);
|
int32_t c = tTABLEIDCmprFn(pTbData, pBlockIdx);
|
||||||
|
|
||||||
if (c == 0) {
|
if (c == 0) {
|
||||||
|
goto _commit_table_mem_and_disk;
|
||||||
|
} else if (c < 0) {
|
||||||
|
goto _commit_table_mem_data;
|
||||||
|
} else {
|
||||||
|
goto _commit_table_disk_data;
|
||||||
|
}
|
||||||
|
} else if (pBlockIdx) {
|
||||||
|
goto _commit_table_disk_data;
|
||||||
|
} else {
|
||||||
|
goto _commit_table_mem_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
_commit_table_mem_data:
|
||||||
|
code = tsdbCommitTableData(pCommitter, pTbData, NULL);
|
||||||
|
if (code) goto _err;
|
||||||
|
|
||||||
|
iTbData++;
|
||||||
|
if (iTbData < nTbData) {
|
||||||
|
pTbData = (STbData *)taosArrayGetP(pMemTable->aTbData, iTbData);
|
||||||
|
} else {
|
||||||
|
pTbData = NULL;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
|
||||||
|
_commit_table_disk_data:
|
||||||
|
code = tsdbCommitTableData(pCommitter, NULL, pBlockIdx);
|
||||||
|
if (code) goto _err;
|
||||||
|
|
||||||
|
iBlockIdx++;
|
||||||
|
if (iBlockIdx < nBlockIdx) {
|
||||||
|
tMapDataGetItemByIdx(&pCommitter->oBlockIdxMap, iBlockIdx, pBlockIdx, tGetBlockIdx);
|
||||||
|
} else {
|
||||||
|
pBlockIdx = NULL;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
|
||||||
|
_commit_table_mem_and_disk:
|
||||||
code = tsdbCommitTableData(pCommitter, pTbData, pBlockIdx);
|
code = tsdbCommitTableData(pCommitter, pTbData, pBlockIdx);
|
||||||
if (code) goto _err;
|
if (code) goto _err;
|
||||||
|
|
||||||
|
@ -941,48 +980,7 @@ static int32_t tsdbCommitFileDataImpl(SCommitter *pCommitter) {
|
||||||
} else {
|
} else {
|
||||||
pTbData = NULL;
|
pTbData = NULL;
|
||||||
}
|
}
|
||||||
} else if (c < 0) {
|
continue;
|
||||||
code = tsdbCommitTableData(pCommitter, NULL, pBlockIdx);
|
|
||||||
if (code) goto _err;
|
|
||||||
|
|
||||||
iBlockIdx++;
|
|
||||||
if (iBlockIdx < nBlockIdx) {
|
|
||||||
tMapDataGetItemByIdx(&pCommitter->oBlockIdxMap, iBlockIdx, pBlockIdx, tGetBlockIdx);
|
|
||||||
} else {
|
|
||||||
pBlockIdx = NULL;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
code = tsdbCommitTableData(pCommitter, pTbData, NULL);
|
|
||||||
if (code) goto _err;
|
|
||||||
|
|
||||||
iTbData++;
|
|
||||||
if (iTbData < nTbData) {
|
|
||||||
pTbData = (STbData *)taosArrayGetP(pMemTable->aTbData, iTbData);
|
|
||||||
} else {
|
|
||||||
pTbData = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (pBlockIdx) {
|
|
||||||
code = tsdbCommitTableData(pCommitter, NULL, pBlockIdx);
|
|
||||||
if (code) goto _err;
|
|
||||||
|
|
||||||
iBlockIdx++;
|
|
||||||
if (iBlockIdx < nBlockIdx) {
|
|
||||||
tMapDataGetItemByIdx(&pCommitter->oBlockIdxMap, iBlockIdx, pBlockIdx, tGetBlockIdx);
|
|
||||||
} else {
|
|
||||||
pBlockIdx = NULL;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
code = tsdbCommitTableData(pCommitter, pTbData, NULL);
|
|
||||||
if (code) goto _err;
|
|
||||||
|
|
||||||
iTbData++;
|
|
||||||
if (iTbData < nTbData) {
|
|
||||||
pTbData = (STbData *)taosArrayGetP(pMemTable->aTbData, iTbData);
|
|
||||||
} else {
|
|
||||||
pTbData = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
|
Loading…
Reference in New Issue