more
This commit is contained in:
parent
c56ab19553
commit
02837954d0
|
@ -47,12 +47,12 @@ struct STsdb {
|
||||||
STsdbMemTable * imem;
|
STsdbMemTable * imem;
|
||||||
SRtn rtn;
|
SRtn rtn;
|
||||||
SMemAllocatorFactory *pmaf;
|
SMemAllocatorFactory *pmaf;
|
||||||
STsdbFS fs;
|
STsdbFS * fs;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define REPO_ID(r) 0
|
#define REPO_ID(r) 0
|
||||||
#define REPO_CFG(r) (&(r)->config)
|
#define REPO_CFG(r) (&(r)->config)
|
||||||
#define REPO_FS(r) (&(r)->fs)
|
#define REPO_FS(r) (r)->fs
|
||||||
|
|
||||||
static FORCE_INLINE STSchema *tsdbGetTableSchemaImpl(STable *pTable, bool lock, bool copy, int32_t version) {
|
static FORCE_INLINE STSchema *tsdbGetTableSchemaImpl(STable *pTable, bool lock, bool copy, int32_t version) {
|
||||||
return pTable->pSchema;
|
return pTable->pSchema;
|
||||||
|
|
|
@ -1287,7 +1287,7 @@ static int tsdbRestoreCurrent(STsdb *pRepo) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tsdbSaveFSStatus(pRepo->fs.cstatus, REPO_ID(pRepo)) < 0) {
|
if (tsdbSaveFSStatus(pRepo->fs->cstatus, REPO_ID(pRepo)) < 0) {
|
||||||
tsdbError("vgId:%d failed to restore corrent since %s", REPO_ID(pRepo), tstrerror(terrno));
|
tsdbError("vgId:%d failed to restore corrent since %s", REPO_ID(pRepo), tstrerror(terrno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,22 +75,27 @@ static STsdb *tsdbNew(const char *path, const STsdbCfg *pTsdbCfg, SMemAllocatorF
|
||||||
tsdbOptionsCopy(&(pTsdb->config), pTsdbCfg);
|
tsdbOptionsCopy(&(pTsdb->config), pTsdbCfg);
|
||||||
pTsdb->pmaf = pMAF;
|
pTsdb->pmaf = pMAF;
|
||||||
|
|
||||||
|
pTsdb->fs = tsdbNewFS(pTsdbCfg);
|
||||||
|
|
||||||
return pTsdb;
|
return pTsdb;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tsdbFree(STsdb *pTsdb) {
|
static void tsdbFree(STsdb *pTsdb) {
|
||||||
if (pTsdb) {
|
if (pTsdb) {
|
||||||
|
tsdbFreeFS(pTsdb->fs);
|
||||||
tfree(pTsdb->path);
|
tfree(pTsdb->path);
|
||||||
free(pTsdb);
|
free(pTsdb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tsdbOpenImpl(STsdb *pTsdb) {
|
static int tsdbOpenImpl(STsdb *pTsdb) {
|
||||||
|
tsdbOpenFS(pTsdb);
|
||||||
// TODO
|
// TODO
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tsdbCloseImpl(STsdb *pTsdb) {
|
static void tsdbCloseImpl(STsdb *pTsdb) {
|
||||||
|
tsdbCloseFS(pTsdb);
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -112,8 +117,8 @@ static void tsdbCloseImpl(STsdb *pTsdb) {
|
||||||
// no test file errors here
|
// no test file errors here
|
||||||
#include "taosdef.h"
|
#include "taosdef.h"
|
||||||
#include "tsdbint.h"
|
#include "tsdbint.h"
|
||||||
#include "ttimer.h"
|
|
||||||
#include "tthread.h"
|
#include "tthread.h"
|
||||||
|
#include "ttimer.h"
|
||||||
|
|
||||||
#define IS_VALID_PRECISION(precision) \
|
#define IS_VALID_PRECISION(precision) \
|
||||||
(((precision) >= TSDB_TIME_PRECISION_MILLI) && ((precision) <= TSDB_TIME_PRECISION_NANO))
|
(((precision) >= TSDB_TIME_PRECISION_MILLI) && ((precision) <= TSDB_TIME_PRECISION_NANO))
|
||||||
|
|
Loading…
Reference in New Issue