Plasma GitLab Archive
Projects Blog Knowledge

Module Nn_elect


module Nn_elect: sig .. end
Election of the coordinator

type role = [ `Coordinator | `Excluded | `Slave | `Unknown ] 
val get_role : unit -> role
Return the role. This is `Unknown if the election is not yet finished, and `Coordinator or `Slave otherwise.

Can be called from any Netplex container process.

val get_coordinator : unit -> string
Return the coordinator in "host:port" syntax. This is only known if the role is `Coordinator or `Slave.

Can be called from any Netplex container process.

val elect_e : Nn_config.nn_node_config ->
int -> Unixqueue.event_system -> (bool * string) Uq_engines.engine
Do the election. The int arg is the port number of this server.

Returns (is_coord, rev_ident): is_coord is true if this is the coordinator. rev_ident is the revision string.

val setup_elect_api : Rpc_server.t -> Nn_config.nn_node_config -> unit
Set up the RPC server so that Elect procedures are bound
This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml