提交 6c8de26f 编写于 作者: H Hongze Cheng

more snapshot

上级 50e76f9a
......@@ -80,7 +80,7 @@ static int32_t tsdbSnapReadDel(STsdbSnapReader* pReader, uint8_t** ppData) {
while (pReader->iDelIdx < taosArrayGetSize(pReader->aDelIdx)) {
SDelIdx* pDelIdx = (SDelIdx*)taosArrayGet(pReader->aDelIdx, pReader->iDelIdx);
int8_t overlap = 0;
int32_t size = 0;
code = tsdbReadDelData(pReader->pDelFReader, pDelIdx, pReader->aDelData, NULL);
if (code) goto _err;
......@@ -89,13 +89,26 @@ static int32_t tsdbSnapReadDel(STsdbSnapReader* pReader, uint8_t** ppData) {
SDelData* pDelData = (SDelData*)taosArrayGet(pReader->aDelData, iDelData);
if (pDelData->version >= pReader->sver && pDelData->version <= pReader->ever) {
// encode the data to sync (todo)
overlap = 1;
size += tPutDelData(NULL, pDelData);
}
}
if (overlap) {
// prepare the data
if (size > 0) {
code = tRealloc(ppData, sizeof(SSnapDataHdr) + size); // TODO
if (code) goto _err;
// encode
((SSnapDataHdr*)(*ppData))->type = 1;
((SSnapDataHdr*)(*ppData))->size = size;
for (int32_t iDelData = 0; iDelData < taosArrayGetSize(pReader->aDelData); iDelData++) {
SDelData* pDelData = (SDelData*)taosArrayGet(pReader->aDelData, iDelData);
if (pDelData->version >= pReader->sver && pDelData->version <= pReader->ever) {
// size += tPutDelData(NULL, pDelData); (todo)
}
}
goto _exit;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册