Files
scylladb/api/hinted_handoff.cc
Amnon Heiman 3b4ce5a219 API: Adding a stub implementation for hinted_handoff metrics
This adds a stub implementation for the hinted handoff metrics.
The stubbed methods return the correct type, but with a stub value.
After this patch the following path will be available:
/hinted_handoff/metrics/create_hint/{addr}
/hinted_handoff/metrics/not_stored_hints/{addr}

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-05 16:42:54 +03:00

53 lines
1.5 KiB
C++

/*
* Copyright 2015 Cloudius Systems
*/
#include "hinted_handoff.hh"
#include "api/api-doc/hinted_handoff.json.hh"
namespace api {
using namespace scollectd;
namespace hh = httpd::hinted_handoff_json;
void set_hinted_handoff(http_context& ctx, routes& r) {
hh::list_endpoints_pending_hints.set(r, [] (std::unique_ptr<request> req) {
//TBD
std::vector<sstring> res;
return make_ready_future<json::json_return_type>(res);
});
hh::truncate_all_hints.set(r, [] (std::unique_ptr<request> req) {
//TBD
sstring host = req->get_query_param("host");
return make_ready_future<json::json_return_type>("");
});
hh::schedule_hint_delivery.set(r, [] (std::unique_ptr<request> req) {
//TBD
sstring host = req->get_query_param("host");
return make_ready_future<json::json_return_type>("");
});
hh::pause_hints_delivery.set(r, [] (std::unique_ptr<request> req) {
//TBD
sstring pause = req->get_query_param("pause");
return make_ready_future<json::json_return_type>("");
});
hh::get_create_hint_count.set(r, [] (std::unique_ptr<request> req) {
//TBD
sstring host = req->get_query_param("host");
return make_ready_future<json::json_return_type>(0);
});
hh::get_not_stored_hints_count.set(r, [] (std::unique_ptr<request> req) {
//TBD
sstring host = req->get_query_param("host");
return make_ready_future<json::json_return_type>(0);
});
}
}