提交 934a170e 编写于 作者: H Hongze Cheng

more code

上级 ac625921
......@@ -221,7 +221,12 @@ static int32_t tsdbCommitDelData(SCommitter2 *committer) {
SMemTable *mem = committer->tsdb->imem;
if (mem->nDel == 0) goto _exit;
if (mem->nDel == 0 //
|| (committer->ctx->fset == NULL //
&& committer->sttWriter == NULL) //
) {
goto _exit;
}
SRBTreeIter iter[1] = {tRBTreeIterCreate(committer->tsdb->imem->tbDataTree, 1)};
......@@ -248,7 +253,12 @@ static int32_t tsdbCommitDelData(SCommitter2 *committer) {
record->ekey = delData->eKey;
}
code = tsdbSttFileWriteDelRecord(committer->sttWriter, record); // TODO
if (!committer->sttWriter) {
code = tsdbCommitOpenWriter(committer);
TSDB_CHECK_CODE(code, lino, _exit);
}
code = tsdbSttFileWriteDelRecord(committer->sttWriter, record);
TSDB_CHECK_CODE(code, lino, _exit);
}
}
......
......@@ -262,6 +262,11 @@ int32_t tsdbSttFileReadDelBlock(SSttSegReader *reader, const SDelBlk *delBlk, SD
&reader->reader->config->bufArr[2]);
TSDB_CHECK_CODE(code, lino, _exit);
for (int32_t j = 0; j < delBlk->numRec; ++j) {
code = TARRAY2_APPEND(&dData->dataArr[i], ((int64_t *)(reader->reader->config->bufArr[1]))[j]);
continue;
}
size += delBlk->size[i];
}
......@@ -474,7 +479,7 @@ static int32_t tsdbSttFileDoWriteDelBlock(SSttFileWriter *writer) {
for (int32_t i = 0; i < ARRAY_SIZE(writer->dData->dataArr); i++) {
int32_t size;
code = tsdbCmprData((uint8_t *)TARRAY2_DATA(&writer->dData->dataArr[i]),
TARRAY2_DATA_LEN(&writer->dData->dataArr[i]), TSDB_DATA_TYPE_BIGINT, writer->config->cmprAlg,
TARRAY2_DATA_LEN(&writer->dData->dataArr[i]), TSDB_DATA_TYPE_BIGINT, TWO_STAGE_COMP,
&writer->config->aBuf[0], 0, &size, &writer->config->aBuf[1]);
TSDB_CHECK_CODE(code, lino, _exit);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册