Skip to content

Commit

Permalink
resolve the review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
luyade committed May 9, 2023
1 parent dc37c98 commit 8beae53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/kvstore/NebulaStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ void NebulaStore::loadPartFromDataPath() {
continue;
}

enginesPath.emplace_back(rootPath + dir);
futures.emplace_back(asyncNewEngine(spaceId, path, options_.walPath_));
enginesPath.emplace_back(rootPath + "/" + dir);
futures.emplace_back(newEngineAsync(spaceId, path, options_.walPath_));
}
}

Expand All @@ -119,7 +119,8 @@ void NebulaStore::loadPartFromDataPath() {
}
spaceIt->second.emplace_back(std::move(p.second));
} else {
LOG(FATAL) << "Invalid data directory \"" << enginesPath[index] << "\"";
LOG(FATAL) << "Invalid data directory \"" << enginesPath[index] << "\", exception: "
<< t.exception().what();
}
++index;
}
Expand Down Expand Up @@ -350,7 +351,7 @@ void NebulaStore::stop() {
}
}

folly::Future<std::pair<GraphSpaceID, std::unique_ptr<KVEngine>>> NebulaStore::asyncNewEngine(
folly::Future<std::pair<GraphSpaceID, std::unique_ptr<KVEngine>>> NebulaStore::newEngineAsync(
GraphSpaceID spaceId, const std::string& dataPath, const std::string& walPath) {
return folly::via(folly::getGlobalIOExecutor().get(), [this, spaceId, dataPath, walPath]() {
std::unique_ptr<KVEngine> engine;
Expand All @@ -372,7 +373,7 @@ folly::Future<std::pair<GraphSpaceID, std::unique_ptr<KVEngine>>> NebulaStore::a
std::unique_ptr<KVEngine> NebulaStore::newEngine(GraphSpaceID spaceId,
const std::string& dataPath,
const std::string& walPath) {
auto pair = this->asyncNewEngine(spaceId, dataPath, walPath).get();
auto pair = this->newEngineAsync(spaceId, dataPath, walPath).get();
return std::move(pair.second);
}

Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/NebulaStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ class NebulaStore : public KVStore, public Handler {
* @param walPath
* @return folly::Future<std::pair<GraphSpaceID, std::unique_ptr<KVEngine>>>
*/
folly::Future<std::pair<GraphSpaceID, std::unique_ptr<KVEngine>>> asyncNewEngine(
folly::Future<std::pair<GraphSpaceID, std::unique_ptr<KVEngine>>> newEngineAsync(
GraphSpaceID spaceId, const std::string& dataPath, const std::string& walPath);

/**
Expand Down

0 comments on commit 8beae53

Please sign in to comment.