api: Squash (un)set_cache_service into ..._column_family
The set_server_column_family() registers API handlers that work with replica::database. The set_server_cache() does the very same thing, but registers handlers with some other prefix. Squash the latter into former, later "cache" handlers will also make use of the database reference argument that's already available in ..._column_family() setter. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
16
api/api.cc
16
api/api.cc
@@ -229,10 +229,15 @@ future<> set_server_column_family(http_context& ctx, sharded<replica::database>&
|
||||
"The column family API", [&db, &sys_ks] (http_context& ctx, routes& r) {
|
||||
set_column_family(ctx, r, db, sys_ks);
|
||||
});
|
||||
co_await register_api(ctx, "cache_service",
|
||||
"The cache service API", set_cache_service);
|
||||
}
|
||||
|
||||
future<> unset_server_column_family(http_context& ctx) {
|
||||
return ctx.http_server.set_routes([&ctx] (routes& r) { unset_column_family(ctx, r); });
|
||||
return ctx.http_server.set_routes([&ctx] (routes& r) {
|
||||
unset_column_family(ctx, r);
|
||||
unset_cache_service(ctx, r);
|
||||
});
|
||||
}
|
||||
|
||||
future<> set_server_messaging_service(http_context& ctx, sharded<netw::messaging_service>& ms) {
|
||||
@@ -264,15 +269,6 @@ future<> unset_server_stream_manager(http_context& ctx) {
|
||||
return ctx.http_server.set_routes([&ctx] (routes& r) { unset_stream_manager(ctx, r); });
|
||||
}
|
||||
|
||||
future<> set_server_cache(http_context& ctx) {
|
||||
return register_api(ctx, "cache_service",
|
||||
"The cache service API", set_cache_service);
|
||||
}
|
||||
|
||||
future<> unset_server_cache(http_context& ctx) {
|
||||
return ctx.http_server.set_routes([&ctx] (routes& r) { unset_cache_service(ctx, r); });
|
||||
}
|
||||
|
||||
future<> set_hinted_handoff(http_context& ctx, sharded<service::storage_proxy>& proxy, sharded<gms::gossiper>& g) {
|
||||
return register_api(ctx, "hinted_handoff",
|
||||
"The hinted handoff API", [&proxy, &g] (http_context& ctx, routes& r) {
|
||||
|
||||
@@ -126,8 +126,6 @@ future<> set_server_stream_manager(http_context& ctx, sharded<streaming::stream_
|
||||
future<> unset_server_stream_manager(http_context& ctx);
|
||||
future<> set_hinted_handoff(http_context& ctx, sharded<service::storage_proxy>& p, sharded<gms::gossiper>& g);
|
||||
future<> unset_hinted_handoff(http_context& ctx);
|
||||
future<> set_server_cache(http_context& ctx);
|
||||
future<> unset_server_cache(http_context& ctx);
|
||||
future<> set_server_compaction_manager(http_context& ctx, sharded<compaction_manager>& cm);
|
||||
future<> unset_server_compaction_manager(http_context& ctx);
|
||||
future<> set_server_done(http_context& ctx);
|
||||
|
||||
5
main.cc
5
main.cc
@@ -2080,11 +2080,6 @@ sharded<locator::shared_token_metadata> token_metadata;
|
||||
api::unset_server_tasks_compaction_module(ctx).get();
|
||||
});
|
||||
|
||||
api::set_server_cache(ctx).get();
|
||||
auto stop_cache_api = defer_verbose_shutdown("cache API", [&ctx] {
|
||||
api::unset_server_cache(ctx).get();
|
||||
});
|
||||
|
||||
api::set_server_commitlog(ctx, db).get();
|
||||
auto stop_commitlog_api = defer_verbose_shutdown("commitlog API", [&ctx] {
|
||||
api::unset_server_commitlog(ctx).get();
|
||||
|
||||
Reference in New Issue
Block a user