make it compile
This commit is contained in:
parent
c84bfb9c76
commit
545e4d7f02
|
@ -1370,63 +1370,6 @@ _exit:
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t tsdbSnapWriteFileDataEnd(STsdbSnapWriter* pWriter) {
|
|
||||||
int32_t code = 0;
|
|
||||||
int32_t lino = 0;
|
|
||||||
|
|
||||||
ASSERT(pWriter->pDataFWriter);
|
|
||||||
|
|
||||||
// consume remain data and end with a NULL table row
|
|
||||||
SRowInfo* pRowInfo;
|
|
||||||
code = tsdbSnapWriteGetRow(pWriter, &pRowInfo);
|
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
|
||||||
for (;;) {
|
|
||||||
code = tsdbSnapWriteTableData(pWriter, pRowInfo);
|
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
|
||||||
|
|
||||||
if (pRowInfo == NULL) break;
|
|
||||||
|
|
||||||
code = tsdbSnapWriteNextRow(pWriter, &pRowInfo);
|
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
|
||||||
}
|
|
||||||
|
|
||||||
// do file-level updates
|
|
||||||
code = tsdbWriteSttBlk(pWriter->pDataFWriter, pWriter->aSttBlk);
|
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
|
||||||
|
|
||||||
code = tsdbWriteBlockIdx(pWriter->pDataFWriter, pWriter->aBlockIdx);
|
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
|
||||||
|
|
||||||
code = tsdbUpdateDFileSetHeader(pWriter->pDataFWriter);
|
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
|
||||||
|
|
||||||
code = tsdbFSUpsertFSet(&pWriter->fs, &pWriter->pDataFWriter->wSet);
|
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
|
||||||
|
|
||||||
code = tsdbDataFWriterClose(&pWriter->pDataFWriter, 1);
|
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
|
||||||
|
|
||||||
if (pWriter->pDataFReader) {
|
|
||||||
code = tsdbDataFReaderClose(&pWriter->pDataFReader);
|
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
|
||||||
}
|
|
||||||
|
|
||||||
// clear sources
|
|
||||||
while (pWriter->iterList) {
|
|
||||||
STsdbDataIter2* pIter = pWriter->iterList;
|
|
||||||
pWriter->iterList = pIter->next;
|
|
||||||
tsdbCloseDataIter2(pIter);
|
|
||||||
}
|
|
||||||
|
|
||||||
_exit:
|
|
||||||
if (code) {
|
|
||||||
tsdbError("vgId:%d %s failed since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, tstrerror(code));
|
|
||||||
} else {
|
|
||||||
tsdbDebug("vgId:%d %s is done", TD_VID(pWriter->pTsdb->pVnode), __func__);
|
|
||||||
}
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int32_t tsdbSnapWriteNextRow(STsdbSnapWriter* pWriter, SRowInfo** ppRowInfo) {
|
static int32_t tsdbSnapWriteNextRow(STsdbSnapWriter* pWriter, SRowInfo** ppRowInfo) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
int32_t lino = 0;
|
int32_t lino = 0;
|
||||||
|
@ -1493,6 +1436,63 @@ _exit:
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int32_t tsdbSnapWriteFileDataEnd(STsdbSnapWriter* pWriter) {
|
||||||
|
int32_t code = 0;
|
||||||
|
int32_t lino = 0;
|
||||||
|
|
||||||
|
ASSERT(pWriter->pDataFWriter);
|
||||||
|
|
||||||
|
// consume remain data and end with a NULL table row
|
||||||
|
SRowInfo* pRowInfo;
|
||||||
|
code = tsdbSnapWriteGetRow(pWriter, &pRowInfo);
|
||||||
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
for (;;) {
|
||||||
|
code = tsdbSnapWriteTableData(pWriter, pRowInfo);
|
||||||
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
|
||||||
|
if (pRowInfo == NULL) break;
|
||||||
|
|
||||||
|
code = tsdbSnapWriteNextRow(pWriter, &pRowInfo);
|
||||||
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
}
|
||||||
|
|
||||||
|
// do file-level updates
|
||||||
|
code = tsdbWriteSttBlk(pWriter->pDataFWriter, pWriter->aSttBlk);
|
||||||
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
|
||||||
|
code = tsdbWriteBlockIdx(pWriter->pDataFWriter, pWriter->aBlockIdx);
|
||||||
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
|
||||||
|
code = tsdbUpdateDFileSetHeader(pWriter->pDataFWriter);
|
||||||
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
|
||||||
|
code = tsdbFSUpsertFSet(&pWriter->fs, &pWriter->pDataFWriter->wSet);
|
||||||
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
|
||||||
|
code = tsdbDataFWriterClose(&pWriter->pDataFWriter, 1);
|
||||||
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
|
||||||
|
if (pWriter->pDataFReader) {
|
||||||
|
code = tsdbDataFReaderClose(&pWriter->pDataFReader);
|
||||||
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
}
|
||||||
|
|
||||||
|
// clear sources
|
||||||
|
while (pWriter->iterList) {
|
||||||
|
STsdbDataIter2* pIter = pWriter->iterList;
|
||||||
|
pWriter->iterList = pIter->next;
|
||||||
|
tsdbCloseDataIter2(pIter);
|
||||||
|
}
|
||||||
|
|
||||||
|
_exit:
|
||||||
|
if (code) {
|
||||||
|
tsdbError("vgId:%d %s failed since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, tstrerror(code));
|
||||||
|
} else {
|
||||||
|
tsdbDebug("vgId:%d %s is done", TD_VID(pWriter->pTsdb->pVnode), __func__);
|
||||||
|
}
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
static int32_t tsdbSnapWriteTimeSeriesData(STsdbSnapWriter* pWriter, SSnapDataHdr* pHdr) {
|
static int32_t tsdbSnapWriteTimeSeriesData(STsdbSnapWriter* pWriter, SSnapDataHdr* pHdr) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
int32_t lino = 0;
|
int32_t lino = 0;
|
||||||
|
|
Loading…
Reference in New Issue