提交 4cb4c638 编写于 作者: H Hongze Cheng

more code

上级 f5286359
......@@ -43,6 +43,8 @@ typedef void (*TArray2Cb)(void *);
#define TARRAY2_INITIALIZER \
{ 0, 0, NULL }
#define TARRAY2_SIZE(a) ((a)->size)
#define TARRAY2_CAPACITY(a) ((a)->capacity)
#define TARRAY2_DATA(a) ((a)->data)
#define TARRAY2_GET(a, i) ((a)->data[i])
#define TARRAY2_GET_PTR(a, i) (&((a)->data[i]))
#define TARRAY2_FIRST(a) ((a)->data[0])
......
......@@ -57,8 +57,8 @@ SSttLvl *tsdbTFileSetGetLvl(STFileSet *fset, int32_t level);
bool tsdbTFileSetIsEmpty(const STFileSet *fset);
struct STFileOp {
int32_t fid;
tsdb_fop_t optype;
int32_t fid;
STFile of; // old file state
STFile nf; // new file state
};
......
......@@ -22,6 +22,8 @@
extern "C" {
#endif
typedef TARRAY2(SSttBlk) TSttBlkArray;
// SSttFileReader ==========================================
typedef struct SSttFSegReader SSttFSegReader;
typedef struct SSttFileReader SSttFileReader;
......@@ -54,19 +56,20 @@ struct SSttFileReaderConfig {
typedef struct SSttFileWriter SSttFileWriter;
typedef struct SSttFileWriterConfig SSttFileWriterConfig;
int32_t tsdbSttFWriterOpen(const SSttFileWriterConfig *config, SSttFileWriter **ppWriter);
int32_t tsdbSttFWriterClose(SSttFileWriter **ppWriter, int8_t abort, struct STFileOp *op);
int32_t tsdbSttFWriteTSData(SSttFileWriter *pWriter, SRowInfo *pRowInfo);
int32_t tsdbSttFWriteTSDataBlock(SSttFileWriter *pWriter, SBlockData *pBlockData);
int32_t tsdbSttFWriteDLData(SSttFileWriter *pWriter, TABLEID *tbid, SDelData *pDelData);
int32_t tsdbSttFWriterOpen(const SSttFileWriterConfig *config, SSttFileWriter **writer);
int32_t tsdbSttFWriterClose(SSttFileWriter **writer, int8_t abort, STFileOp *op);
int32_t tsdbSttFWriteTSData(SSttFileWriter *writer, SRowInfo *pRowInfo);
int32_t tsdbSttFWriteTSDataBlock(SSttFileWriter *writer, SBlockData *pBlockData);
int32_t tsdbSttFWriteDLData(SSttFileWriter *writer, TABLEID *tbid, SDelData *pDelData);
struct SSttFileWriterConfig {
STsdb *pTsdb;
STsdb *tsdb;
int32_t maxRow;
int32_t szPage;
int8_t cmprAlg;
SSkmInfo *pSkmTb;
SSkmInfo *pSkmRow;
int64_t compVer; // compact version
SSkmInfo *skmTb;
SSkmInfo *skmRow;
uint8_t **aBuf;
STFile file;
};
......
......@@ -58,12 +58,12 @@ static int32_t open_writer_with_new_stt(SCommitter *pCommitter) {
TSDB_CHECK_CODE(code, lino, _exit);
}
config.pTsdb = pTsdb;
config.tsdb = pTsdb;
config.maxRow = pCommitter->maxRow;
config.szPage = pVnode->config.tsdbPageSize;
config.cmprAlg = pCommitter->cmprAlg;
config.pSkmTb = NULL;
config.pSkmRow = NULL;
config.skmTb = NULL;
config.skmRow = NULL;
config.aBuf = NULL;
config.file.type = TSDB_FTYPE_STT;
config.file.did = did;
......@@ -93,12 +93,12 @@ static int32_t open_writer_with_exist_stt(SCommitter *pCommitter, const STFile *
SSttFileWriterConfig config = {
//
.pTsdb = pTsdb,
.tsdb = pTsdb,
.maxRow = pCommitter->maxRow,
.szPage = pVnode->config.tsdbPageSize,
.cmprAlg = pCommitter->cmprAlg,
.pSkmTb = NULL,
.pSkmRow = NULL,
.skmTb = NULL,
.skmRow = NULL,
.aBuf = NULL,
.file = *pFile //
};
......
......@@ -222,12 +222,12 @@ static int32_t tsdbMergeFileSetBegin(SMerger *merger) {
// open stt file writer
if (lvl) {
SSttFileWriterConfig config = {
.pTsdb = merger->tsdb,
.tsdb = merger->tsdb,
.maxRow = merger->maxRow,
.szPage = merger->szPage,
.cmprAlg = merger->cmprAlg,
.pSkmTb = &merger->skmTb,
.pSkmRow = &merger->skmRow,
.skmTb = &merger->skmTb,
.skmRow = &merger->skmRow,
.aBuf = merger->aBuf,
.file = fobj->f,
};
......@@ -235,12 +235,12 @@ static int32_t tsdbMergeFileSetBegin(SMerger *merger) {
TSDB_CHECK_CODE(code, lino, _exit);
} else {
SSttFileWriterConfig config = {
.pTsdb = merger->tsdb,
.tsdb = merger->tsdb,
.maxRow = merger->maxRow,
.szPage = merger->szPage,
.cmprAlg = merger->cmprAlg,
.pSkmTb = &merger->skmTb,
.pSkmRow = &merger->skmRow,
.skmTb = &merger->skmTb,
.skmRow = &merger->skmRow,
.aBuf = merger->aBuf,
.file =
(STFile){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册