From d58c8aaa321a9ce16f0c41cb6c95bca348553c24 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Wed, 23 Nov 2016 21:39:29 +0200 Subject: [PATCH] db: remove unused belongs_to_{current,other}_shard(s) functions Obsoleted by new sharding mechanism, but break the build for some. --- database.cc | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/database.cc b/database.cc index 7fc997a55d..d7fdca4cb9 100644 --- a/database.cc +++ b/database.cc @@ -742,28 +742,6 @@ future<> lister::scan_dir(sstring name, lister::dir_entry_types type, walker_typ }); } -static bool belongs_to_current_shard(const schema& s, const partition_key& first, const partition_key& last) { - auto key_shard = [&s] (const partition_key& pk) { - auto token = dht::global_partitioner().get_token(s, pk); - return dht::shard_of(token); - }; - auto s1 = key_shard(first); - auto s2 = key_shard(last); - auto me = engine().cpu_id(); - return (s1 <= me) && (me <= s2); -} - -static bool belongs_to_other_shard(const schema& s, const partition_key& first, const partition_key& last) { - auto key_shard = [&s] (const partition_key& pk) { - auto token = dht::global_partitioner().get_token(s, pk); - return dht::shard_of(token); - }; - auto s1 = key_shard(first); - auto s2 = key_shard(last); - auto me = engine().cpu_id(); - return (s1 != me) || (me != s2); -} - static bool belongs_to_current_shard(const std::vector& shards) { return boost::find(shards, engine().cpu_id()) != shards.end(); }