コード例 #1
0
/**
 * Locate Node Group
 * For a given Node ID, return the Group ID that goes with it.
 * RETURN:
 * (*) Success: Return the group id
 * (*) Failure: Return -1
 */
int
cc_locate_node_group(const cluster_config_t * cc, const cc_node_t node_id) {

	int node_index = cc_locate_node(cc, node_id);
	int group_index = cc->membership[ node_index];
	cc_group_t group_id = cc->group_ids[group_index];

	return group_id;
} // end locate_node_group()
コード例 #2
0
/**
 * Locate Node Group
 * For a given Node ID, return the Group ID that goes with it.
 * RETURN:
 * (*) Success: Return the group id
 * (*) Failure: Return -1
 */
int
cc_locate_node_group(cluster_config_t * cc, cc_node_t node_id ) {
//	static char * meth = "locate_node_group()";
//	printf("[ENTER]<%s:%s> Locate Node ID (%u)\n", MOD, meth, node_id );

	int node_index = cc_locate_node( cc, node_id );
	int group_index = cc->membership[ node_index];
	cc_group_t group_id = cc->group_ids[group_index];

	return group_id;
} // end locate_node_group()