From 861d2dfb6126a16deb00ce26a94665717ccaabe2 Mon Sep 17 00:00:00 2001 From: Duarte Nunes Date: Sun, 15 Jan 2017 20:30:27 +0100 Subject: [PATCH] view_updates: Adds function to replace row This patch adds a function to replace a view row given a base table update and the pre-existing row, which simply deletes the old view entry and adds a new one. Signed-off-by: Duarte Nunes --- db/view/view.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/db/view/view.cc b/db/view/view.cc index bb2de389d1..4819faba01 100644 --- a/db/view/view.cc +++ b/db/view/view.cc @@ -177,6 +177,10 @@ private: void delete_old_entry(const partition_key& base_key, const clustering_row& existing, gc_clock::time_point now); void do_delete_old_entry(const partition_key& base_key, const clustering_row& existing, gc_clock::time_point now); void update_entry(const partition_key& base_key, const clustering_row& update, const clustering_row& existing, gc_clock::time_point now); + void replace_entry(const partition_key& base_key, const clustering_row& update, const clustering_row& existing, gc_clock::time_point now) { + create_entry(base_key, update, now); + delete_old_entry(base_key, existing, now); + } }; row_marker view_updates::compute_row_marker(const clustering_row& base_row) const {