Derecho  0.9
Distributed systems toolkit for RDMA
Public Member Functions | Public Attributes | List of all members
derecho::SubView Class Reference

The subset of a View associated with a single shard, or a single subgroup if the subgroup is non-sharded. More...

#include <view.hpp>

Inheritance diagram for derecho::SubView:
Inheritance graph
[legend]
Collaboration diagram for derecho::SubView:
Collaboration graph
[legend]

Public Member Functions

int rank_of (const node_id_t &who) const
 Looks up the sub-view rank of a node ID. More...
 
int sender_rank_of (uint32_t rank) const
 Looks up the sender rank of a given member. More...
 
uint32_t num_senders () const
 returns the number of senders in the subview More...
 
 SubView (int32_t num_members)
 Creates an empty new SubView with num_members members. More...
 
 DEFAULT_SERIALIZATION_SUPPORT (SubView, mode, members, is_sender, member_ips_and_ports, joined, departed, profile)
 
 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)
 
 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, std::string profile)
 
void init_joined_departed (const SubView &previous_subview)
 Initialization helper method that initializes the joined and departed lists given the previous View's version of this SubView. More...
 
- Public Member Functions inherited from mutils::ByteRepresentable
virtual std::size_t to_bytes (char *v) const =0
 Write this class's marshalled representation into the array found at v. More...
 
virtual void post_object (const std::function< void(char const *const, std::size_t)> &) const =0
 Pass a pointer to a buffer containing this class's marshalled representation into the function f. More...
 
virtual std::size_t bytes_size () const =0
 the size of the marshalled representation of this object. More...
 
virtual ~ByteRepresentable ()
 

Public Attributes

Mode mode
 Operation mode, raw mode does not do stability and delivery. More...
 
std::vector< node_id_tmembers
 Node IDs of members in this subgroup/shard, indexed by their order in the SST. More...
 
std::vector< int > is_sender
 vector selecting the senders, 0 for non-sender, non-0 for sender More...
 
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. More...
 
std::vector< node_id_tjoined
 List of IDs of nodes that joined since the previous view, if any. More...
 
std::vector< node_id_tdeparted
 List of IDs of nodes that left since the previous view, if any. More...
 
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/shard. More...
 
const std::string profile
 Settings for the subview. More...
 

Detailed Description

The subset of a View associated with a single shard, or a single subgroup if the subgroup is non-sharded.

Definition at line 31 of file view.hpp.

Constructor & Destructor Documentation

◆ SubView() [1/3]

derecho::SubView::SubView ( int32_t  num_members)

Creates an empty new SubView with num_members members.

The vectors will have room for num_members elements.

Definition at line 15 of file view.cpp.

◆ SubView() [2/3]

derecho::SubView::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 
)
inline

Definition at line 65 of file view.hpp.

◆ SubView() [3/3]

derecho::SubView::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,
std::string  profile 
)

Definition at line 25 of file view.cpp.

Member Function Documentation

◆ DEFAULT_SERIALIZATION_SUPPORT()

derecho::SubView::DEFAULT_SERIALIZATION_SUPPORT ( SubView  ,
mode  ,
members  ,
is_sender  ,
member_ips_and_ports  ,
joined  ,
departed  ,
profile   
)

◆ init_joined_departed()

void derecho::SubView::init_joined_departed ( const SubView previous_subview)

Initialization helper method that initializes the joined and departed lists given the previous View's version of this SubView.

This should be called after using the fewer-parameters constructor to finish setting up the SubView.

Parameters
previous_subviewThe previous SubView to compare against

Definition at line 76 of file view.cpp.

◆ num_senders()

uint32_t derecho::SubView::num_senders ( ) const

returns the number of senders in the subview

Definition at line 66 of file view.cpp.

◆ rank_of()

int derecho::SubView::rank_of ( const node_id_t who) const

Looks up the sub-view rank of a node ID.

Returns -1 if that node ID is not a member of this subgroup/shard.

Definition at line 44 of file view.cpp.

◆ sender_rank_of()

int derecho::SubView::sender_rank_of ( uint32_t  rank) const

Looks up the sender rank of a given member.

Returns -1 if the member isn't a sender

Definition at line 53 of file view.cpp.

Member Data Documentation

◆ departed

std::vector<node_id_t> derecho::SubView::departed

List of IDs of nodes that left since the previous view, if any.

Definition at line 45 of file view.hpp.

◆ is_sender

std::vector<int> derecho::SubView::is_sender

vector selecting the senders, 0 for non-sender, non-0 for sender

integers instead of booleans due to the serialization issue :-/

Definition at line 39 of file view.hpp.

◆ joined

std::vector<node_id_t> derecho::SubView::joined

List of IDs of nodes that joined since the previous view, if any.

Definition at line 43 of file view.hpp.

◆ member_ips_and_ports

std::vector<std::tuple<ip_addr_t, uint16_t, uint16_t, uint16_t, uint16_t> > derecho::SubView::member_ips_and_ports

IP addresses and ports of members in this subgroup/shard, with the same indices as members.

Definition at line 41 of file view.hpp.

◆ members

std::vector<node_id_t> derecho::SubView::members

Node IDs of members in this subgroup/shard, indexed by their order in the SST.

Definition at line 36 of file view.hpp.

◆ mode

Mode derecho::SubView::mode

Operation mode, raw mode does not do stability and delivery.

Definition at line 34 of file view.hpp.

◆ my_rank

int32_t derecho::SubView::my_rank

The rank of this node within the subgroup/shard, or -1 if this node is not a member of the subgroup/shard.

This is initialized by ViewManager, not the subgroup allocation functions that create SubViews.

Definition at line 49 of file view.hpp.

◆ profile

const std::string derecho::SubView::profile

Settings for the subview.

Definition at line 51 of file view.hpp.


The documentation for this class was generated from the following files: