pacemaker  2.0.4-2deceaa
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
election.h
Go to the documentation of this file.
1 /*
2  * Copyright 2009-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  */
9 
10 #ifndef CRM_COMMON_ELECTION__H
11 # define CRM_COMMON_ELECTION__H
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
56 typedef struct election_s election_t;
57 
65 };
66 
67 void election_fini(election_t *e);
68 void election_reset(election_t *e);
69 election_t *election_init(const char *name, const char *uname, guint period_ms, GSourceFunc cb);
70 
71 void election_timeout_set_period(election_t *e, guint period_ms);
73 
74 void election_vote(election_t *e);
75 bool election_check(election_t *e);
76 void election_remove(election_t *e, const char *uname);
78 enum election_result election_count_vote(election_t *e, xmlNode *vote, bool can_win);
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif
bool election_check(election_t *e)
Check whether local node has won an election.
Definition: election.c:336
char uname[MAX_NAME]
Definition: internal.h:85
enum election_result election_count_vote(election_t *e, xmlNode *vote, bool can_win)
Process an election message (vote or no-vote) from a peer.
Definition: election.c:526
void election_remove(election_t *e, const char *uname)
Disregard any previous vote by specified peer.
Definition: election.c:123
void election_fini(election_t *e)
Free an election object.
Definition: election.c:159
void election_vote(election_t *e)
Start a new election by offering local node's candidacy.
Definition: election.c:283
struct election_s election_t
Definition: election.h:56
election_result
Definition: election.h:59
enum election_result election_state(election_t *e)
Definition: election.c:58
void election_clear_dampening(election_t *e)
Reset any election dampening currently in effect.
Definition: election.c:715
election_t * election_init(const char *name, const char *uname, guint period_ms, GSourceFunc cb)
Create a new election object.
Definition: election.c:83
void election_timeout_stop(election_t *e)
Stop an election's timer, if running.
Definition: election.c:185
void election_reset(election_t *e)
Stop election timer and disregard all votes.
Definition: election.c:137
void election_timeout_set_period(election_t *e, guint period_ms)
Change an election's timeout (restarting timer if running)
Definition: election.c:199
char * name
Definition: pcmk_fence.c:30