From ce6074a3a1a84480bd51311d15cd11345c7497a5 Mon Sep 17 00:00:00 2001 From: Doodle <13706157+critical27@users.noreply.github.com> Date: Wed, 19 Oct 2022 17:08:45 +0800 Subject: [PATCH 1/2] modify outdated gmock interface --- src/meta/test/MockAdminClient.h | 90 ++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 34 deletions(-) diff --git a/src/meta/test/MockAdminClient.h b/src/meta/test/MockAdminClient.h index 5e5f0a60c5a..dbba1398eb4 100644 --- a/src/meta/test/MockAdminClient.h +++ b/src/meta/test/MockAdminClient.h @@ -15,40 +15,62 @@ namespace meta { class MockAdminClient : public AdminClient { public: - MOCK_METHOD4(transLeader, - folly::Future(GraphSpaceID, PartitionID, const HostAddr&, const HostAddr&)); - MOCK_METHOD4(addPart, folly::Future(GraphSpaceID, PartitionID, const HostAddr&, bool)); - MOCK_METHOD3(addLearner, folly::Future(GraphSpaceID, PartitionID, const HostAddr&)); - MOCK_METHOD3(waitingForCatchUpData, - folly::Future(GraphSpaceID, PartitionID, const HostAddr&)); - MOCK_METHOD4(memberChange, - folly::Future(GraphSpaceID, PartitionID, const HostAddr&, bool)); - MOCK_METHOD4(updateMeta, - folly::Future(GraphSpaceID, PartitionID, const HostAddr&, const HostAddr&)); - MOCK_METHOD3(removePart, folly::Future(GraphSpaceID, PartitionID, const HostAddr&)); - MOCK_METHOD2(checkPeers, folly::Future(GraphSpaceID, PartitionID)); - MOCK_METHOD1(getLeaderDist, folly::Future(HostLeaderMap*)); - MOCK_METHOD3(createSnapshot, - folly::Future>(const std::set&, - const std::string&, - const HostAddr&)); - MOCK_METHOD3(dropSnapshot, - folly::Future>(const std::set&, - const std::string&, - const HostAddr&)); - MOCK_METHOD3(blockingWrites, - folly::Future>(const std::set&, - storage::cpp2::EngineSignType, - const HostAddr&)); - MOCK_METHOD7(addTask, - folly::Future>(cpp2::JobType, - int32_t, - int32_t, - GraphSpaceID, - const HostAddr&, - const std::vector&, - std::vector)); - MOCK_METHOD3(stopTask, folly::Future>(const HostAddr&, int32_t, int32_t)); + MOCK_METHOD(folly::Future, + transLeader, + (GraphSpaceID, PartitionID, const HostAddr&, const HostAddr&), + (override)); + MOCK_METHOD(folly::Future, + addPart, + (GraphSpaceID, PartitionID, const HostAddr&, bool), + (override)); + MOCK_METHOD(folly::Future, + addLearner, + (GraphSpaceID, PartitionID, const HostAddr&), + (override)); + MOCK_METHOD(folly::Future, + waitingForCatchUpData, + (GraphSpaceID, PartitionID, const HostAddr&), + (override)); + MOCK_METHOD(folly::Future, + memberChange, + (GraphSpaceID, PartitionID, const HostAddr&, bool), + (override)); + MOCK_METHOD(folly::Future, + updateMeta, + (GraphSpaceID, PartitionID, const HostAddr&, const HostAddr&), + (override)); + MOCK_METHOD(folly::Future, + removePart, + (GraphSpaceID, PartitionID, const HostAddr&), + (override)); + MOCK_METHOD(folly::Future, checkPeers, (GraphSpaceID, PartitionID), (override)); + MOCK_METHOD(folly::Future, getLeaderDist, (HostLeaderMap*), (override)); + MOCK_METHOD(folly::Future>, + createSnapshot, + (const std::set&, const std::string&, const HostAddr&), + (override)); + MOCK_METHOD(folly::Future>, + dropSnapshot, + (const std::set&, const std::string&, const HostAddr&), + (override)); + MOCK_METHOD(folly::Future>, + blockingWrites, + (const std::set&, storage::cpp2::EngineSignType, const HostAddr&), + (override)); + MOCK_METHOD(folly::Future>, + addTask, + (cpp2::JobType, + int32_t, + int32_t, + GraphSpaceID, + const HostAddr&, + const std::vector&, + std::vector), + (override)); + MOCK_METHOD(folly::Future>, + stopTask, + (const HostAddr&, int32_t, int32_t), + (override)); }; } // namespace meta From 8463fcd2df631a23f047c0999ee59e2406dc5bed Mon Sep 17 00:00:00 2001 From: Doodle <13706157+critical27@users.noreply.github.com> Date: Fri, 11 Nov 2022 10:22:37 +0800 Subject: [PATCH 2/2] lower log level in update --- src/storage/exec/UpdateNode.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/storage/exec/UpdateNode.h b/src/storage/exec/UpdateNode.h index eef3ab90e58..0a98f317153 100644 --- a/src/storage/exec/UpdateNode.h +++ b/src/storage/exec/UpdateNode.h @@ -407,7 +407,7 @@ class UpdateTagNode : public UpdateNode { for (auto& e : props_) { auto wRet = rowWriter_->setValue(e.first, e.second); if (wRet != WriteResult::SUCCEEDED) { - LOG(ERROR) << "Add field failed "; + VLOG(2) << "Add field failed "; return std::nullopt; } } @@ -416,7 +416,7 @@ class UpdateTagNode : public UpdateNode { auto wRet = rowWriter_->finish(); if (wRet != WriteResult::SUCCEEDED) { - LOG(ERROR) << "Add field failed "; + VLOG(2) << "Add field failed "; return std::nullopt; } @@ -760,7 +760,7 @@ class UpdateEdgeNode : public UpdateNode { for (auto& e : props_) { auto wRet = rowWriter_->setValue(e.first, e.second); if (wRet != WriteResult::SUCCEEDED) { - VLOG(1) << "Add field failed "; + VLOG(2) << "Add field failed "; return std::nullopt; } } @@ -769,7 +769,7 @@ class UpdateEdgeNode : public UpdateNode { auto wRet = rowWriter_->finish(); if (wRet != WriteResult::SUCCEEDED) { - VLOG(1) << "Add field failed "; + VLOG(2) << "Add field failed "; return std::nullopt; }