Derecho-Project / derecho

The main code repository for the Derecho project.
BSD 3-Clause "New" or "Revised" License
187 stars 47 forks source link

External Client #152

Closed xinzheyang closed 4 years ago

xinzheyang commented 4 years ago

This is the implementation of external client, addressing #96.

Public Interface

ExternalGroup introduced in include/derecho/core/external_group.hpp is a light-weight "group" for external clients to communicate the Derecho group members without actually joining the group. It exposes

template <typename SubgroupType>
ExternalClientCaller<SubgroupType, ReplicatedTypes...>& get_ref(uint32_t subgroup_index = 0);

that returns a reference to a ExternalClientCaller upon which the user may call

p2p_send(node_id_t dest_node, Args&&... args);

just like the existing p2p_send API for Derecho group members.

The following additional APIs will give users information about the view so that they can decide what to pass in get_ref and p2p_send.

update_view();
get_members();
get_shard_members(subgroup_id, shard_num);
template <typename SubgroupType>
get_shard_members(subgroup_index, shard_num);

In case of exceptions, users will have the option to update_view() and try p2p_send on a different node.

See src/applications/archive/external_client_tester.cpp for an example application.

Implementation Details