pacemaker  2.0.2-debe490
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2019 the Pacemaker project contributors
3  *
4  * The version control history for this file may have further details.
5  *
6  * This source code is licensed under the GNU Lesser General Public License
7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8  */
10 #ifndef PENGINE_AUTILS__H
11 # define PENGINE_AUTILS__H
13 /* Constraint helper functions */
18 pe__location_t *rsc2node_new(const char *id, pe_resource_t *rsc, int weight,
19  const char *discovery_mode, pe_node_t *node,
20  pe_working_set_t *data_set);
22 extern gboolean rsc_colocation_new(const char *id, const char *node_attr, int score,
23  resource_t * rsc_lh, resource_t * rsc_rh,
24  const char *state_lh, const char *state_rh,
25  pe_working_set_t * data_set);
27 extern gboolean rsc_ticket_new(const char *id, resource_t * rsc_lh, ticket_t * ticket,
28  const char *state_lh, const char *loss_policy,
29  pe_working_set_t * data_set);
31 GList *sort_nodes_by_weight(GList *nodes, pe_node_t *active_node,
32  pe_working_set_t *data_set);
34 extern gboolean can_run_resources(const node_t * node);
35 extern gboolean native_assign_node(resource_t * rsc, GListPtr candidates, node_t * chosen,
36  gboolean force);
37 void native_deallocate(resource_t * rsc);
39 extern void log_action(unsigned int log_level, const char *pre_text,
40  action_t * action, gboolean details);
42 gboolean can_run_any(GHashTable * nodes);
44  pe_resource_t *rsc, enum rsc_role_e filter,
45  gboolean current,
46  pe_working_set_t *data_set);
47 resource_t *find_compatible_child_by_node(resource_t * local_child, node_t * local_node, resource_t * rsc,
48  enum rsc_role_e filter, gboolean current);
49 gboolean is_child_compatible(resource_t *child_rsc, node_t * local_node, enum rsc_role_e filter, gboolean current);
50 bool assign_node(resource_t * rsc, node_t * node, gboolean force);
51 enum pe_action_flags summary_action_flags(action_t * action, GListPtr children, node_t * node);
53 int copies_per_node(resource_t * rsc);
59 };
61 extern enum filter_colocation_res
63  rsc_colocation_t * constraint, gboolean preview);
65 extern int compare_capacity(const node_t * node1, const node_t * node2);
66 extern void calculate_utilization(GHashTable * current_utilization,
67  GHashTable * utilization, gboolean plus);
69 extern void process_utilization(resource_t * rsc, node_t ** prefer, pe_working_set_t * data_set);
70 pe_action_t *create_pseudo_resource_op(resource_t * rsc, const char *task, bool optional, bool runnable, pe_working_set_t *data_set);
71 pe_action_t *pe_cancel_op(pe_resource_t *rsc, const char *name,
72  guint interval_ms, pe_node_t *node,
73  pe_working_set_t *data_set);
76 # define LOAD_STOPPED "load_stopped"
78 #endif
pe_action_t * pe_cancel_op(pe_resource_t *rsc, const char *name, guint interval_ms, pe_node_t *node, pe_working_set_t *data_set)
rsc_colocation_t * invert_constraint(rsc_colocation_t *constraint)
gboolean is_child_compatible(resource_t *child_rsc, node_t *local_node, enum rsc_role_e filter, gboolean current)
bool assign_node(resource_t *rsc, node_t *node, gboolean force)
void native_deallocate(resource_t *rsc)
int compare_capacity(const node_t *node1, const node_t *node2)
GList * sort_nodes_by_weight(GList *nodes, pe_node_t *active_node, pe_working_set_t *data_set)
int copies_per_node(resource_t *rsc)
enum action_tasks clone_child_action(action_t *action)
pe__location_t * copy_constraint(pe__location_t *constraint)
pe_action_t * sched_shutdown_op(pe_node_t *node, pe_working_set_t *data_set)
gboolean native_assign_node(resource_t *rsc, GListPtr candidates, node_t *chosen, gboolean force)
void calculate_utilization(GHashTable *current_utilization, GHashTable *utilization, gboolean plus)
pe__location_t * rsc2node_new(const char *id, pe_resource_t *rsc, int weight, const char *discovery_mode, pe_node_t *node, pe_working_set_t *data_set)
gboolean rsc_colocation_new(const char *id, const char *node_attr, int score, resource_t *rsc_lh, resource_t *rsc_rh, const char *state_lh, const char *state_rh, pe_working_set_t *data_set)
void process_utilization(resource_t *rsc, node_t **prefer, pe_working_set_t *data_set)
Definition: pe_types.h:258
void log_action(unsigned int log_level, const char *pre_text, action_t *action, gboolean details)
resource_t * find_compatible_child_by_node(resource_t *local_child, node_t *local_node, resource_t *rsc, enum rsc_role_e filter, gboolean current)
enum filter_colocation_res filter_colocation_constraint(resource_t *rsc_lh, resource_t *rsc_rh, rsc_colocation_t *constraint, gboolean preview)
enum pe_action_flags summary_action_flags(action_t *action, GListPtr children, node_t *node)
gboolean can_run_resources(const node_t *node)
gboolean can_run_any(GHashTable *nodes)
pe_resource_t * find_compatible_child(pe_resource_t *local_child, pe_resource_t *rsc, enum rsc_role_e filter, gboolean current, pe_working_set_t *data_set)
gboolean rsc_ticket_new(const char *id, resource_t *rsc_lh, ticket_t *ticket, const char *state_lh, const char *loss_policy, pe_working_set_t *data_set)
pe_action_t * create_pseudo_resource_op(resource_t *rsc, const char *task, bool optional, bool runnable, pe_working_set_t *data_set)
Definition: common.h:86
GList * GListPtr
Definition: crm.h:192
Definition: common.h:57