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:
Vlad Zolotarov
2015-07-05 20:15:23 +03:00
committed by Tomasz Grabiec
parent b175d276ab
commit f8d2679728
4 changed files with 14 additions and 0 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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";
}
};
}

View File

@@ -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;