File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
include/homestore/replication Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -446,6 +446,8 @@ class ReplDevListener {
446446 std::weak_ptr< ReplDev > m_repl_dev;
447447};
448448
449+ using data_service_request_handler_t = std::function< void (boost::intrusive_ptr< sisl::GenericRpcData >& rpc_data) >;
450+
449451class ReplDev {
450452public:
451453 ReplDev () = default ;
@@ -628,6 +630,11 @@ class ReplDev {
628630 // create a snapshot manually and try to compact logs upto compact_lsn
629631 virtual void trigger_snapshot_creation (repl_lsn_t compact_lsn, bool wait_for_commit) = 0;
630632
633+ virtual bool add_data_rpc_service (std::string const & request_name,
634+ data_service_request_handler_t const & request_handler) {
635+ return true ;
636+ }
637+
631638protected:
632639 shared< ReplDevListener > m_listener;
633640
Original file line number Diff line number Diff line change @@ -138,6 +138,11 @@ bool RaftReplDev::join_group() {
138138 return true ;
139139}
140140
141+ bool RaftReplDev::add_data_rpc_service (std::string const & request_name,
142+ data_service_request_handler_t const & request_handler) {
143+ return m_msg_mgr.bind_data_service_request (request_name, m_group_id, request_handler);
144+ }
145+
141146// All the steps in the implementation should be idempotent and retryable.
142147AsyncReplResult<> RaftReplDev::start_replace_member (std::string& task_id, const replica_member_info& member_out,
143148 const replica_member_info& member_in, uint32_t commit_quorum,
Original file line number Diff line number Diff line change @@ -322,6 +322,8 @@ class RaftReplDev : public ReplDev,
322322 void pause_state_machine (size_t timeout) override ;
323323 void resume_state_machine () override ;
324324 bool is_state_machine_paused () override ;
325+ bool add_data_rpc_service (std::string const & request_name,
326+ data_service_request_handler_t const & request_handler) override ;
325327
326328 std::shared_ptr< snapshot_context > deserialize_snapshot_context (sisl::io_blob_safe& snp_ctx) override {
327329 return std::make_shared< nuraft_snapshot_context >(snp_ctx);
You can’t perform that action at this time.
0 commit comments