mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-30 05:07:05 +00:00
API: Add a reference to storage_proxy into API context
The API needs to call the storage_proxy, for that a reference to the distribute storage_proxy is added to the context and is set in main. Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "http/httpd.hh"
|
||||
#include "database.hh"
|
||||
#include "service/storage_proxy.hh"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <boost/algorithm/string/classification.hpp>
|
||||
@@ -17,7 +18,9 @@ struct http_context {
|
||||
sstring api_dir;
|
||||
http_server_control http_server;
|
||||
distributed<database>& db;
|
||||
http_context(distributed<database>& _db) : db(_db) {}
|
||||
distributed<service::storage_proxy>& sp;
|
||||
http_context(distributed<database>& _db, distributed<service::storage_proxy>&
|
||||
_sp) : db(_db), sp(_sp) {}
|
||||
};
|
||||
|
||||
future<> set_server(http_context& ctx);
|
||||
|
||||
2
main.cc
2
main.cc
@@ -45,7 +45,7 @@ int main(int ac, char** av) {
|
||||
distributed<database> db;
|
||||
distributed<cql3::query_processor> qp;
|
||||
distributed<service::storage_proxy> proxy;
|
||||
api::http_context ctx(db);
|
||||
api::http_context ctx(db, proxy);
|
||||
|
||||
return app.run(ac, av, [&] {
|
||||
auto&& opts = app.configuration();
|
||||
|
||||
Reference in New Issue
Block a user