counters: Drop call to get_local_storage_service and related

The local host id is now passed by argument, so we don't
need the counter_id::local() and some other methods that
call or are called by it.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2020-11-30 21:29:51 +03:00
parent 914613b3c3
commit df0e26035f
5 changed files with 0 additions and 20 deletions

View File

@@ -19,16 +19,10 @@
* along with Scylla. If not, see <http://www.gnu.org/licenses/>.
*/
#include "service/storage_service.hh"
#include "counters.hh"
#include "mutation.hh"
#include "combine.hh"
counter_id counter_id::local()
{
return counter_id(service::get_local_storage_service().get_local_id());
}
std::ostream& operator<<(std::ostream& os, const counter_id& id) {
return os << id.to_uuid();
}

View File

@@ -61,8 +61,6 @@ public:
return !(*this == other);
}
public:
static counter_id local();
// For tests.
static counter_id generate_random() {
return counter_id(utils::make_random_uuid());
@@ -405,11 +403,6 @@ public:
return *it;
}
std::optional<counter_shard_view> local_shard() const {
// TODO: consider caching local shard position
return get_shard(counter_id::local());
}
bool operator==(const basic_counter_cell_view& other) const {
return timestamp() == other.timestamp() && boost::equal(shards(), other.shards());
}

View File

@@ -1299,7 +1299,6 @@ public:
future<> apply_in_memory(const mutation& m, column_family& cf, db::rp_handle&&, db::timeout_clock::time_point timeout);
void set_local_id(utils::UUID uuid) noexcept { _local_host_id = std::move(uuid); }
const utils::UUID get_local_id() const noexcept { return _local_host_id; }
private:
// Unless you are an earlier boostraper or the database itself, you should

View File

@@ -3209,6 +3209,5 @@ bool storage_service::is_repair_based_node_ops_enabled() {
return _db.local().get_config().enable_repair_based_node_ops();
}
utils::UUID storage_service::get_local_id() const { return _db.local().get_local_id(); }
} // namespace service

View File

@@ -43,7 +43,6 @@
#include "service/endpoint_lifecycle_subscriber.hh"
#include "locator/token_metadata.hh"
#include "gms/gossiper.hh"
#include "utils/UUID_gen.hh"
#include <seastar/core/distributed.hh>
#include "dht/i_partitioner.hh"
#include "dht/token_range_endpoints.hh"
@@ -844,10 +843,6 @@ private:
void do_isolate_on_error(disk_error type);
future<> isolate();
public:
utils::UUID get_local_id() const;
private:
void notify_down(inet_address endpoint);
void notify_left(inet_address endpoint);
void notify_up(inet_address endpoint);