From 80ade2e2d31d05ff81113c9195c29d39fa7e2d92 Mon Sep 17 00:00:00 2001 From: Calle Wilund Date: Mon, 28 Sep 2015 13:59:01 +0200 Subject: [PATCH] storage_proxy: Add TRUNCATE verb handler --- service/storage_proxy.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/service/storage_proxy.cc b/service/storage_proxy.cc index 78bf17b1fd..0a529710ab 100644 --- a/service/storage_proxy.cc +++ b/service/storage_proxy.cc @@ -2529,6 +2529,11 @@ void storage_proxy::init_messaging_service() { return p->query_singular_local_digest(cmd, pr); }); }); + ms.register_truncate([](sstring ksname, sstring cfname) { + return get_storage_proxy().invoke_on_all([ksname, cfname](storage_proxy& sp) { + return sp._db.local().truncate(ksname, cfname); + }); + }); } void storage_proxy::uninit_messaging_service() { @@ -2540,6 +2545,7 @@ void storage_proxy::uninit_messaging_service() { ms.unregister_read_data(); ms.unregister_read_mutation_data(); ms.unregister_read_digest(); + ms.unregister_truncate(); } // Merges reconcilable_result:s from different shards into one