more code
This commit is contained in:
parent
03fe43dbe9
commit
dc10b0196e
|
@ -42,7 +42,6 @@ static int32_t tsdbCommitOpenWriter(SCommitter *pCommitter) {
|
|||
|
||||
struct SSttFWriterConf conf = {
|
||||
.pTsdb = pCommitter->pTsdb,
|
||||
.file = {0},
|
||||
.pSkmTb = NULL,
|
||||
.pSkmRow = NULL,
|
||||
.maxRow = pCommitter->maxRow,
|
||||
|
@ -51,7 +50,21 @@ static int32_t tsdbCommitOpenWriter(SCommitter *pCommitter) {
|
|||
.aBuf = NULL,
|
||||
};
|
||||
|
||||
// taosArraySearch(pCommitter->pTsdb);
|
||||
// pCommitter->pTsdb->pFS = NULL;
|
||||
// taosbsearch(pCommitter->pTsdb->pFS->aFileSet, &pCommitter->fid, tsdbCompareFid, &lino);
|
||||
struct SFileSet *pSet = NULL;
|
||||
if (pSet == NULL) {
|
||||
conf.file = (struct STFile){
|
||||
.cid = 1,
|
||||
.fid = pCommitter->fid,
|
||||
.diskId = (SDiskID){0},
|
||||
.type = TSDB_FTYPE_STT,
|
||||
};
|
||||
tsdbTFileInit(pCommitter->pTsdb, &conf.file);
|
||||
} else {
|
||||
// TODO
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
code = tsdbSttFWriterOpen(&conf, &pCommitter->pWriter);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
|
|
@ -15,12 +15,6 @@
|
|||
|
||||
#include "dev.h"
|
||||
|
||||
struct STFileSystem {
|
||||
STsdb *pTsdb;
|
||||
int32_t nFileSet;
|
||||
struct SFileSet *aFileSet;
|
||||
};
|
||||
|
||||
static int32_t create_file_system(STsdb *pTsdb, struct STFileSystem **ppFS) {
|
||||
ppFS[0] = taosMemoryCalloc(1, sizeof(*ppFS[0]));
|
||||
if (ppFS[0] == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
||||
|
|
|
@ -30,6 +30,11 @@ int32_t tsdbOpenFileSystem(STsdb *pTsdb, struct STFileSystem **ppFS, int8_t roll
|
|||
int32_t tsdbCloseFileSystem(struct STFileSystem **ppFS);
|
||||
|
||||
/* Exposed Structs */
|
||||
struct STFileSystem {
|
||||
STsdb *pTsdb;
|
||||
int32_t nFileSet;
|
||||
struct SFileSet *aFileSet;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -14,8 +14,3 @@
|
|||
*/
|
||||
|
||||
#include "dev.h"
|
||||
|
||||
struct SFileSet {
|
||||
struct STFile *files[TSDB_FTYPE_MAX];
|
||||
SRBTree fsttTree;
|
||||
};
|
|
@ -16,6 +16,8 @@
|
|||
#ifndef _TSDB_FILE_SET_H
|
||||
#define _TSDB_FILE_SET_H
|
||||
|
||||
#include "tsdb.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -26,6 +28,12 @@ struct SFileSet;
|
|||
/* Exposed APIs */
|
||||
|
||||
/* Exposed Structs */
|
||||
struct SFileSet {
|
||||
int32_t fid;
|
||||
int64_t nextid;
|
||||
struct STFile *files[TSDB_FTYPE_MAX];
|
||||
SRBTree fsttTree;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -34,4 +34,15 @@ struct SFileOp {
|
|||
struct {
|
||||
} create;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
int32_t tsdbTFileInit(STsdb *pTsdb, struct STFile *pFile) {
|
||||
snprintf(pFile->fname, TSDB_FILENAME_LEN, "%s", pTsdb->path);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t tsdbTFileClear(struct STFile *pFile) {
|
||||
int32_t code = 0;
|
||||
// TODO
|
||||
return code;
|
||||
}
|
|
@ -36,6 +36,8 @@ typedef enum {
|
|||
} tsdb_ftype_t;
|
||||
|
||||
/* Exposed APIs */
|
||||
int32_t tsdbTFileInit(STsdb *pTsdb, struct STFile *pFile);
|
||||
int32_t tsdbTFileClear(struct STFile *pFile);
|
||||
|
||||
/* Exposed Structs */
|
||||
struct FStt {
|
||||
|
|
Loading…
Reference in New Issue