put_version_latest_full(t, version);
}
-version_t AuthMonitor::get_trim_to()
+version_t AuthMonitor::get_trim_to() const
{
unsigned max = g_conf->paxos_max_join_drift * 2;
version_t version = get_last_committed();
// propose pending update to peers
void encode_pending(MonitorDBStore::TransactionRef t) override;
void encode_full(MonitorDBStore::TransactionRef t) override;
- version_t get_trim_to() override;
+ version_t get_trim_to() const override;
bool preprocess_query(MonOpRequestRef op) override; // true if processed.
bool prepare_update(MonOpRequestRef op) override;
return mon->store->get(STORE_PREFIX, key, bl);
}
-void ConfigKeyService::get_store_prefixes(set<string>& s)
+void ConfigKeyService::get_store_prefixes(set<string>& s) const
{
s.insert(STORE_PREFIX);
}
string get_name() const override {
return "config_key";
}
- virtual void get_store_prefixes(set<string>& s);
+ void get_store_prefixes(set<string>& s) const;
/**
* @} // ConfigKeyService_Inherited_h
*/
encode_health(pending_health, t);
}
-version_t HealthMonitor::get_trim_to()
+version_t HealthMonitor::get_trim_to() const
{
// we don't actually need *any* old states, but keep a few.
if (version > 5) {
void update_from_paxos(bool *need_bootstrap) override;
void create_pending() override;
void encode_pending(MonitorDBStore::TransactionRef t) override;
- version_t get_trim_to() override;
+ version_t get_trim_to() const override;
void encode_full(MonitorDBStore::TransactionRef t) override { }
put_version_latest_full(t, summary.version);
}
-version_t LogMonitor::get_trim_to()
+version_t LogMonitor::get_trim_to() const
{
if (!mon->is_leader())
return 0;
// propose pending update to peers
void encode_pending(MonitorDBStore::TransactionRef t) override;
void encode_full(MonitorDBStore::TransactionRef t) override;
- version_t get_trim_to() override;
+ version_t get_trim_to() const override;
bool preprocess_query(MonOpRequestRef op) override; // true if processed.
bool prepare_update(MonOpRequestRef op) override;
encode_health(new_checks, t);
}
-version_t MDSMonitor::get_trim_to()
+version_t MDSMonitor::get_trim_to() const
{
version_t floor = 0;
if (g_conf->mon_mds_force_trim_to > 0 &&
void encode_pending(MonitorDBStore::TransactionRef t) override;
// we don't require full versions; don't encode any.
void encode_full(MonitorDBStore::TransactionRef t) override { }
- version_t get_trim_to() override;
+ version_t get_trim_to() const override;
bool preprocess_query(MonOpRequestRef op) override; // true if processed.
bool prepare_update(MonOpRequestRef op) override;
encode_health(pending_health_checks, t);
}
-version_t MgrStatMonitor::get_trim_to()
+version_t MgrStatMonitor::get_trim_to() const
{
// we don't actually need *any* old states, but keep a few.
if (version > 5) {
void update_from_paxos(bool *need_bootstrap) override;
void create_pending() override;
void encode_pending(MonitorDBStore::TransactionRef t) override;
- version_t get_trim_to() override;
+ version_t get_trim_to() const override;
bool definitely_converted_snapsets() const {
return digest.definitely_converted_snapsets();
dout(20) << " full crc " << pending_inc.full_crc << dendl;
}
-void OSDMonitor::get_store_prefixes(std::set<string>& s)
+void OSDMonitor::get_store_prefixes(std::set<string>& s) const
{
s.insert(service_name);
s.insert(OSD_PG_CREATING_PREFIX);
// elsewhere) as they may still need to request older values.
}
-version_t OSDMonitor::get_trim_to()
+version_t OSDMonitor::get_trim_to() const
{
if (mon->get_quorum().empty()) {
dout(10) << __func__ << ": quorum not formed" << dendl;
// svc
public:
void create_initial() override;
- void get_store_prefixes(std::set<string>& s) override;
+ void get_store_prefixes(std::set<string>& s) const override;
private:
void update_from_paxos(bool *need_bootstrap) override;
bool prepare_update(MonOpRequestRef op) override;
bool should_propose(double &delay) override;
- version_t get_trim_to() override;
+ version_t get_trim_to() const override;
bool can_mark_down(int o);
bool can_mark_up(int o);
version_t format_version;
public:
- const health_check_map_t& get_health_checks() {
+ const health_check_map_t& get_health_checks() const {
return health_checks;
}
*
* @returns The service's name.
*/
- string get_service_name() { return service_name; }
+ const string& get_service_name() const { return service_name; }
/**
* Get the store prefixes we utilize
*/
- virtual void get_store_prefixes(set<string>& s) {
+ virtual void get_store_prefixes(set<string>& s) const {
s.insert(service_name);
}
*
* @returns true if we are proposing; false otherwise.
*/
- bool is_proposing() {
+ bool is_proposing() const {
return proposing;
}
*
* @returns true if in state ACTIVE; false otherwise.
*/
- bool is_active() {
+ bool is_active() const {
return
!is_proposing() &&
(paxos->is_active() || paxos->is_updating() || paxos->is_writing());
* @param ver The version we want to check if is readable
* @returns true if it is readable; false otherwise
*/
- bool is_readable(version_t ver = 0) {
+ bool is_readable(version_t ver = 0) const {
if (ver > get_last_committed() ||
!paxos->is_readable(0) ||
get_last_committed() == 0)
*
* @returns true if writeable; false otherwise
*/
- bool is_writeable() {
+ bool is_writeable() const {
return is_write_ready();
}
*
* @returns true if we are ready to be written to; false otherwise.
*/
- bool is_write_ready() {
+ bool is_write_ready() const {
return is_active() && have_pending;
}
* @returns the version we should trim to; if we return zero, it should be
* assumed that there's no version to trim to.
*/
- virtual version_t get_trim_to() {
+ virtual version_t get_trim_to() const {
return 0;
}