const string ConfigKeyService::STORE_PREFIX = "mon_config_key";
-int ConfigKeyService::store_get(string key, bufferlist &bl)
+int ConfigKeyService::store_get(const string &key, bufferlist &bl)
{
return mon->store->get(STORE_PREFIX, key, bl);
}
s.insert(STORE_PREFIX);
}
-void ConfigKeyService::store_put(string key, bufferlist &bl, Context *cb)
+void ConfigKeyService::store_put(const string &key, bufferlist &bl, Context *cb)
{
MonitorDBStore::TransactionRef t = paxos->get_pending_transaction();
t->put(STORE_PREFIX, key, bl);
paxos->trigger_propose();
}
-void ConfigKeyService::store_delete(string key, Context *cb)
+void ConfigKeyService::store_delete(const string &key, Context *cb)
{
MonitorDBStore::TransactionRef t = paxos->get_pending_transaction();
t->erase(STORE_PREFIX, key);
paxos->trigger_propose();
}
-bool ConfigKeyService::store_exists(string key)
+bool ConfigKeyService::store_exists(const string &key)
{
return mon->store->exists(STORE_PREFIX, key);
}
{
Paxos *paxos;
- int store_get(string key, bufferlist &bl);
- void store_put(string key, bufferlist &bl, Context *cb = NULL);
- void store_delete(string key, Context *cb = NULL);
+ int store_get(const string &key, bufferlist &bl);
+ void store_put(const string &key, bufferlist &bl, Context *cb = NULL);
+ void store_delete(const string &key, Context *cb = NULL);
void store_list(stringstream &ss);
- bool store_exists(string key);
+ bool store_exists(const string &key);
static const string STORE_PREFIX;