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

more code

上级 d4a5d511
...@@ -465,6 +465,17 @@ _err: ...@@ -465,6 +465,17 @@ _err:
return code; return code;
} }
static int32_t tsdbSnapWriteDataEnd(STsdbSnapWriter* pWriter) {
int32_t code = 0;
STsdb* pTsdb = pWriter->pTsdb;
_exit:
return code;
_err:
return code;
}
static int32_t tsdbSnapWriteDelEnd(STsdbSnapWriter* pWriter) { static int32_t tsdbSnapWriteDelEnd(STsdbSnapWriter* pWriter) {
int32_t code = 0; int32_t code = 0;
STsdb* pTsdb = pWriter->pTsdb; STsdb* pTsdb = pWriter->pTsdb;
...@@ -539,6 +550,12 @@ int32_t tsdbSnapWriterClose(STsdbSnapWriter** ppWriter, int8_t rollback) { ...@@ -539,6 +550,12 @@ int32_t tsdbSnapWriterClose(STsdbSnapWriter** ppWriter, int8_t rollback) {
code = tsdbSnapRollback(pWriter); code = tsdbSnapRollback(pWriter);
if (code) goto _err; if (code) goto _err;
} else { } else {
code = tsdbSnapWriteDataEnd(pWriter);
if (code) goto _err;
code = tsdbSnapWriteDelEnd(pWriter);
if (code) goto _err;
code = tsdbSnapCommit(pWriter); code = tsdbSnapCommit(pWriter);
if (code) goto _err; if (code) goto _err;
} }
...@@ -562,13 +579,8 @@ int32_t tsdbSnapWrite(STsdbSnapWriter* pWriter, uint8_t* pData, uint32_t nData) ...@@ -562,13 +579,8 @@ int32_t tsdbSnapWrite(STsdbSnapWriter* pWriter, uint8_t* pData, uint32_t nData)
code = tsdbSnapWriteData(pWriter, pData + 1, nData - 1); code = tsdbSnapWriteData(pWriter, pData + 1, nData - 1);
if (code) goto _err; if (code) goto _err;
} else { } else {
if (pWriter->pDataFWriter) { code = tsdbSnapWriteDataEnd(pWriter);
// commit the remain data of the FSet (todo) if (code) goto _err;
// close and update the file
code = tsdbDataFWriterClose(&pWriter->pDataFWriter, 1);
if (code) goto _err;
}
} }
// del data // del data
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册