more work
This commit is contained in:
parent
8f08aedcde
commit
4027782f9a
|
@ -91,7 +91,7 @@ typedef struct SDelFWriter SDelFWriter;
|
||||||
|
|
||||||
int32_t tsdbDelFWriterOpen(SDelFWriter **ppWriter, SDelFile *pFile, STsdb *pTsdb);
|
int32_t tsdbDelFWriterOpen(SDelFWriter **ppWriter, SDelFile *pFile, STsdb *pTsdb);
|
||||||
int32_t tsdbDelFWriterClose(SDelFWriter *pWriter, int8_t sync);
|
int32_t tsdbDelFWriterClose(SDelFWriter *pWriter, int8_t sync);
|
||||||
int32_t tsdbWriteDelData(SDelFWriter *pWriter, SDelData *pDelData, uint8_t **ppBuf);
|
int32_t tsdbWriteDelData(SDelFWriter *pWriter, SDelData *pDelData, uint8_t **ppBuf, int64_t *rOffset, int64_t *rSize);
|
||||||
int32_t tsdbWriteDelIdx(SDelFWriter *pWriter, SDelIdx *pDelIdx, uint8_t **ppBuf);
|
int32_t tsdbWriteDelIdx(SDelFWriter *pWriter, SDelIdx *pDelIdx, uint8_t **ppBuf);
|
||||||
int32_t tsdbUpdateDelFileHdr(SDelFWriter *pWriter, uint8_t **ppBuf);
|
int32_t tsdbUpdateDelFileHdr(SDelFWriter *pWriter, uint8_t **ppBuf);
|
||||||
|
|
||||||
|
|
|
@ -662,7 +662,8 @@ static int32_t tsdbCommitTableDelEnd(SCommitter *pCommitter) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
|
||||||
// write table del data
|
// write table del data
|
||||||
code = tsdbWriteDelData(pCommitter->pDelFWriter, &pCommitter->delDataNew, NULL);
|
code = tsdbWriteDelData(pCommitter->pDelFWriter, &pCommitter->delDataNew, NULL, &pCommitter->delIdxItem.offset,
|
||||||
|
&pCommitter->delIdxItem.size);
|
||||||
if (code) goto _err;
|
if (code) goto _err;
|
||||||
|
|
||||||
// add SDelIdxItem
|
// add SDelIdxItem
|
||||||
|
|
|
@ -139,7 +139,7 @@ _err:
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tsdbWriteDelData(SDelFWriter *pWriter, SDelData *pDelData, uint8_t **ppBuf) {
|
int32_t tsdbWriteDelData(SDelFWriter *pWriter, SDelData *pDelData, uint8_t **ppBuf, int64_t *rOffset, int64_t *rSize) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
uint8_t *pBuf = NULL;
|
uint8_t *pBuf = NULL;
|
||||||
int64_t size;
|
int64_t size;
|
||||||
|
@ -170,6 +170,8 @@ int32_t tsdbWriteDelData(SDelFWriter *pWriter, SDelData *pDelData, uint8_t **ppB
|
||||||
ASSERT(n == size);
|
ASSERT(n == size);
|
||||||
|
|
||||||
// update
|
// update
|
||||||
|
*rOffset = pWriter->pFile->size;
|
||||||
|
*rSize = size;
|
||||||
pWriter->pFile->offset = pWriter->pFile->size;
|
pWriter->pFile->offset = pWriter->pFile->size;
|
||||||
pWriter->pFile->size += size;
|
pWriter->pFile->size += size;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue