From 67130263fc380cff1d5af006c6c2d0298fbf5b75 Mon Sep 17 00:00:00 2001 From: neverchanje Date: Wed, 8 Jan 2020 09:40:29 +0800 Subject: [PATCH] feat(dup): add is_duplicating API on replication_app_base --- include/dsn/dist/replication/replication_app_base.h | 3 +++ src/dist/replication/lib/replication_app_base.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/include/dsn/dist/replication/replication_app_base.h b/include/dsn/dist/replication/replication_app_base.h index 193cbb225a..244a555315 100644 --- a/include/dsn/dist/replication/replication_app_base.h +++ b/include/dsn/dist/replication/replication_app_base.h @@ -103,6 +103,9 @@ class replication_app_base : public replica_base bool is_primary() const; + // Whether this replica is duplicating. + bool is_duplicating() const; + // // Open the app. // diff --git a/src/dist/replication/lib/replication_app_base.cpp b/src/dist/replication/lib/replication_app_base.cpp index a095d081f8..9a46038504 100644 --- a/src/dist/replication/lib/replication_app_base.cpp +++ b/src/dist/replication/lib/replication_app_base.cpp @@ -323,6 +323,8 @@ bool replication_app_base::is_primary() const return _replica->status() == partition_status::PS_PRIMARY; } +bool replication_app_base::is_duplicating() const { return _replica->is_duplicating(); } + error_code replication_app_base::open_internal(replica *r) { if (!dsn::utils::filesystem::directory_exists(_dir_data)) {