TD-353
This commit is contained in:
parent
cca6f87a38
commit
4e77ffd283
|
@ -77,7 +77,7 @@ typedef void TSDB_REPO_T; // use void to hide implementation details from outsi
|
||||||
STsdbCfg *tsdbGetCfg(const TSDB_REPO_T *repo);
|
STsdbCfg *tsdbGetCfg(const TSDB_REPO_T *repo);
|
||||||
|
|
||||||
// --------- TSDB REPOSITORY DEFINITION
|
// --------- TSDB REPOSITORY DEFINITION
|
||||||
int tsdbCreateRepo(char *rootDir, STsdbCfg *pCfg, void *limiter);
|
int tsdbCreateRepo(char *rootDir, STsdbCfg *pCfg);
|
||||||
int32_t tsdbDropRepo(TSDB_REPO_T *repo);
|
int32_t tsdbDropRepo(TSDB_REPO_T *repo);
|
||||||
TSDB_REPO_T *tsdbOpenRepo(char *rootDir, STsdbAppH *pAppH);
|
TSDB_REPO_T *tsdbOpenRepo(char *rootDir, STsdbAppH *pAppH);
|
||||||
int32_t tsdbCloseRepo(TSDB_REPO_T *repo, int toCommit);
|
int32_t tsdbCloseRepo(TSDB_REPO_T *repo, int toCommit);
|
||||||
|
|
|
@ -91,7 +91,7 @@ STsdbCfg *tsdbGetCfg(const TSDB_REPO_T *repo) {
|
||||||
*
|
*
|
||||||
* @return a TSDB repository handle on success, NULL for failure
|
* @return a TSDB repository handle on success, NULL for failure
|
||||||
*/
|
*/
|
||||||
int32_t tsdbCreateRepo(char *rootDir, STsdbCfg *pCfg, void *limiter /* TODO */) {
|
int32_t tsdbCreateRepo(char *rootDir, STsdbCfg *pCfg) {
|
||||||
if (mkdir(rootDir, 0755) != 0) {
|
if (mkdir(rootDir, 0755) != 0) {
|
||||||
tsdbError("vgId:%d, failed to create rootDir! rootDir:%s, reason:%s", pCfg->tsdbId, rootDir, strerror(errno));
|
tsdbError("vgId:%d, failed to create rootDir! rootDir:%s, reason:%s", pCfg->tsdbId, rootDir, strerror(errno));
|
||||||
if (errno == EACCES) {
|
if (errno == EACCES) {
|
||||||
|
@ -117,7 +117,7 @@ int32_t tsdbCreateRepo(char *rootDir, STsdbCfg *pCfg, void *limiter /* TODO */)
|
||||||
|
|
||||||
pRepo->rootDir = strdup(rootDir);
|
pRepo->rootDir = strdup(rootDir);
|
||||||
pRepo->config = *pCfg;
|
pRepo->config = *pCfg;
|
||||||
pRepo->limiter = limiter;
|
// pRepo->limiter = limiter;
|
||||||
|
|
||||||
// Create the environment files and directories
|
// Create the environment files and directories
|
||||||
int32_t code = tsdbSetRepoEnv(pRepo);
|
int32_t code = tsdbSetRepoEnv(pRepo);
|
||||||
|
|
|
@ -123,7 +123,7 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) {
|
||||||
|
|
||||||
char tsdbDir[TSDB_FILENAME_LEN] = {0};
|
char tsdbDir[TSDB_FILENAME_LEN] = {0};
|
||||||
sprintf(tsdbDir, "%s/vnode%d/tsdb", tsVnodeDir, pVnodeCfg->cfg.vgId);
|
sprintf(tsdbDir, "%s/vnode%d/tsdb", tsVnodeDir, pVnodeCfg->cfg.vgId);
|
||||||
code = tsdbCreateRepo(tsdbDir, &tsdbCfg, NULL);
|
code = tsdbCreateRepo(tsdbDir, &tsdbCfg);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
vError("vgId:%d, failed to create tsdb in vnode, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code));
|
vError("vgId:%d, failed to create tsdb in vnode, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code));
|
||||||
return TSDB_CODE_VND_INIT_FAILED;
|
return TSDB_CODE_VND_INIT_FAILED;
|
||||||
|
|
Loading…
Reference in New Issue