From d0ce45efbbcbe5f8652211b16fa4c4ea58cd0bdf Mon Sep 17 00:00:00 2001 From: Amnon Heiman Date: Sun, 12 Jul 2015 14:10:56 +0300 Subject: [PATCH] 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 --- api/api.hh | 5 ++++- main.cc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/api.hh b/api/api.hh index acba848e72..437139be08 100644 --- a/api/api.hh +++ b/api/api.hh @@ -7,6 +7,7 @@ #include "http/httpd.hh" #include "database.hh" +#include "service/storage_proxy.hh" #include #include #include @@ -17,7 +18,9 @@ struct http_context { sstring api_dir; http_server_control http_server; distributed& db; - http_context(distributed& _db) : db(_db) {} + distributed& sp; + http_context(distributed& _db, distributed& + _sp) : db(_db), sp(_sp) {} }; future<> set_server(http_context& ctx); diff --git a/main.cc b/main.cc index 631c42f9ab..e4db93b47c 100644 --- a/main.cc +++ b/main.cc @@ -45,7 +45,7 @@ int main(int ac, char** av) { distributed db; distributed qp; distributed proxy; - api::http_context ctx(db); + api::http_context ctx(db, proxy); return app.run(ac, av, [&] { auto&& opts = app.configuration();