40 if (consider_score && (node->
weight < 0)) {
48 if (guest->
fns->
location(guest, NULL, FALSE) == NULL) {
67 GHashTable *new_table = NULL;
75 g_hash_table_iter_init(&iter, nodes);
76 while (g_hash_table_iter_next(&iter, NULL, (gpointer *) &node)) {
79 g_hash_table_insert(new_table, (gpointer) new_node->
details->
id,
99 for (
const GList *gIter = list; gIter != NULL; gIter = gIter->next) {
127 compare_nodes(gconstpointer a, gconstpointer b, gpointer
data)
133 int node1_weight = 0;
134 int node2_weight = 0;
150 if (node1_weight > node2_weight) {
152 pe__node_name(
node1), node1_weight, pe__node_name(
node2),
157 if (node1_weight < node2_weight) {
159 pe__node_name(
node1), node1_weight, pe__node_name(
node2),
165 pe__node_name(
node1), node1_weight, pe__node_name(
node2),
192 crm_trace(
"%s (%d) > %s (%d) : resources",
198 crm_trace(
"%s (%d) < %s (%d) : resources",
206 if (active != NULL) {
239 return g_list_sort_with_data(nodes, compare_nodes, active_node);
260 g_hash_table_iter_init(&iter, nodes);
261 while (g_hash_table_iter_next(&iter, NULL, (
void **) &node)) {
287 crm_info(
"Applying node health strategy '%s'", strategy_str);
294 for (GList *iter =
data_set->
nodes; iter != NULL; iter = iter->next) {
302 crm_info(
"Overall system health of %s is %d",
303 pe__node_name(node), health);
309 bool constrain =
true;
323 rsc->
id, pe__node_name(node));
342 GHashTable *allowed_nodes = NULL;
344 if ((rsc == NULL) || (node == NULL)) {
346 }
else if (rsc->
parent == NULL) {
351 return pe_hash_table_lookup(allowed_nodes, node->
details->
id);
pe_node_t * pcmk__top_allowed_node(const pe_resource_t *rsc, const pe_node_t *node)
pe_resource_t * container
pe_resource_t * remote_rsc
resource_object_functions_t * fns
pe_node_t * pe__copy_node(const pe_node_t *this_node)
const char * pe_pref(GHashTable *options, const char *name)
void pcmk__apply_node_health(pe_working_set_t *data_set)
GList * pcmk__sort_nodes(GList *nodes, pe_node_t *active_node)
bool pcmk__node_available(const pe_node_t *node, bool consider_score, bool consider_guest)
enum pcmk__health_strategy pcmk__parse_health_strategy(const char *value)
pe_working_set_t * data_set
Cluster that this node is part of.
bool pcmk__any_node_available(GHashTable *nodes)
pe_node_t *(* location)(const pe_resource_t *, GList **, int)
bool pe__is_guest_node(const pe_node_t *node)
#define PCMK__OPT_NODE_HEALTH_BASE
#define crm_trace(fmt, args...)
GList * pcmk__copy_node_list(const GList *list, bool reset)
struct pe_node_shared_s * details
pe_working_set_t * data_set
const char * placement_strategy
#define PCMK__OPT_NODE_HEALTH_STRATEGY
#define PCMK__META_ALLOW_UNHEALTHY_NODES
G_GNUC_INTERNAL pe__location_t * pcmk__new_location(const char *id, pe_resource_t *rsc, int node_weight, const char *discover_mode, pe_node_t *foo_node, pe_working_set_t *data_set)
GHashTable * pcmk__copy_node_table(GHashTable *nodes)
GHashTable * pcmk__strkey_table(GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func)
pcmk__action_result_t result
G_GNUC_INTERNAL int pcmk__compare_node_capacities(const pe_node_t *node1, const pe_node_t *node2)
gboolean crm_is_true(const char *s)
#define pe_rsc_trace(rsc, fmt, args...)
int pe__sum_node_health_scores(const pe_node_t *node, int base_health)
#define crm_info(fmt, args...)
GHashTable * allowed_nodes