Files
scylladb/redis/query_processor.cc
Avi Kivity f3eade2f62 treewide: relicense to ScyllaDB-Source-Available-1.0
Drop the AGPL license in favor of a source-available license.
See the blog post [1] for details.

[1] https://www.scylladb.com/2024/12/18/why-were-moving-to-a-source-available-license/
2024-12-18 17:45:13 +02:00

49 lines
1.2 KiB
C++

/*
* Copyright (C) 2019 pengjian.uestc @ gmail.com
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
*/
#include "redis/query_processor.hh"
#include "redis/request.hh"
#include "redis/reply.hh"
#include "redis/command_factory.hh"
#include "redis/options.hh"
#include "service_permit.hh"
namespace redis {
distributed<query_processor> _the_query_processor;
query_processor::query_processor(service::storage_proxy& proxy, data_dictionary::database db)
: _proxy(proxy)
, _db(db)
{
}
query_processor::~query_processor() {
}
future<> query_processor::start() {
return make_ready_future<>();
}
future<> query_processor::stop() {
// wait for all running command finished.
return _pending_command_gate.close().then([] {
return make_ready_future<>();
});
}
future<redis_message> query_processor::process(request&& req, redis::redis_options& opts, service_permit permit) {
return do_with(std::move(req), [this, &opts, permit] (auto& req) {
return with_gate(_pending_command_gate, [this, &req, &opts, permit] () mutable {
return command_factory::create_execute(_proxy, req, opts, permit);
});
});
}
}