From 2718eae165313d48e3a65c2227e14a3e68d35943 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Wed, 8 Jul 2020 09:04:48 +0000 Subject: Rename context to IDestructorCallbackSP --- searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp | 4 ++-- .../gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp | 4 ++-- .../gid_to_lid_change_registrator_test.cpp | 4 ++-- .../proton/reference/dummy_gid_to_lid_change_handler.cpp | 4 ++-- .../searchcore/proton/reference/dummy_gid_to_lid_change_handler.h | 4 ++-- .../searchcore/proton/reference/gid_to_lid_change_handler.cpp | 8 ++++---- .../vespa/searchcore/proton/reference/gid_to_lid_change_handler.h | 8 ++++---- .../searchcore/proton/reference/gid_to_lid_change_listener.cpp | 4 ++-- .../searchcore/proton/reference/gid_to_lid_change_listener.h | 4 ++-- .../searchcore/proton/reference/i_gid_to_lid_change_handler.h | 6 +++--- .../searchcore/proton/reference/i_gid_to_lid_change_listener.h | 6 +++--- .../src/vespa/searchcore/proton/server/storeonlyfeedview.cpp | 2 +- .../vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.h | 4 ++-- 13 files changed, 31 insertions(+), 31 deletions(-) (limited to 'searchcore') diff --git a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp index 38d5b0d35b1..a538d36ddf5 100644 --- a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp +++ b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp @@ -185,14 +185,14 @@ public: { } - void notifyPutDone(Context, document::GlobalId gid, uint32_t lid, SerialNum) override { + void notifyPutDone(IDestructorCallbackSP, document::GlobalId gid, uint32_t lid, SerialNum) override { _changeGid = gid; _changeLid = lid; _gidToLid[gid] = lid; ++_changes; } - void notifyRemove(Context, document::GlobalId gid, SerialNum) override { + void notifyRemove(IDestructorCallbackSP, document::GlobalId gid, SerialNum) override { _changeGid = gid; _changeLid = 0; _gidToLid[gid] = 0; diff --git a/searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp b/searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp index 0c69fbaed55..920472c6a01 100644 --- a/searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp +++ b/searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp @@ -102,8 +102,8 @@ public: _stats.markCreatedListener(); } ~MyListener() override { _stats.markDestroyedListener(); } - void notifyPutDone(Context, GlobalId, uint32_t) override { _stats.notifyPutDone(); } - void notifyRemove(Context, GlobalId) override { _stats.notifyRemove(); } + void notifyPutDone(IDestructorCallbackSP, GlobalId, uint32_t) override { _stats.notifyPutDone(); } + void notifyRemove(IDestructorCallbackSP, GlobalId) override { _stats.notifyRemove(); } void notifyRegistered() override { _stats.markRegisteredListener(); } const vespalib::string &getName() const override { return _name; } const vespalib::string &getDocTypeName() const override { return _docTypeName; } diff --git a/searchcore/src/tests/proton/reference/gid_to_lid_change_registrator/gid_to_lid_change_registrator_test.cpp b/searchcore/src/tests/proton/reference/gid_to_lid_change_registrator/gid_to_lid_change_registrator_test.cpp index 6fcc57ce398..ebbd04a4738 100644 --- a/searchcore/src/tests/proton/reference/gid_to_lid_change_registrator/gid_to_lid_change_registrator_test.cpp +++ b/searchcore/src/tests/proton/reference/gid_to_lid_change_registrator/gid_to_lid_change_registrator_test.cpp @@ -24,8 +24,8 @@ public: { } ~MyListener() override { } - void notifyPutDone(Context, document::GlobalId, uint32_t) override { } - void notifyRemove(Context, document::GlobalId) override { } + void notifyPutDone(IDestructorCallbackSP, document::GlobalId, uint32_t) override { } + void notifyRemove(IDestructorCallbackSP, document::GlobalId) override { } void notifyRegistered() override { } const vespalib::string &getName() const override { return _name; } const vespalib::string &getDocTypeName() const override { return _docTypeName; } diff --git a/searchcore/src/vespa/searchcore/proton/reference/dummy_gid_to_lid_change_handler.cpp b/searchcore/src/vespa/searchcore/proton/reference/dummy_gid_to_lid_change_handler.cpp index 42b2facc138..6c45096a53f 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/dummy_gid_to_lid_change_handler.cpp +++ b/searchcore/src/vespa/searchcore/proton/reference/dummy_gid_to_lid_change_handler.cpp @@ -9,12 +9,12 @@ DummyGidToLidChangeHandler::DummyGidToLidChangeHandler() = default; DummyGidToLidChangeHandler::~DummyGidToLidChangeHandler() = default; void -DummyGidToLidChangeHandler::notifyPutDone(Context , GlobalId, uint32_t, SerialNum) +DummyGidToLidChangeHandler::notifyPutDone(IDestructorCallbackSP , GlobalId, uint32_t, SerialNum) { } void -DummyGidToLidChangeHandler::notifyRemove(Context , GlobalId, SerialNum) +DummyGidToLidChangeHandler::notifyRemove(IDestructorCallbackSP , GlobalId, SerialNum) { } diff --git a/searchcore/src/vespa/searchcore/proton/reference/dummy_gid_to_lid_change_handler.h b/searchcore/src/vespa/searchcore/proton/reference/dummy_gid_to_lid_change_handler.h index 3527980cc7f..d5f6d788885 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/dummy_gid_to_lid_change_handler.h +++ b/searchcore/src/vespa/searchcore/proton/reference/dummy_gid_to_lid_change_handler.h @@ -22,8 +22,8 @@ public: DummyGidToLidChangeHandler(); ~DummyGidToLidChangeHandler() override; - void notifyPutDone(Context context, GlobalId gid, uint32_t lid, SerialNum serialNum) override; - void notifyRemove(Context context, GlobalId gid, SerialNum serialNum) override; + void notifyPutDone(IDestructorCallbackSP context, GlobalId gid, uint32_t lid, SerialNum serialNum) override; + void notifyRemove(IDestructorCallbackSP context, GlobalId gid, SerialNum serialNum) override; void notifyRemoveDone(GlobalId gid, SerialNum serialNum) override; void addListener(std::unique_ptr listener) override; void removeListeners(const vespalib::string &docTypeName, const std::set &keepNames) override; diff --git a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp index 58873060c6c..0c9087405b6 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp +++ b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp @@ -27,7 +27,7 @@ GidToLidChangeHandler::~GidToLidChangeHandler() } void -GidToLidChangeHandler::notifyPutDone(Context context, GlobalId gid, uint32_t lid) +GidToLidChangeHandler::notifyPutDone(IDestructorCallbackSP context, GlobalId gid, uint32_t lid) { for (const auto &listener : _listeners) { listener->notifyPutDone(context, gid, lid); @@ -35,7 +35,7 @@ GidToLidChangeHandler::notifyPutDone(Context context, GlobalId gid, uint32_t lid } void -GidToLidChangeHandler::notifyRemove(Context context, GlobalId gid) +GidToLidChangeHandler::notifyRemove(IDestructorCallbackSP context, GlobalId gid) { for (const auto &listener : _listeners) { listener->notifyRemove(context, gid); @@ -43,7 +43,7 @@ GidToLidChangeHandler::notifyRemove(Context context, GlobalId gid) } void -GidToLidChangeHandler::notifyPutDone(Context context, GlobalId gid, uint32_t lid, SerialNum serialNum) +GidToLidChangeHandler::notifyPutDone(IDestructorCallbackSP context, GlobalId gid, uint32_t lid, SerialNum serialNum) { lock_guard guard(_lock); auto itr = _pendingRemove.find(gid); @@ -63,7 +63,7 @@ GidToLidChangeHandler::notifyPutDone(Context context, GlobalId gid, uint32_t lid } void -GidToLidChangeHandler::notifyRemove(Context context, GlobalId gid, SerialNum serialNum) +GidToLidChangeHandler::notifyRemove(IDestructorCallbackSP context, GlobalId gid, SerialNum serialNum) { lock_guard guard(_lock); auto insRes = _pendingRemove.insert(std::make_pair(gid, PendingRemoveEntry(serialNum))); diff --git a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.h b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.h index 61ad2ad31ae..13a51edd0b5 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.h +++ b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.h @@ -45,14 +45,14 @@ class GidToLidChangeHandler : public std::enable_shared_from_this _pendingRemove; - void notifyPutDone(Context context, GlobalId gid, uint32_t lid); - void notifyRemove(Context context, GlobalId gid); + void notifyPutDone(IDestructorCallbackSP context, GlobalId gid, uint32_t lid); + void notifyRemove(IDestructorCallbackSP context, GlobalId gid); public: GidToLidChangeHandler(); ~GidToLidChangeHandler() override; - void notifyPutDone(Context context, GlobalId gid, uint32_t lid, SerialNum serialNum) override; - void notifyRemove(Context context, GlobalId gid, SerialNum serialNum) override; + void notifyPutDone(IDestructorCallbackSP context, GlobalId gid, uint32_t lid, SerialNum serialNum) override; + void notifyRemove(IDestructorCallbackSP context, GlobalId gid, SerialNum serialNum) override; void notifyRemoveDone(GlobalId gid, SerialNum serialNum) override; /** diff --git a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.cpp b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.cpp index 4450425e12f..c54346defd5 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.cpp +++ b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.cpp @@ -26,7 +26,7 @@ GidToLidChangeListener::~GidToLidChangeListener() } void -GidToLidChangeListener::notifyPutDone(Context context, document::GlobalId gid, uint32_t lid) +GidToLidChangeListener::notifyPutDone(IDestructorCallbackSP context, document::GlobalId gid, uint32_t lid) { _attributeFieldWriter.executeLambda(_executorId, [this, context=std::move(context), gid, lid]() { @@ -36,7 +36,7 @@ GidToLidChangeListener::notifyPutDone(Context context, document::GlobalId gid, u } void -GidToLidChangeListener::notifyRemove(Context context, document::GlobalId gid) +GidToLidChangeListener::notifyRemove(IDestructorCallbackSP context, document::GlobalId gid) { _attributeFieldWriter.executeLambda(_executorId, [this, context = std::move(context), gid]() { diff --git a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.h b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.h index 326513e6367..ae53e674c24 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.h +++ b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.h @@ -29,8 +29,8 @@ public: const vespalib::string &name, const vespalib::string &docTypeName); ~GidToLidChangeListener() override; - void notifyPutDone(Context context, document::GlobalId gid, uint32_t lid) override; - void notifyRemove(Context context, document::GlobalId gid) override; + void notifyPutDone(IDestructorCallbackSP context, document::GlobalId gid, uint32_t lid) override; + void notifyRemove(IDestructorCallbackSP context, document::GlobalId gid) override; void notifyRegistered() override; const vespalib::string &getName() const override; const vespalib::string &getDocTypeName() const override; diff --git a/searchcore/src/vespa/searchcore/proton/reference/i_gid_to_lid_change_handler.h b/searchcore/src/vespa/searchcore/proton/reference/i_gid_to_lid_change_handler.h index 0e64827d969..cbafef57e46 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/i_gid_to_lid_change_handler.h +++ b/searchcore/src/vespa/searchcore/proton/reference/i_gid_to_lid_change_handler.h @@ -17,7 +17,7 @@ namespace proton { class IGidToLidChangeHandler { public: - using Context = IGidToLidChangeListener::Context; + using IDestructorCallbackSP = IGidToLidChangeListener::IDestructorCallbackSP; using SerialNum = search::SerialNum; using GlobalId = document::GlobalId; @@ -38,8 +38,8 @@ public: /** * Notify gid to lid mapping change. */ - virtual void notifyPutDone(Context context, GlobalId gid, uint32_t lid, SerialNum serialNum) = 0; - virtual void notifyRemove(Context context, GlobalId gid, SerialNum serialNum) = 0; + virtual void notifyPutDone(IDestructorCallbackSP context, GlobalId gid, uint32_t lid, SerialNum serialNum) = 0; + virtual void notifyRemove(IDestructorCallbackSP context, GlobalId gid, SerialNum serialNum) = 0; virtual void notifyRemoveDone(GlobalId gid, SerialNum serialNum) = 0; }; diff --git a/searchcore/src/vespa/searchcore/proton/reference/i_gid_to_lid_change_listener.h b/searchcore/src/vespa/searchcore/proton/reference/i_gid_to_lid_change_listener.h index d997c87305b..5a216486d96 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/i_gid_to_lid_change_listener.h +++ b/searchcore/src/vespa/searchcore/proton/reference/i_gid_to_lid_change_listener.h @@ -16,10 +16,10 @@ namespace proton { class IGidToLidChangeListener { public: - using Context = std::shared_ptr; + using IDestructorCallbackSP = std::shared_ptr; virtual ~IGidToLidChangeListener() { } - virtual void notifyPutDone(Context context, document::GlobalId gid, uint32_t lid) = 0; - virtual void notifyRemove(Context context, document::GlobalId gid) = 0; + virtual void notifyPutDone(IDestructorCallbackSP context, document::GlobalId gid, uint32_t lid) = 0; + virtual void notifyRemove(IDestructorCallbackSP context, document::GlobalId gid) = 0; virtual void notifyRegistered() = 0; virtual const vespalib::string &getName() const = 0; virtual const vespalib::string &getDocTypeName() const = 0; diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp index 6e243951386..bd5f2775735 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp @@ -670,7 +670,7 @@ StoreOnlyFeedView::removeDocuments(const RemoveDocumentsOperation &op, bool remo vespalib::Gate gate; gidsToRemove = getGidsToRemove(_metaStore, lidsToRemove); { - IGidToLidChangeHandler::Context context = std::make_shared(gate); + IGidToLidChangeHandler::IDestructorCallbackSP context = std::make_shared(gate); for (const auto &gid : gidsToRemove) { _gidToLidChangeHandler.notifyRemove(context, gid, serialNum); } diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.h b/searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.h index 69e4af49f5f..e808f721e83 100644 --- a/searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.h +++ b/searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.h @@ -42,8 +42,8 @@ public: _removes.emplace_back(docTypeName, keepNames); } - void notifyPutDone(Context, document::GlobalId, uint32_t, SerialNum) override { } - void notifyRemove(Context, document::GlobalId, SerialNum) override { } + void notifyPutDone(IDestructorCallbackSP, document::GlobalId, uint32_t, SerialNum) override { } + void notifyRemove(IDestructorCallbackSP, document::GlobalId, SerialNum) override { } void notifyRemoveDone(document::GlobalId, SerialNum) override { } void assertAdds(const std::vector &expAdds) -- cgit v1.2.3