diff --git a/source/dnode/vnode/impl/src/vnodeMain.c b/source/dnode/vnode/impl/src/vnodeMain.c index 493edbb77c984b098b14a42638f39490c7d8ca26..a0c1d38ea9330a8b652bc27c82936bffb925134a 100644 --- a/source/dnode/vnode/impl/src/vnodeMain.c +++ b/source/dnode/vnode/impl/src/vnodeMain.c @@ -89,14 +89,16 @@ static int vnodeOpenImpl(SVnode *pVnode) { // Open meta sprintf(dir, "%s/meta", pVnode->path); - if (metaOpen(dir, &(pVnode->options.metaOptions)) < 0) { + pVnode->pMeta = metaOpen(dir, &(pVnode->options.metaOptions)); + if (pVnode->pMeta == NULL) { // TODO: handle error return -1; } // Open tsdb sprintf(dir, "%s/tsdb", pVnode->path); - if (tsdbOpen(dir, &(pVnode->options.tsdbOptions)) < 0) { + pVnode->pTsdb = tsdbOpen(dir, &(pVnode->options.tsdbOptions)); + if (pVnode->pTsdb == NULL) { // TODO: handle error return -1; } diff --git a/source/dnode/vnode/meta/src/metaDB.c b/source/dnode/vnode/meta/src/metaDB.c index e4c9d8ce9786ce0259298030c17c826c658c0fae..8865678508ddd843f4708e50d2fbea4a0e4213db 100644 --- a/source/dnode/vnode/meta/src/metaDB.c +++ b/source/dnode/vnode/meta/src/metaDB.c @@ -32,14 +32,10 @@ static int metaSaveMapDB(SMeta *pMeta, tb_uid_t suid, tb_uid_t uid); } while (0) int metaOpenDB(SMeta *pMeta) { - char dbDir[128]; char dir[128]; char * err = NULL; rocksdb_options_t *options = rocksdb_options_create(); - // TODO - sprintf(dbDir, "%s/db", pMeta->path); - if (pMeta->pCache) { rocksdb_options_set_row_cache(options, pMeta->pCache); } @@ -53,23 +49,23 @@ int metaOpenDB(SMeta *pMeta) { } // tbDb - sprintf(dir, "%s/tb_db", dbDir); + sprintf(dir, "%s/tb_db", pMeta->path); META_OPEN_DB_IMPL(pMeta->pDB->tbDb, options, dir, err); // nameDb - sprintf(dir, "%s/name_db", dbDir); + sprintf(dir, "%s/name_db", pMeta->path); META_OPEN_DB_IMPL(pMeta->pDB->nameDb, options, dir, err); // tagDb - sprintf(dir, "%s/tag_db", dbDir); + sprintf(dir, "%s/tag_db", pMeta->path); META_OPEN_DB_IMPL(pMeta->pDB->tagDb, options, dir, err); // schemaDb - sprintf(dir, "%s/schema_db", dbDir); + sprintf(dir, "%s/schema_db", pMeta->path); META_OPEN_DB_IMPL(pMeta->pDB->schemaDb, options, dir, err); // mapDb - sprintf(dir, "%s/map_db", dbDir); + sprintf(dir, "%s/map_db", pMeta->path); META_OPEN_DB_IMPL(pMeta->pDB->mapDb, options, dir, err); rocksdb_options_destroy(options);