From 2174eed640ee5c012f753dd747d8f88fcd2df6c6 Mon Sep 17 00:00:00 2001 From: Duarte Nunes Date: Fri, 12 Oct 2018 11:49:32 +0100 Subject: [PATCH] database: Expose current memory view update backlog Expose the base replica's current memory view update backlog, which is defined in terms of units consumed from the semaphore. Signed-off-by: Duarte Nunes --- database.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/database.hh b/database.hh index 30d3a29cb2..8e7f21ae81 100644 --- a/database.hh +++ b/database.hh @@ -77,6 +77,7 @@ #include #include "tracing/trace_state.hh" #include "db/view/view.hh" +#include "db/view/view_update_backlog.hh" #include "db/view/row_locking.hh" #include "lister.hh" #include "utils/phased_barrier.hh" @@ -1450,6 +1451,10 @@ public: return _querier_cache; } + db::view::update_backlog get_view_update_backlog() const { + return {max_memory_pending_view_updates() - _view_update_concurrency_sem.current(), max_memory_pending_view_updates()}; + } + friend class distributed_loader; };