- dbstore
- motr
- daos
+- name: rgw_config_store
+ type: str
+ level: advanced
+ desc: Configuration storage backend
+ default: rados
+ services:
+ - rgw
+ enum_values:
+ - rados
+ - dbstore
+ - json
- name: rgw_filter
type: str
level: advanced
default: dbstore
services:
- rgw
+- name: dbstore_config_uri
+ type: str
+ level: advanced
+ desc: 'Config database URI. URIs beginning with file: refer to local files opened with SQLite.'
+ default: file:/var/lib/ceph/radosgw/dbstore-config.db
+ see_also:
+ - rgw_config_store
+ services:
+ - rgw
+- name: rgw_json_config
+ type: str
+ level: advanced
+ desc: Path to a json file that contains the static zone and zonegroup configuration. Requires rgw_config_store=json.
+ default: /var/lib/ceph/radosgw/config.json
+ see_also:
+ - rgw_config_store
+ services:
+ - rgw
- name: motr_profile_fid
type: str
level: advanced
#include "rgw_sal.h"
#include "rgw_sal_rados.h"
+#include "store/rados/config/store.h"
+#include "store/json_config/store.h"
#include "rgw_d3n_datacache.h"
#ifdef WITH_RADOSGW_DBSTORE
#include "rgw_sal_dbstore.h"
+#include "store/dbstore/config/store.h"
#endif
#ifdef WITH_RADOSGW_MOTR
return cfg;
}
+auto StoreManager::create_config_store(const DoutPrefixProvider* dpp,
+ std::string_view type)
+ -> std::unique_ptr<rgw::sal::ConfigStore>
+{
+ try {
+ if (type == "rados") {
+ return rgw::rados::create_config_store(dpp);
+#ifdef WITH_RADOSGW_DBSTORE
+ } else if (type == "dbstore") {
+ const auto uri = g_conf().get_val<std::string>("dbstore_config_uri");
+ return rgw::dbstore::create_config_store(dpp, uri);
+#endif
+ } else if (type == "json") {
+ auto filename = g_conf().get_val<std::string>("rgw_json_config");
+ return rgw::sal::create_json_config_store(dpp, filename);
+ } else {
+ ldpp_dout(dpp, -1) << "ERROR: unrecognized config store type '"
+ << type << "'" << dendl;
+ return nullptr;
+ }
+ } catch (const std::exception& e) {
+ ldpp_dout(dpp, -1) << "ERROR: failed to initialize config store '"
+ << type << "': " << e.what() << dendl;
+ }
+ return nullptr;
+}
+
namespace rgw::sal {
int Object::range_to_ofs(uint64_t obj_size, int64_t &ofs, int64_t &end)
{
/** Get the config for stores/filters */
static Config get_config(bool admin, CephContext* cct);
+
+ /** Create a ConfigStore */
+ static auto create_config_store(const DoutPrefixProvider* dpp,
+ std::string_view type)
+ -> std::unique_ptr<rgw::sal::ConfigStore>;
+
};
/** @} */