snitch: Introduce and use get_location() method
There are some places out there that generate locator::endpoint_dc_rack pair out of snitch's get_datacenter() and get_rack() calls. Generalize those with snitch's new method. It will also be used by next patch. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <boost/signals2.hpp>
|
||||
#include <boost/signals2/dummy_mutex.hpp>
|
||||
|
||||
#include "locator/types.hh"
|
||||
#include "gms/inet_address.hh"
|
||||
#include "inet_address_vectors.hh"
|
||||
#include "gms/versioned_value.hh"
|
||||
@@ -70,6 +71,13 @@ public:
|
||||
*/
|
||||
virtual sstring get_datacenter() const = 0;
|
||||
|
||||
locator::endpoint_dc_rack get_location() const {
|
||||
return locator::endpoint_dc_rack{
|
||||
.dc = get_datacenter(),
|
||||
.rack = get_rack(),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* returns whatever info snitch wants to gossip
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user