Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
address critical27's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
panda-sheep committed Mar 24, 2021
1 parent 35c42ca commit 4b67b63
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
14 changes: 14 additions & 0 deletions src/storage/CommonUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,20 @@ class IndexCountWrapper {
count_->fetch_add(1, std::memory_order_release);
}

IndexCountWrapper(const IndexCountWrapper&) = delete;

IndexCountWrapper(IndexCountWrapper&& icw) noexcept
: count_(icw.count_) {}

IndexCountWrapper& operator=(const IndexCountWrapper&) = delete;

IndexCountWrapper& operator=(IndexCountWrapper&& icw) noexcept {
if (this != &icw) {
count_ = icw.count_;
}
return *this;
}

~IndexCountWrapper() {
count_->fetch_sub(1, std::memory_order_release);
}
Expand Down
4 changes: 2 additions & 2 deletions src/storage/mutate/AddEdgesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ void AddEdgesProcessor::doProcessWithIndex(const cpp2::AddEdgesRequest& req) {
continue;
}
env_->kvstore_->asyncAppendBatch(spaceId_, partId, std::move(batch),
[l = std::move(lg), &wrapper, partId, this](kvstore::ResultCode kvRet) {
[l = std::move(lg), icw = std::move(wrapper), partId, this](kvstore::ResultCode kvRet) {
UNUSED(l);
UNUSED(wrapper);
UNUSED(icw);
handleAsync(spaceId_, partId, kvRet);
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/storage/mutate/AddVerticesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ void AddVerticesProcessor::doProcessWithIndex(const cpp2::AddVerticesRequest& re
continue;
}
env_->kvstore_->asyncAppendBatch(spaceId_, partId, std::move(batch),
[l = std::move(lg), &wrapper, partId, this](kvstore::ResultCode kvRet) {
[l = std::move(lg), icw = std::move(wrapper), partId, this](kvstore::ResultCode kvRet) {
UNUSED(l);
UNUSED(wrapper);
UNUSED(icw);
handleAsync(spaceId_, partId, kvRet);
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/storage/mutate/DeleteEdgesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ void DeleteEdgesProcessor::process(const cpp2::DeleteEdgesRequest& req) {
continue;
}
env_->kvstore_->asyncAppendBatch(spaceId_, partId, std::move(nebula::value(batch)),
[l = std::move(lg), &wrapper, partId, this](kvstore::ResultCode code) {
[l = std::move(lg), icw = std::move(wrapper), partId, this](kvstore::ResultCode code) {
UNUSED(l);
UNUSED(wrapper);
UNUSED(icw);
handleAsync(spaceId_, partId, code);
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/storage/mutate/DeleteVerticesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ void DeleteVerticesProcessor::process(const cpp2::DeleteVerticesRequest& req) {
continue;
}
env_->kvstore_->asyncAppendBatch(spaceId_, partId, std::move(nebula::value(batch)),
[l = std::move(lg), &wrapper, partId, this](kvstore::ResultCode code) {
[l = std::move(lg), icw = std::move(wrapper), partId, this](kvstore::ResultCode code) {
UNUSED(l);
UNUSED(wrapper);
UNUSED(icw);
handleAsync(spaceId_, partId, code);
});
}
Expand Down

0 comments on commit 4b67b63

Please sign in to comment.