64 member_ips_and_ports, joined, departed, profile);
66 std::vector<int> is_sender,
67 const std::vector<std::tuple<ip_addr_t, uint16_t, uint16_t, uint16_t, uint16_t>>& member_ips_and_ports,
68 const std::vector<node_id_t>& joined,
69 const std::vector<node_id_t>& departed,
70 const std::string &profile)
74 member_ips_and_ports(member_ips_and_ports),
80 SubView(
Mode mode,
const std::vector<node_id_t>& members,
81 std::vector<int> is_sender,
82 const std::vector<std::tuple<ip_addr_t, uint16_t, uint16_t, uint16_t, uint16_t>>& member_ips_and_ports,
120 bool is_adequately_provisioned =
true;
149 bool i_know_i_am_leader =
false;
163 int rank_of(
const std::tuple<ip_addr_t, uint16_t, uint16_t, uint16_t, uint16_t>& who)
const;
167 int find_rank_of_leader()
const;
169 bool i_am_leader()
const;
171 bool i_am_new_leader();
173 void merge_changes();
180 int subview_rank_of_shard_leader(
subgroup_id_t subgroup_id, uint32_t shard_index)
const;
184 std::string debug_string()
const;
187 failed, num_failed, joined, departed,
188 num_members, next_unassigned_rank,
189 subgroup_ids_by_type_id, subgroup_shard_views, my_subgroups);
196 View(
const int32_t vid,
const std::vector<node_id_t>& members,
197 const std::vector<std::tuple<ip_addr_t, uint16_t, uint16_t, uint16_t, uint16_t>>& member_ips_and_ports,
198 const std::vector<char>& failed,
const int32_t num_failed,
199 const std::vector<node_id_t>& joined,
200 const std::vector<node_id_t>& departed,
const int32_t num_members,
201 const int32_t next_unassigned_rank,
202 const std::map<
subgroup_type_id_t, std::vector<subgroup_id_t>>& subgroup_ids_by_type_id,
203 const std::vector<std::vector<SubView>>& subgroup_shard_views,
204 const std::map<subgroup_id_t, uint32_t>& my_subgroups);
207 View(
const int32_t vid,
const std::vector<node_id_t>& members,
208 const std::vector<std::tuple<ip_addr_t, uint16_t, uint16_t, uint16_t, uint16_t>>& member_ips_and_ports,
209 const std::vector<char>& failed,
210 const std::vector<node_id_t>& joined,
211 const std::vector<node_id_t>& departed,
const int32_t my_rank,
212 const int32_t next_unassigned_rank,
213 const std::vector<std::type_index>& subgroup_type_order);
uint32_t subgroup_id_t
Type alias for the internal Subgroup IDs generated by ViewManager.
std::vector< std::vector< SubView > > subgroup_shard_views
Maps subgroup ID -> shard number -> SubView for that subgroup/shard.
const std::vector< node_id_t > members
Node IDs of members in the current view, indexed by their SST rank.
std::vector< int > is_sender
vector selecting the senders, 0 for non-sender, non-0 for sender
uint32_t subgroup_type_id_t
Type of the numeric ID used to refer to subgroup types within a Group; this is currently computed as ...
int32_t next_unassigned_rank
The rank of the lowest-ranked member that is not assigned to a subgroup in this View.
int rank_of(const node_id_t &who) const
Looks up the sub-view rank of a node ID.
SubView(int32_t num_members)
Creates an empty new SubView with num_members members.
int32_t my_rank
The rank of this node within the subgroup/shard, or -1 if this node is not a member of the subgroup/s...
std::map< subgroup_id_t, uint32_t > my_subgroups
Lists the (subgroup ID, shard num) pairs that this node is a member of.
std::unique_ptr< MulticastGroup > multicast_group
RDMC manager object used for sending multicasts.
const std::string profile
Settings for the subview.
std::vector< node_id_t > departed
List of IDs of nodes that left since the previous view, if any.
std::vector< node_id_t > departed
List of IDs of nodes that left since the previous view, if any.
std::vector< char > failed
failed[i] is true if members[i] is considered to have failed.
std::shared_ptr< DerechoSST > gmsSST
Pointer to the SST instance used by the GMS in this View.
A non-POD type which wishes to mark itself byte representable should extend this class.
std::vector< std::tuple< ip_addr_t, uint16_t, uint16_t, uint16_t, uint16_t > > member_ips_and_ports
IP addresses and ports of members in this subgroup/shard, with the same indices as members...
std::map< subgroup_type_id_t, std::vector< subgroup_id_t > > subgroup_ids_by_type_id
Maps the (type, index) pairs used by users to identify subgroups to the internal subgroup IDs generat...
int32_t num_failed
Number of current outstanding failures in this view.
const std::vector< std::tuple< ip_addr_t, uint16_t, uint16_t, uint16_t, uint16_t > > member_ips_and_ports
IP addresses and ports (gms, rpc, sst, rdmc in order) of members in the current view, indexed by their SST rank.
int sender_rank_of(uint32_t rank) const
Looks up the sender rank of a given member.
const int32_t vid
Sequential view ID: 0, 1, ...
uint32_t node_id_t
Type alias for Node IDs in a Derecho group.
The subset of a View associated with a single shard, or a single subgroup if the subgroup is non-shar...
std::vector< node_id_t > members
Node IDs of members in this subgroup/shard, indexed by their order in the SST.
uint32_t num_senders() const
returns the number of senders in the subview
Mode mode
Operation mode, raw mode does not do stability and delivery.
void init_joined_departed(const SubView &previous_subview)
Initialization helper method that initializes the joined and departed lists given the previous View's...
std::vector< std::type_index > subgroup_type_order
The order of subgroup types as they were declared in the Group's template parameters.
int32_t my_rank
The rank of this node (as returned by rank_of())
std::vector< node_id_t > joined
List of IDs of nodes that joined since the previous view, if any.
SubView(Mode mode, const std::vector< node_id_t > &members, std::vector< int > is_sender, const std::vector< std::tuple< ip_addr_t, uint16_t, uint16_t, uint16_t, uint16_t >> &member_ips_and_ports, const std::vector< node_id_t > &joined, const std::vector< node_id_t > &departed, const std::string &profile)
std::map< node_id_t, uint32_t > node_id_to_rank
Reverse index of members[]; maps node ID -> SST rank.
std::vector< node_id_t > joined
List of IDs of nodes that joined since the previous view, if any.
DEFAULT_SERIALIZATION_SUPPORT(SubView, mode, members, is_sender, member_ips_and_ports, joined, departed, profile)
const int32_t num_members
Number of members in this view.