提交 dc10b019 编写于 作者: H Hongze Cheng

more code

上级 03fe43db
...@@ -42,7 +42,6 @@ static int32_t tsdbCommitOpenWriter(SCommitter *pCommitter) { ...@@ -42,7 +42,6 @@ static int32_t tsdbCommitOpenWriter(SCommitter *pCommitter) {
struct SSttFWriterConf conf = { struct SSttFWriterConf conf = {
.pTsdb = pCommitter->pTsdb, .pTsdb = pCommitter->pTsdb,
.file = {0},
.pSkmTb = NULL, .pSkmTb = NULL,
.pSkmRow = NULL, .pSkmRow = NULL,
.maxRow = pCommitter->maxRow, .maxRow = pCommitter->maxRow,
...@@ -51,7 +50,21 @@ static int32_t tsdbCommitOpenWriter(SCommitter *pCommitter) { ...@@ -51,7 +50,21 @@ static int32_t tsdbCommitOpenWriter(SCommitter *pCommitter) {
.aBuf = NULL, .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); code = tsdbSttFWriterOpen(&conf, &pCommitter->pWriter);
TSDB_CHECK_CODE(code, lino, _exit); TSDB_CHECK_CODE(code, lino, _exit);
......
...@@ -15,12 +15,6 @@ ...@@ -15,12 +15,6 @@
#include "dev.h" #include "dev.h"
struct STFileSystem {
STsdb *pTsdb;
int32_t nFileSet;
struct SFileSet *aFileSet;
};
static int32_t create_file_system(STsdb *pTsdb, struct STFileSystem **ppFS) { static int32_t create_file_system(STsdb *pTsdb, struct STFileSystem **ppFS) {
ppFS[0] = taosMemoryCalloc(1, sizeof(*ppFS[0])); ppFS[0] = taosMemoryCalloc(1, sizeof(*ppFS[0]));
if (ppFS[0] == NULL) return TSDB_CODE_OUT_OF_MEMORY; 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 ...@@ -30,6 +30,11 @@ int32_t tsdbOpenFileSystem(STsdb *pTsdb, struct STFileSystem **ppFS, int8_t roll
int32_t tsdbCloseFileSystem(struct STFileSystem **ppFS); int32_t tsdbCloseFileSystem(struct STFileSystem **ppFS);
/* Exposed Structs */ /* Exposed Structs */
struct STFileSystem {
STsdb *pTsdb;
int32_t nFileSet;
struct SFileSet *aFileSet;
};
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -14,8 +14,3 @@ ...@@ -14,8 +14,3 @@
*/ */
#include "dev.h" #include "dev.h"
struct SFileSet {
struct STFile *files[TSDB_FTYPE_MAX];
SRBTree fsttTree;
};
\ No newline at end of file
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#ifndef _TSDB_FILE_SET_H #ifndef _TSDB_FILE_SET_H
#define _TSDB_FILE_SET_H #define _TSDB_FILE_SET_H
#include "tsdb.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -26,6 +28,12 @@ struct SFileSet; ...@@ -26,6 +28,12 @@ struct SFileSet;
/* Exposed APIs */ /* Exposed APIs */
/* Exposed Structs */ /* Exposed Structs */
struct SFileSet {
int32_t fid;
int64_t nextid;
struct STFile *files[TSDB_FTYPE_MAX];
SRBTree fsttTree;
};
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -34,4 +34,15 @@ struct SFileOp { ...@@ -34,4 +34,15 @@ struct SFileOp {
struct { struct {
} create; } create;
}; };
}; };
\ No newline at end of file
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;
}
\ No newline at end of file
...@@ -36,6 +36,8 @@ typedef enum { ...@@ -36,6 +36,8 @@ typedef enum {
} tsdb_ftype_t; } tsdb_ftype_t;
/* Exposed APIs */ /* Exposed APIs */
int32_t tsdbTFileInit(STsdb *pTsdb, struct STFile *pFile);
int32_t tsdbTFileClear(struct STFile *pFile);
/* Exposed Structs */ /* Exposed Structs */
struct FStt { struct FStt {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册