pacemaker  3.0.0-d8340737c4
Scalable High-Availability cluster resource manager
scheduler.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2024 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  */
9 
10 #ifndef PCMK__CRM_COMMON_SCHEDULER__H
11 #define PCMK__CRM_COMMON_SCHEDULER__H
12 
13 #include <sys/types.h> // time_t
14 #include <libxml/tree.h> // xmlNode
15 #include <glib.h> // guint, GList, GHashTable
16 
17 #include <crm/common/iso8601.h> // crm_time_t
18 
19 #include <crm/common/actions.h>
20 #include <crm/common/nodes.h>
21 #include <crm/common/resources.h>
22 #include <crm/common/roles.h>
23 #include <crm/common/rules.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
36 // NOTE: sbd (as of at least 1.5.2) uses this enum
44 
45 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
46  // NOTE: sbd (as of at least 1.5.2) uses this value
49 
50  // NOTE: sbd (as of at least 1.5.2) uses this value
53 
54  // NOTE: sbd (as of at least 1.5.2) uses this value
57 
60 
61  // NOTE: sbd (as of at least 1.5.2) uses this value
64 #endif
65 };
66 
69 
70 /* Implementation of pcmk_scheduler_t
71  *
72  * @COMPAT Drop this struct once all members are moved to
73  * pcmk__scheduler_private_t, and repoint pcmk_scheduler_t to that
74  */
77  // Be careful about when each piece of information is available and final
78 
79  // NOTE: sbd (as of at least 1.5.2) uses this
81  xmlNode *input; // CIB XML
82 
83  // NOTE: sbd (as of at least 1.5.2) uses this
85  pcmk_node_t *dc_node; // Node object for DC
86 
87  // NOTE: sbd (as of at least 1.5.2) uses this
89  uint64_t flags; // Group of enum pcmk__scheduler_flags
90 
91  // NOTE: sbd (as of at least 1.5.2) uses this
93  enum pe_quorum_policy no_quorum_policy; // Response to loss of quorum
94 
95  // NOTE: sbd (as of at least 1.5.2) uses this
97  GList *nodes; // Nodes in cluster
98 
100 };
101 
104  *scheduler);
105 
107 
110  const char *node_name);
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif // PCMK__CRM_COMMON_SCHEDULER__H
pcmk_node_t * pcmk_find_node(const pcmk_scheduler_t *scheduler, const char *node_name)
Find a node by name in scheduler data.
Definition: scheduler.c:100
Scheduler API for resources.
Do not recover resources from outside partition.
Definition: scheduler.h:39
Type aliases needed to define scheduler objects.
APIs related to actions.
pcmk_node_t * pcmk_get_dc(const pcmk_scheduler_t *scheduler)
Definition: scheduler.c:30
pcmk__scheduler_private_t * priv
Definition: scheduler.h:99
uint64_t flags
Definition: scheduler.h:89
Stop all resources in partition.
Definition: scheduler.h:40
pcmk_node_t * dc_node
Definition: scheduler.h:85
enum pe_quorum_policy no_quorum_policy
Definition: scheduler.h:93
pe_quorum_policy
Possible responses to loss of quorum.
Definition: scheduler.h:38
Scheduler API for resource roles.
Demote promotable resources and stop all others.
Definition: scheduler.h:43
ISO_8601 Date handling.
Act as if partition still holds quorum.
Definition: scheduler.h:41
bool pcmk_has_quorum(const pcmk_scheduler_t *scheduler)
Definition: scheduler.c:82
Fence all nodes in partition.
Definition: scheduler.h:42
Scheduler API for nodes.
GList * nodes
Definition: scheduler.h:97
pcmk_scheduler_t * scheduler
xmlNode * input
Definition: scheduler.h:81
int pcmk_set_scheduler_cib(pcmk_scheduler_t *scheduler, xmlNode *cib)
Definition: scheduler.c:64
Scheduler API for rules.
enum pe_quorum_policy pcmk_get_no_quorum_policy(const pcmk_scheduler_t *scheduler)
Definition: scheduler.c:44