]> git.proxmox.com Git - ceph.git/blob - ceph/src/mon/ConfigKeyService.h
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / mon / ConfigKeyService.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2013 Inktank, Inc
7 *
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
12 *
13 */
14 #ifndef CEPH_MON_CONFIG_KEY_SERVICE_H
15 #define CEPH_MON_CONFIG_KEY_SERVICE_H
16
17 #include "mon/QuorumService.h"
18
19 class Paxos;
20 class Monitor;
21 namespace ceph {
22 class Formatter;
23 }
24
25 class ConfigKeyService : public QuorumService
26 {
27 Paxos *paxos;
28
29 int store_get(const string &key, bufferlist &bl);
30 void store_put(const string &key, bufferlist &bl, Context *cb = NULL);
31 void store_delete(const string &key, Context *cb = NULL);
32 void store_list(stringstream &ss);
33 void store_dump(stringstream &ss);
34 bool store_exists(const string &key);
35
36 static const string STORE_PREFIX;
37
38 protected:
39 void service_shutdown() override { }
40
41 public:
42 ConfigKeyService(Monitor *m, Paxos *p) :
43 QuorumService(m),
44 paxos(p)
45 { }
46 ~ConfigKeyService() override { }
47
48
49 /**
50 * @defgroup ConfigKeyService_Inherited_h Inherited abstract methods
51 * @{
52 */
53 void init() override { }
54 void get_health(Formatter *f,
55 list<pair<health_status_t,string> >& summary,
56 list<pair<health_status_t,string> > *detail) override { }
57 bool service_dispatch(MonOpRequestRef op) override;
58
59 void start_epoch() override { }
60 void finish_epoch() override { }
61 void cleanup() override { }
62 void service_tick() override { }
63
64 int get_type() override {
65 return QuorumService::SERVICE_CONFIG_KEY;
66 }
67
68 string get_name() const override {
69 return "config_key";
70 }
71 virtual void get_store_prefixes(set<string>& s);
72 /**
73 * @} // ConfigKeyService_Inherited_h
74 */
75 };
76
77 #endif // CEPH_MON_CONFIG_KEY_SERVICE_H