Collaboration diagram for Node Subsystem:
![]() |
Data Structures | |
struct | node_address |
struct | node_info |
Functions | |
bs_status | init_node (apr_pool_t *mp) |
bs_status | add_node (const char *address, bs_uint16 port) |
bs_status | remove_node (const char *address, bs_uint16 port) |
node_info * | get_servicing_node (const bs_service_request *def) |
bs_uint32 | ping_node (const char *address, bs_uint16 port, apr_pool_t *mp) |
Add a node to the list of known nodes. This function will use the global memory pool since the node info has to be allocated from a pool that is persistent (unlike the temporal pools of threads).
address | Address (IP or hostname) of the node | |
port | Port on which the node is listening | |
mp | Memory pool to use for temporal things (such as setting up a connection) |
Definition at line 90 of file node.c.
References node_info::address, node_address::address, BS_ERROR, BS_OK, connect_and_get(), FALSE, global_mp, node_info::last_seen, list_append(), list_index(), list_insert(), list_size(), lock_node_mux(), lock_pool_mux(), node_already_known(), nodes, node_info::ping, ping_node(), node_address::port, runtestsuite::rv, node_info::services, TRUE, unlock_node_mux(), and unlock_pool_mux().
Referenced by add_node_to_global_list().
Here is the call graph for this function:
node_info* get_servicing_node | ( | const bs_service_request * | def | ) |
Returns a node info structure of the first node that can service the given request.
req | The request to match with nodes services |
Definition at line 180 of file node.c.
References list_index(), list_size(), lock_node_mux(), nodes, request_corresponds_with_definition(), and unlock_node_mux().
Referenced by handle_service_request_remotely().
Here is the call graph for this function:
bs_status init_node | ( | apr_pool_t * | mp | ) |
Try to connect to a given node and measure how long this takes.
address | Address of the node | |
port | Port on which it is listening |
Definition at line 156 of file node.c.
References runtestsuite::rv.
Referenced by add_node(), and main().
Remove a node from the list of known nodes.
address | Address (IP or hostname) of the node | |
port | Port on which the node is listening |
Definition at line 138 of file node.c.
References node_address::address, BS_OK, list_index(), list_remove(), list_size(), lock_node_mux(), nodes, node_address::port, streq(), and unlock_node_mux().
Here is the call graph for this function: