locator: add a virtual get_name() method to snitch classes
Add a pure virtual i_endpoint_snitch::get_name() method that should return the corresponding Java-name of a snitch class instance. Patch is also available on dev:/snitch-get-name-v1 Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
This commit is contained in:
committed by
Tomasz Grabiec
parent
b175d276ab
commit
f8d2679728
@@ -127,6 +127,10 @@ private:
|
||||
*/
|
||||
void set_stopped();
|
||||
|
||||
virtual sstring get_name() const {
|
||||
return "org.apache.cassandra.locator.GossipingPropertyFileSnitch";
|
||||
}
|
||||
|
||||
private:
|
||||
sstring _fname;
|
||||
timer<> _file_reader;
|
||||
|
||||
@@ -56,6 +56,10 @@ struct rack_inferring_snitch : public snitch_base {
|
||||
_state = snitch_state::stopped;
|
||||
return make_ready_future<>();
|
||||
}
|
||||
|
||||
virtual sstring get_name() const {
|
||||
return "org.apache.cassandra.locator.RackInferringSnitch";
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace locator
|
||||
|
||||
@@ -76,6 +76,10 @@ struct simple_snitch : public snitch_base {
|
||||
_state = snitch_state::stopped;
|
||||
return make_ready_future<>();
|
||||
}
|
||||
|
||||
virtual sstring get_name() const {
|
||||
return "org.apache.cassandra.locator.SimpleSnitch";
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -114,6 +114,8 @@ struct i_endpoint_snitch {
|
||||
_snitch_is_ready.set_value();
|
||||
}
|
||||
|
||||
virtual sstring get_name() const = 0;
|
||||
|
||||
protected:
|
||||
static unsigned& io_cpu_id() {
|
||||
static unsigned id = 0;
|
||||
|
||||
Reference in New Issue
Block a user