more
This commit is contained in:
parent
42fc423684
commit
9f0c01510e
|
@ -35,25 +35,6 @@ typedef struct {
|
|||
char data[];
|
||||
} SSubmitBlock;
|
||||
|
||||
// Retention policy.
|
||||
typedef struct {
|
||||
// TODO: Need a more fancy description
|
||||
int32_t keep1;
|
||||
int32_t keep2;
|
||||
int32_t keep3;
|
||||
} SRetentionPolicy;
|
||||
|
||||
// Data sharding policy.
|
||||
typedef struct {
|
||||
// TODO: Need a more fancy description
|
||||
int32_t daysPerFile;
|
||||
} SDataShardPolicy;
|
||||
|
||||
// Rows in file block policy
|
||||
typedef struct {
|
||||
// TODO: Need a more fancy description
|
||||
} SBlockRowsPolicy;
|
||||
|
||||
// the TSDB repository configuration
|
||||
typedef struct {
|
||||
char * rootDir; // TSDB repository root directory, TODO: need to adjust here
|
||||
|
@ -62,7 +43,8 @@ typedef struct {
|
|||
int32_t daysPerFile; // day per file sharding policy
|
||||
int32_t minRowsPerFileBlock; // minimum rows per file block
|
||||
int32_t maxRowsPerFileBlock; // maximum rows per file block
|
||||
int32_t keep; // Day of data to keep
|
||||
int32_t keep; // day of data to keep
|
||||
int64_t maxCacheSize; // maximum cache size this TSDB can use
|
||||
void * cachePool; // the cache pool the repository to use
|
||||
} STsdbCfg;
|
||||
|
||||
|
|
|
@ -46,24 +46,6 @@ typedef struct _tsdb_repo {
|
|||
#define TSDB_IS_REPO_ACTIVE(pRepo) ((pRepo)->state == TSDB_REPO_STATE_ACTIVE)
|
||||
#define TSDB_IS_REPO_CLOSED(pRepo) ((pRepo)->state == TSDB_REPO_STATE_CLOSED)
|
||||
|
||||
// Check the correctness of the TSDB configuration
|
||||
static int32_t tsdbCheckCfg(STsdbCfg *pCfg) {
|
||||
if (pCfg->rootDir == NULL) return -1;
|
||||
|
||||
if (access(pCfg->rootDir, F_OK|R_OK|W_OK) == -1) {
|
||||
return -1;
|
||||
}
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t tsdbCreateFiles(STsdbRepo *pRepo) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
static int32_t tsdbClearFiles(STsdbRepo *pRepo) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
tsdb_repo_t *tsdbCreateRepo(STsdbCfg *pCfg) {
|
||||
|
||||
|
@ -202,3 +184,22 @@ STableInfo *tsdbGetTableInfo(tsdb_repo_t *pRepo, STableId tid, int32_t *error) {
|
|||
int32_t tsdbInsertData(tsdb_repo_t *pRepo, STableId tid, char *pData, int32_t *error) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
// Check the correctness of the TSDB configuration
|
||||
static int32_t tsdbCheckCfg(STsdbCfg *pCfg) {
|
||||
if (pCfg->rootDir == NULL) return -1;
|
||||
|
||||
if (access(pCfg->rootDir, F_OK|R_OK|W_OK) == -1) {
|
||||
return -1;
|
||||
}
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t tsdbCreateFiles(STsdbRepo *pRepo) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
static int32_t tsdbClearFiles(STsdbRepo *pRepo) {
|
||||
// TODO
|
||||
}
|
Loading…
Reference in New Issue