Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some changes to avoid confusion #3339

Merged
merged 13 commits into from
Dec 15, 2021
8 changes: 4 additions & 4 deletions src/common/utils/MetaKeyUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,15 +877,15 @@ std::string MetaKeyUtils::idKey() { return kIdKey; }

std::string MetaKeyUtils::balanceTaskKey(
JobID jobId, GraphSpaceID spaceId, PartitionID partId, HostAddr src, HostAddr dst) {
std::string str;
str.reserve(64);
str.append(reinterpret_cast<const char*>(kBalanceTaskTable.data()), kBalanceTaskTable.size())
std::string key;
key.reserve(64);
key.append(reinterpret_cast<const char*>(kBalanceTaskTable.data()), kBalanceTaskTable.size())
.append(reinterpret_cast<const char*>(&jobId), sizeof(JobID))
.append(reinterpret_cast<const char*>(&spaceId), sizeof(GraphSpaceID))
.append(reinterpret_cast<const char*>(&partId), sizeof(PartitionID))
.append(serializeHostAddr(src))
.append(serializeHostAddr(dst));
return str;
return key;
}

std::string MetaKeyUtils::balanceTaskVal(BalanceTaskStatus status,
Expand Down
4 changes: 2 additions & 2 deletions src/storage/exec/RelNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class RelNode {

void addDependency(RelNode<T>* dep) {
dependencies_.emplace_back(dep);
dep->hasDependents_ = true;
dep->isDependent_ = true;
}

RelNode() = default;
Expand All @@ -81,7 +81,7 @@ class RelNode {

std::string name_ = "RelNode";
std::vector<RelNode<T>*> dependencies_;
bool hasDependents_ = false;
bool isDependent_ = false;
time::Duration duration_{true};
};

Expand Down
8 changes: 4 additions & 4 deletions src/storage/exec/StoragePlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ template <typename T>
class StoragePlan {
public:
nebula::cpp2::ErrorCode go(PartitionID partId, const T& input) {
// find all leaf nodes, and a dummy output node depends on all leaf node.
// find all nodes without dependents, and a dummy output node depends on all those nodes.
if (firstLoop_) {
auto output = std::make_unique<RelNode<T>>();
for (const auto& node : nodes_) {
if (!node->hasDependents_) {
if (!node->isDependent_) {
// add dependency of output node
output->addDependency(node.get());
}
Expand All @@ -54,11 +54,11 @@ class StoragePlan {
}

nebula::cpp2::ErrorCode go(PartitionID partId) {
// find all leaf nodes, and a dummy output node depends on all leaf node.
// find all nodes without dependents, and a dummy output node depends on all those nodes.
if (firstLoop_) {
auto output = std::make_unique<RelNode<T>>();
for (const auto& node : nodes_) {
if (!node->hasDependents_) {
if (!node->isDependent_) {
// add dependency of output node
output->addDependency(node.get());
}
Expand Down
6 changes: 3 additions & 3 deletions src/storage/test/StorageDAGBenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FutureNode {

void addDependency(FutureNode<T>* dep) {
dependencies_.emplace_back(dep);
dep->hasDependents_ = true;
dep->isDependent_ = true;
}

FutureNode() = default;
Expand All @@ -39,7 +39,7 @@ class FutureNode {
std::string name_;
folly::SharedPromise<nebula::cpp2::ErrorCode> promise_;
std::vector<FutureNode<T>*> dependencies_;
bool hasDependents_ = false;
bool isDependent_ = false;
};

template <typename T>
Expand All @@ -56,7 +56,7 @@ class FutureDAG {
// add dependency of root node
node->addDependency(input.get());
}
if (!node->hasDependents_) {
if (!node->isDependent_) {
// add dependency of output node
output->addDependency(node.get());
}
Expand Down