more code

This commit is contained in:
Hongze Cheng 2023-04-23 14:02:43 +08:00
parent 2f91256a09
commit c336ec749a
6 changed files with 23 additions and 16 deletions

View File

@ -22,6 +22,17 @@
extern "C" {
#endif
typedef struct SFDataPtr {
int64_t offset;
int64_t size;
} SFDataPtr;
typedef struct {
int64_t prevFooter;
SFDataPtr dict[4]; // 0:bloom filter, 1:SSttBlk, 2:STbStatisBlk, 3:SDelBlk
uint8_t reserved[24];
} SFSttFooter;
#include "tsdbUtil.h"
#include "tsdbFile.h"

View File

@ -51,7 +51,7 @@ int32_t tsdbFileSetEdit(struct SFileSet *pSet, struct SFileOp *pOp) {
ppFile = &pSet->fTomb;
} break;
case TSDB_FTYPE_STT: {
ppFile = &pSet->lStt[0].fStt;
// ppFile = &pSet->lStt[0].fStt;
} break;
default: {
ASSERTS(0, "Invalid file type");

View File

@ -22,7 +22,7 @@
extern "C" {
#endif
typedef struct SSttLevel SSttLevel;
typedef struct SSttLvl SSttLvl;
typedef enum {
TSDB_FOP_EXTEND = -2,
@ -39,10 +39,10 @@ struct SFileOp {
struct STFile nState; // new file state
};
struct SSttLevel {
struct SSttLvl {
int32_t level;
int32_t nStt;
SSttLevel *pNext;
SSttLvl *pNext;
struct STFile *fSttList;
};
@ -53,7 +53,7 @@ struct SFileSet {
struct STFile *fData; // .data
struct STFile *fSma; // .sma
struct STFile *fTomb; // .tomb
SSttLevel *sttLevelList;
SSttLvl *sttLevelList;
};
int32_t tsdbFileSetCreate(int32_t fid, struct SFileSet **ppSet);

View File

@ -14,6 +14,13 @@
*/
#include "tsdbSttFReader.h"
#include "dev.h"
struct SSttFReader {
STsdb *pTsdb;
SFSttFooter footer;
const void *bloomFilter;
};
int32_t tsdbSttFReaderOpen(const struct SSttFReaderConf *pConf, struct SSttFReader **ppReader) {
int32_t code = 0;

View File

@ -21,12 +21,6 @@ extern int32_t tsdbWriteFile(STsdbFD *pFD, int64_t offset, const uint8_t *pBuf,
extern int32_t tsdbReadFile(STsdbFD *pFD, int64_t offset, uint8_t *pBuf, int64_t size);
extern int32_t tsdbFsyncFile(STsdbFD *pFD);
typedef struct {
int64_t prevFooter;
SFDataPtr dict[4]; // 0:bloom filter, 1:SSttBlk, 2:STbStatisBlk, 3:SDelBlk
uint8_t reserved[24];
} SFSttFooter;
struct SSttFWriter {
struct SSttFWriterConf config;
// file

View File

@ -26,11 +26,6 @@ extern "C" {
typedef struct SDelBlock SDelBlock;
typedef struct SDelBlk SDelBlk;
typedef struct SFDataPtr {
int64_t offset;
int64_t size;
} SFDataPtr;
int32_t tDelBlockCreate(SDelBlock *pDelBlock, int32_t capacity);
int32_t tDelBlockDestroy(SDelBlock *pDelBlock);
int32_t tDelBlockClear(SDelBlock *pDelBlock);