diff --git a/main.cc b/main.cc index 936e3fe9ce..3717b62ec7 100644 --- a/main.cc +++ b/main.cc @@ -1209,7 +1209,7 @@ int main(int ac, char** av) { api::unset_transport_controller(ctx).get(); }); - ::thrift_controller thrift_ctl(db, auth_service); + ::thrift_controller thrift_ctl(db, auth_service, qp); ss.register_client_shutdown_hook("rpc server", [&thrift_ctl] { thrift_ctl.stop().get(); diff --git a/thrift/controller.cc b/thrift/controller.cc index 2a5a24b3d3..510543efae 100644 --- a/thrift/controller.cc +++ b/thrift/controller.cc @@ -27,10 +27,11 @@ static logging::logger clogger("thrift_controller"); -thrift_controller::thrift_controller(distributed& db, sharded& auth) +thrift_controller::thrift_controller(distributed& db, sharded& auth, sharded& qp) : _ops_sem(1) , _db(db) - , _auth_service(auth) { + , _auth_service(auth) + , _qp(qp) { } future<> thrift_controller::start_server() { @@ -61,7 +62,7 @@ future<> thrift_controller::do_start_server() { tsc.timeout_config = make_timeout_config(cfg); tsc.max_request_size = cfg.thrift_max_message_length_in_mb() * (uint64_t(1) << 20); return gms::inet_address::lookup(addr, family, preferred).then([this, tserver, addr, port, keepalive, tsc] (gms::inet_address ip) { - return tserver->start(std::ref(_db), std::ref(cql3::get_query_processor()), std::ref(_auth_service), tsc).then([tserver, port, addr, ip, keepalive] { + return tserver->start(std::ref(_db), std::ref(_qp), std::ref(_auth_service), tsc).then([tserver, port, addr, ip, keepalive] { // #293 - do not stop anything //engine().at_exit([tserver] { // return tserver->stop(); diff --git a/thrift/controller.hh b/thrift/controller.hh index 01ffad95ce..0a404d21a9 100644 --- a/thrift/controller.hh +++ b/thrift/controller.hh @@ -30,6 +30,7 @@ using namespace seastar; class thrift_server; class database; namespace auth { class service; } +namespace cql3 { class query_processor; } class thrift_controller { std::unique_ptr> _server; @@ -38,12 +39,13 @@ class thrift_controller { distributed& _db; sharded& _auth_service; + sharded& _qp; future<> do_start_server(); future<> do_stop_server(); public: - thrift_controller(distributed&, sharded&); + thrift_controller(distributed&, sharded&, sharded&); future<> start_server(); future<> stop_server(); future<> stop();