refact: tidy up declarations of funcs in tsdbUpgrade.c
This commit is contained in:
parent
ed6d7c4c4d
commit
399afe1094
|
@ -263,6 +263,7 @@ int32_t tsdbFSRollback(STsdb *pTsdb);
|
|||
int32_t tsdbFSPrepareCommit(STsdb *pTsdb, STsdbFS *pFS);
|
||||
int32_t tsdbFSRef(STsdb *pTsdb, STsdbFS *pFS);
|
||||
void tsdbFSUnref(STsdb *pTsdb, STsdbFS *pFS);
|
||||
void tsdbGetCurrentFName(STsdb *pTsdb, char *current, char *current_t);
|
||||
|
||||
int32_t tsdbFSUpsertFSet(STsdbFS *pFS, SDFileSet *pSet);
|
||||
int32_t tsdbFSUpsertDelFile(STsdbFS *pFS, SDelFile *pDelFile);
|
||||
|
|
|
@ -97,11 +97,18 @@ int32_t tsdbDataFileWriteRow(SDataFileWriter *writer, SRowInfo *row);
|
|||
int32_t tsdbDataFileWriteBlockData(SDataFileWriter *writer, SBlockData *bData);
|
||||
int32_t tsdbDataFileFlush(SDataFileWriter *writer);
|
||||
|
||||
// head
|
||||
int32_t tsdbFileWriteBrinBlock(STsdbFD *fd, SBrinBlock *brinBlock, int8_t cmprAlg, int64_t *fileSize,
|
||||
TBrinBlkArray *brinBlkArray, uint8_t **bufArr, SVersionRange *range);
|
||||
int32_t tsdbFileWriteBrinBlk(STsdbFD *fd, TBrinBlkArray *brinBlkArray, SFDataPtr *ptr, int64_t *fileSize);
|
||||
int32_t tsdbFileWriteHeadFooter(STsdbFD *fd, int64_t *fileSize, const SHeadFooter *footer);
|
||||
|
||||
// tomb
|
||||
int32_t tsdbDataFileWriteTombRecord(SDataFileWriter *writer, const STombRecord *record);
|
||||
int32_t tsdbFileWriteTombBlock(STsdbFD *fd, STombBlock *tombBlock, int8_t cmprAlg, int64_t *fileSize,
|
||||
TTombBlkArray *tombBlkArray, uint8_t **bufArr, SVersionRange *range);
|
||||
int32_t tsdbFileWriteTombBlk(STsdbFD *fd, const TTombBlkArray *tombBlkArray, SFDataPtr *ptr, int64_t *fileSize);
|
||||
int32_t tsdbFileWriteTombFooter(STsdbFD *fd, const STombFooter *footer, int64_t *fileSize);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -72,6 +72,9 @@ int32_t tsdbFSEnableBgTask(STFileSystem *fs);
|
|||
// other
|
||||
int32_t tsdbFSGetFSet(STFileSystem *fs, int32_t fid, STFileSet **fset);
|
||||
int32_t tsdbFSCheckCommit(STFileSystem *fs);
|
||||
// utils
|
||||
int32_t save_fs(const TFileSetArray *arr, const char *fname);
|
||||
int32_t current_fname(STsdb *pTsdb, char *fname, EFCurrentT ftype);
|
||||
|
||||
struct STFSBgTask {
|
||||
EFSBgTaskT type;
|
||||
|
|
|
@ -63,6 +63,9 @@ int64_t tsdbTFileSetMaxCid(const STFileSet *fset);
|
|||
SSttLvl *tsdbTFileSetGetSttLvl(STFileSet *fset, int32_t level);
|
||||
// is empty
|
||||
bool tsdbTFileSetIsEmpty(const STFileSet *fset);
|
||||
// stt
|
||||
int32_t tsdbSttLvlInit(int32_t level, SSttLvl **lvl);
|
||||
int32_t tsdbSttLvlClear(SSttLvl **lvl);
|
||||
|
||||
struct STFileOp {
|
||||
tsdb_fop_t optype;
|
||||
|
|
|
@ -71,6 +71,9 @@ int32_t tsdbSttFileWriteBlockData(SSttFileWriter *writer, SBlockData *pBlockData
|
|||
int32_t tsdbSttFileWriteTombRecord(SSttFileWriter *writer, const STombRecord *record);
|
||||
bool tsdbSttFileWriterIsOpened(SSttFileWriter *writer);
|
||||
|
||||
int32_t tsdbFileWriteSttBlk(STsdbFD *fd, const TSttBlkArray *sttBlkArray, SFDataPtr *ptr, int64_t *fileSize);
|
||||
int32_t tsdbFileWriteSttFooter(STsdbFD *fd, const SSttFooter *footer, int64_t *fileSize);
|
||||
|
||||
struct SSttFileWriterConfig {
|
||||
STsdb *tsdb;
|
||||
int32_t maxRow;
|
||||
|
|
|
@ -16,23 +16,15 @@
|
|||
#include "tsdbUpgrade.h"
|
||||
|
||||
// old
|
||||
extern void tsdbGetCurrentFName(STsdb *pTsdb, char *current, char *current_t);
|
||||
extern int32_t tsdbReadDataBlockEx(SDataFReader *pReader, SDataBlk *pDataBlk, SBlockData *pBlockData);
|
||||
#include "tsdb.h"
|
||||
// extern void tsdbGetCurrentFName(STsdb *pTsdb, char *current, char *current_t);
|
||||
|
||||
// new
|
||||
#include "tsdbDataFileRW.h"
|
||||
#include "tsdbFS2.h"
|
||||
#include "tsdbSttFileRW.h"
|
||||
extern int32_t save_fs(const TFileSetArray *arr, const char *fname);
|
||||
extern int32_t current_fname(STsdb *pTsdb, char *fname, EFCurrentT ftype);
|
||||
extern int32_t tsdbFileWriteBrinBlock(STsdbFD *fd, SBrinBlock *brinBlock, int8_t cmprAlg, int64_t *fileSize,
|
||||
TBrinBlkArray *brinBlkArray, uint8_t **bufArr, SVersionRange *range);
|
||||
extern int32_t tsdbFileWriteBrinBlk(STsdbFD *fd, TBrinBlkArray *brinBlkArray, SFDataPtr *ptr, int64_t *fileSize);
|
||||
extern int32_t tsdbFileWriteHeadFooter(STsdbFD *fd, int64_t *fileSize, const SHeadFooter *footer);
|
||||
extern int32_t tsdbSttLvlInit(int32_t level, SSttLvl **lvl);
|
||||
extern int32_t tsdbSttLvlClear(SSttLvl **lvl);
|
||||
extern int32_t tsdbFileWriteSttBlk(STsdbFD *fd, const TSttBlkArray *sttBlkArray, SFDataPtr *ptr, int64_t *fileSize);
|
||||
extern int32_t tsdbFileWriteSttFooter(STsdbFD *fd, const SSttFooter *footer, int64_t *fileSize);
|
||||
extern int32_t tsdbFileWriteTombFooter(STsdbFD *fd, const STombFooter *footer, int64_t *fileSize);
|
||||
// extern int32_t save_fs(const TFileSetArray *arr, const char *fname);
|
||||
// extern int32_t current_fname(STsdb *pTsdb, char *fname, EFCurrentT ftype);
|
||||
|
||||
static int32_t tsdbUpgradeHead(STsdb *tsdb, SDFileSet *pDFileSet, SDataFReader *reader, STFileSet *fset) {
|
||||
int32_t code = 0;
|
||||
|
|
Loading…
Reference in New Issue