more work

This commit is contained in:
Hongze Cheng 2022-06-13 11:54:50 +00:00
parent baea84c6bf
commit c000c15e58
3 changed files with 43 additions and 19 deletions

View File

@ -177,6 +177,11 @@ struct SColData {
uint8_t *pData;
};
struct SColDataBatch {
uint8_t flags;
SColData *aColData[];
};
#if 1 //================================================================================================================================================
// Imported since 3.0 and use bitmap to demonstrate None/Null/Norm, while use Null/Norm below 3.0 without of bitmap.
#define TD_SUPPORT_BITMAP

View File

@ -46,6 +46,7 @@ typedef struct SMergeInfo SMergeInfo;
typedef struct STable STable;
typedef struct SOffset SOffset;
typedef struct SMapData SMapData;
typedef struct SVDataCols SVDataCols;
// tsdbMemTable ==============================================================================================
@ -127,18 +128,18 @@ typedef struct SDFileSetReader SDFileSetReader;
typedef struct SDFileSetWriter SDFileSetWriter;
// SDFileSetWriter
int32_t tsdbDFileSetWriterOpen(SDFileSetWriter *pWriter, STsdb *pTsdb, SDFileSet *pSet);
int32_t tsdbDFileSetWriterClose(SDFileSetWriter *pWriter, int8_t sync);
int32_t tsdbWriteBlockData(SDFileSetWriter *pWriter, SDataCols *pDataCols, SBlock *pBlock);
int32_t tsdbWriteSBlockInfo(SDFileSetWriter *pWriter, SBlockInfo *pBlockInfo, SBlockIdx *pBlockIdx);
int32_t tsdbWriteSBlockIdx(SDFileSetWriter *pWriter, SBlockIdx *pBlockIdx);
// int32_t tsdbDFileSetWriterOpen(SDFileSetWriter *pWriter, STsdb *pTsdb, SDFileSet *pSet);
// int32_t tsdbDFileSetWriterClose(SDFileSetWriter *pWriter, int8_t sync);
// int32_t tsdbWriteBlockData(SDFileSetWriter *pWriter, SDataCols *pDataCols, SBlock *pBlock);
// int32_t tsdbWriteSBlockInfo(SDFileSetWriter *pWriter, SBlockInfo *pBlockInfo, SBlockIdx *pBlockIdx);
// int32_t tsdbWriteSBlockIdx(SDFileSetWriter *pWriter, SBlockIdx *pBlockIdx);
// SDFileSetReader
int32_t tsdbDFileSetReaderOpen(SDFileSetReader *pReader, STsdb *pTsdb, SDFileSet *pSet);
int32_t tsdbDFileSetReaderClose(SDFileSetReader *pReader);
int32_t tsdbLoadSBlockIdx(SDFileSetReader *pReader, SArray *pArray);
int32_t tsdbLoadSBlockInfo(SDFileSetReader *pReader, SBlockIdx *pBlockIdx, SBlockInfo *pBlockInfo);
int32_t tsdbLoadSBlockStatis(SDFileSetReader *pReader, SBlock *pBlock, SBlockStatis *pBlockStatis);
// int32_t tsdbDFileSetReaderOpen(SDFileSetReader *pReader, STsdb *pTsdb, SDFileSet *pSet);
// int32_t tsdbDFileSetReaderClose(SDFileSetReader *pReader);
// int32_t tsdbLoadSBlockIdx(SDFileSetReader *pReader, SArray *pArray);
// int32_t tsdbLoadSBlockInfo(SDFileSetReader *pReader, SBlockIdx *pBlockIdx, SBlockInfo *pBlockInfo);
// int32_t tsdbLoadSBlockStatis(SDFileSetReader *pReader, SBlock *pBlock, SBlockStatis *pBlockStatis);
// SDelFWriter
@ -306,13 +307,24 @@ struct SBlockItem {
int64_t maxVersion;
};
struct SBlockInfo {
uint8_t flags;
int32_t nCols;
int64_t offset;
int64_t size;
int32_t nSmaCols;
int64_t smaOffset;
int64_t smaSize;
};
struct SBlock {
uint32_t delimiter;
int64_t suid;
int64_t uid;
SOffset offset;
uint32_t nData;
uint8_t *pData;
TSDBKEY minKey;
TSDBKEY maxKey;
int64_t minVersion;
int64_t maxVersion;
int32_t nRows;
int8_t nBlockInfo;
SBlockInfo blockInfos[];
};
struct SBlockCol {
@ -436,6 +448,11 @@ struct SMapData {
uint8_t *pData;
};
struct SVDataCols {
int64_t *aVersion;
SDataCols dataCols;
};
#ifdef __cplusplus
}
#endif

View File

@ -37,9 +37,11 @@ struct SCommitter {
SMapData oBlockIdx;
SMapData nBlockIdx;
// commit table data
SBlockIdx *pBlockIdx;
SMapData oBlock;
SMapData nBlock;
SBlockIdx *pBlockIdx;
SMapData oBlock;
SMapData nBlock;
SColDataBatch oBatch;
SColDataBatch nBatch;
/* commit del */
SDelFReader *pDelFReader;
SDelFWriter *pDelFWriter;