messaging_service: Add wrapper for READ_MUTATION_DATA verb

This commit is contained in:
Asias He
2015-07-16 08:53:48 +08:00
parent 85c6dc0b7e
commit c19f5edefe
3 changed files with 13 additions and 2 deletions

View File

@@ -293,4 +293,11 @@ future<query::result> messaging_service::send_read_data(shard_id id, query::read
return send_message<query::result>(messaging_verb::READ_DATA, std::move(id), cmd, pr);
}
void messaging_service::register_read_mutation_data(std::function<future<foreign_ptr<lw_shared_ptr<reconcilable_result>>> (query::read_command cmd, query::partition_range pr)>&& func) {
register_handler(net::messaging_verb::READ_MUTATION_DATA, std::move(func));
}
future<reconcilable_result> messaging_service::send_read_mutation_data(shard_id id, query::read_command& cmd, query::partition_range& pr) {
return send_message<reconcilable_result>(messaging_verb::READ_MUTATION_DATA, std::move(id), cmd, pr);
}
} // namespace net

View File

@@ -423,6 +423,10 @@ public:
void register_read_data(std::function<future<foreign_ptr<lw_shared_ptr<query::result>>> (query::read_command cmd, query::partition_range pr)>&& func);
future<query::result> send_read_data(shard_id id, query::read_command& cmd, query::partition_range& pr);
// Wrapper for READ_MUTATION_DATA
void register_read_mutation_data(std::function<future<foreign_ptr<lw_shared_ptr<reconcilable_result>>> (query::read_command cmd, query::partition_range pr)>&& func);
future<reconcilable_result> send_read_mutation_data(shard_id id, query::read_command& cmd, query::partition_range& pr);
private:
// Return rpc::protocol::client for a shard which is a ip + cpuid pair.
rpc_protocol_client_wrapper& get_rpc_client(shard_id id);