Module cmap

Module cmap 

Source
Expand description

cmap is the internal ‘database’ of corosync - though it is NOT replicated. Mostly it contains a copy of the corosync.conf file and information about the running state of the daemon. The cmap API provides two ‘maps’. Icmap, which is as above, and Stats, which contains very detailed statistics on the running system, this includes network and IPC calls.

Structs§

CmapIntoIter
CmapIter
Value returned from the iterator. contains the key name and the Data
CmapIterStart
Create one of these to start iterating over cmap values.
Handle
A handle returned from initialize, needs to be passed to all other cmap API calls
NotifyCallback
Callback function called every time a tracker reports a change in a tracked value
TrackHandle
A handle for a specific CMAP tracker. returned from track_add. There may be multiple TrackHandles per Handle
TrackType
Tracker types for cmap, both passed into track_add and returned from its callback.

Enums§

Data
Data returned from the cmap::get() call and tracker & iterators. Contains the data itself and the type of that data.
DataType
The type of data returned from get or in a tracker callback or iterator, part of the Data struct
Map
“Maps” available to initialize

Functions§

context_get
Get the current ‘context’ value for this handle The context value is an arbitrary value that is always passed back to callbacks to help identify the source
context_set
Set the current ‘context’ value for this handle The context value is an arbitrary value that is always passed back to callbacks to help identify the source. Normally this is set in initialize, but this allows it to be changed
dec
decrement the value in a cmap key (must be a numeric type)
dispatch
Dispatch any/all active CMAP callbacks. Takes a Handle as returned from initialize, flags DispatchFlags tells it how many items to dispatch before returning
fd_get
Return a file descriptor to use for poll/select on the CMAP handle. Takes a Handle as returned from initialize, returns a C file descriptor as i32
finalize
Finish with a connection to corosync. Takes a Handle as returned from initialize
get
Get a value from cmap, returned as a Data struct, so could be anything
inc
increment the value in a cmap key (must be a numeric type)
initialize
Initialize a connection to the cmap subsystem. map specifies which cmap “map” to use. Returns a Handle into the cmap library
set
Sets a Data type into cmap
set_binary
Sets a binary value into cmap
set_i8
Sets an i8 value into cmap
set_i16
Sets an i16 value into cmap
set_i132
Sets an i32 value into cmap
set_i164
Sets an i64 value into cmap
set_number
Function to set a generic numeric value This doesn’t work for strings or binaries
set_string
Sets a string value into cmap
set_u8
set_u16
Sets a u16 value into cmap
set_u32
Sets a u32 value into cmap
set_u64
Sets a u64 value into cmap
track_add
Track changes in cmap values, multiple TrackHandles per Handle are allowed
track_delete
Remove a tracker frm this Handle