]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/ConfigKeyService: make STORE_PREFIX public
authorSage Weil <sage@redhat.com>
Thu, 9 Nov 2017 14:49:30 +0000 (08:49 -0600)
committerSage Weil <sage@redhat.com>
Tue, 6 Mar 2018 20:44:09 +0000 (14:44 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/ConfigKeyService.cc
src/mon/mon_types.h

index 4318171848044f70e920aa30f1a971359f3bc2fc..8ec09a1f0011178e280e94a03a67b0576111781f 100644 (file)
@@ -33,22 +33,22 @@ static ostream& _prefix(std::ostream *_dout, const Monitor *mon,
                 << "(" << service->get_epoch() << ") ";
 }
 
-const string ConfigKeyService::STORE_PREFIX = "mon_config_key";
+const string CONFIG_PREFIX = "mon_config_key";
 
 int ConfigKeyService::store_get(const string &key, bufferlist &bl)
 {
-  return mon->store->get(STORE_PREFIX, key, bl);
+  return mon->store->get(CONFIG_PREFIX, key, bl);
 }
 
 void ConfigKeyService::get_store_prefixes(set<string>& s) const
 {
-  s.insert(STORE_PREFIX);
+  s.insert(CONFIG_PREFIX);
 }
 
 void ConfigKeyService::store_put(const string &key, bufferlist &bl, Context *cb)
 {
   MonitorDBStore::TransactionRef t = paxos->get_pending_transaction();
-  t->put(STORE_PREFIX, key, bl);
+  t->put(CONFIG_PREFIX, key, bl);
   if (cb)
     paxos->queue_pending_finisher(cb);
   paxos->trigger_propose();
@@ -67,18 +67,18 @@ void ConfigKeyService::store_delete(
     MonitorDBStore::TransactionRef t,
     const string &key)
 {
-  t->erase(STORE_PREFIX, key);
+  t->erase(CONFIG_PREFIX, key);
 }
 
 bool ConfigKeyService::store_exists(const string &key)
 {
-  return mon->store->exists(STORE_PREFIX, key);
+  return mon->store->exists(CONFIG_PREFIX, key);
 }
 
 void ConfigKeyService::store_list(stringstream &ss)
 {
   KeyValueDB::Iterator iter =
-    mon->store->get_iterator(STORE_PREFIX);
+    mon->store->get_iterator(CONFIG_PREFIX);
 
   JSONFormatter f(true);
   f.open_array_section("keys");
@@ -95,7 +95,7 @@ void ConfigKeyService::store_list(stringstream &ss)
 bool ConfigKeyService::store_has_prefix(const string &prefix)
 {
   KeyValueDB::Iterator iter =
-    mon->store->get_iterator(STORE_PREFIX);
+    mon->store->get_iterator(CONFIG_PREFIX);
 
   while (iter->valid()) {
     string key(iter->key());
@@ -111,7 +111,7 @@ bool ConfigKeyService::store_has_prefix(const string &prefix)
 void ConfigKeyService::store_dump(stringstream &ss)
 {
   KeyValueDB::Iterator iter =
-    mon->store->get_iterator(STORE_PREFIX);
+    mon->store->get_iterator(CONFIG_PREFIX);
 
   JSONFormatter f(true);
   f.open_object_section("config-key store");
@@ -129,7 +129,7 @@ void ConfigKeyService::store_delete_prefix(
     const string &prefix)
 {
   KeyValueDB::Iterator iter =
-    mon->store->get_iterator(STORE_PREFIX);
+    mon->store->get_iterator(CONFIG_PREFIX);
 
   while (iter->valid()) {
     string key(iter->key());
index 97eab1b80a2b59dbc4c964110b0d39f6238a71ab..c705ded5f8114b706f42df8c1cb2a55606443c26 100644 (file)
@@ -49,6 +49,8 @@ inline const char *get_paxos_name(int p) {
 
 #define CEPH_MON_ONDISK_MAGIC "ceph mon volume v012"
 
+extern const string CONFIG_PREFIX;
+
 // map of entity_type -> features -> count
 struct FeatureMap {
   std::map<uint32_t,std::map<uint64_t,uint64_t>> m;