pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
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>
22#include <crm/common/roles.h>
23#include <crm/common/rules.h>
25
26#ifdef __cplusplus
27extern "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
105
108 *scheduler);
109
111
114 const char *node_name);
115
116#ifdef __cplusplus
117}
118#endif
119
120#endif // PCMK__CRM_COMMON_SCHEDULER__H
APIs related to actions.
Scheduler API for rules.
ISO_8601 Date handling.
pcmk_scheduler_t * scheduler
Scheduler API for nodes.
Scheduler API for resources.
Scheduler API for resource roles.
pe_quorum_policy
Possible responses to loss of quorum.
Definition scheduler.h:38
@ pcmk_no_quorum_freeze
Do not recover resources from outside partition.
Definition scheduler.h:39
@ pcmk_no_quorum_stop
Stop all resources in partition.
Definition scheduler.h:40
@ pcmk_no_quorum_ignore
Act as if partition still holds quorum.
Definition scheduler.h:41
@ no_quorum_suicide
Definition scheduler.h:59
@ no_quorum_demote
Definition scheduler.h:63
@ no_quorum_freeze
Definition scheduler.h:48
@ no_quorum_ignore
Definition scheduler.h:56
@ no_quorum_stop
Definition scheduler.h:52
@ pcmk_no_quorum_demote
Demote promotable resources and stop all others.
Definition scheduler.h:43
@ pcmk_no_quorum_fence
Fence all nodes in partition.
Definition scheduler.h:42
int pcmk_set_scheduler_cib(pcmk_scheduler_t *scheduler, xmlNode *cib)
Definition scheduler.c:246
bool pcmk_has_quorum(const pcmk_scheduler_t *scheduler)
Definition scheduler.c:264
void pcmk_free_scheduler(pcmk_scheduler_t *scheduler)
Free scheduler data.
Definition scheduler.c:193
pcmk_scheduler_t * pcmk_new_scheduler(void)
Create a new object to hold scheduler data.
Definition scheduler.c:32
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:282
void pcmk_reset_scheduler(pcmk_scheduler_t *scheduler)
Reset scheduler data to defaults.
Definition scheduler.c:87
pcmk_node_t * pcmk_get_dc(const pcmk_scheduler_t *scheduler)
Definition scheduler.c:212
enum pe_quorum_policy pcmk_get_no_quorum_policy(const pcmk_scheduler_t *scheduler)
Definition scheduler.c:226
Type aliases needed to define scheduler objects.
pcmk_node_t * dc_node
Definition scheduler.h:85
pcmk__scheduler_private_t * priv
Definition scheduler.h:99
enum pe_quorum_policy no_quorum_policy
Definition scheduler.h:93
GList * nodes
Definition scheduler.h:97
xmlNode * input
Definition scheduler.h:81
uint64_t flags
Definition scheduler.h:89