module Nn_monitor:Management of datastores, i.e. which datastores are available on which datanodessig..end
This module is run inside the single nn_monitor process. Read access
from other processes is possible via the Nn_datastore_news module
(using a pub/sub scheme).
The module can also be notified to merge db changes into its in-core
set of datastores.
val list : unit -> Nn_datastores.datastore listval get : string -> Nn_datastores.datastoreNot_foundval add : Nn_datastores.datastore -> unitval update_from_db : ?when_done:(unit -> unit) -> int -> unitval delete : string -> unitdelete identity: Remove this storeval enable : string -> unitenable identity: Sets enabled to trueval disable : string -> unitdisable identity: Sets enabled to falseval is_alive : string -> boolis_alive identity: Returns whether the datanode having this store
is good as seen by the monitor. Fails if the monitor is not started.val discover : ?when_done:(Nn_datastores.discovered option -> unit) -> Unix.sockaddr -> unitdiscover addr bs: Contacts this datanode and gets the identity. If
the identity was added before, the store's location is set to this
address.
This function can only be called within a Netplex component. The discovery is actually only triggered. If the monitor is also running, the datanode is enabled for being monitored.
In order to qualify, the datanode must have at least the size as
configured in the datastore record. It is no error if the node is
bigger. Also, the blocksize must be bs.
when_done: If passed, this function is called back when the
discovery is done. If the argument is None it was not successful.
If it is Some d, the record d contains the discovered identity
and the size as reported by the datanode.
val start_publishing : unit -> unitNn_datastore_newsval post_add_hook : Netplex_types.socket_service -> Netplex_types.controller -> unitpost_add_hookval receive_message : Netplex_types.container -> string -> string array -> unitreceive_message hook in order to
arrange notifications about db updatesval post_start_hook : Netplex_types.container -> Nn_config.nn_node_config -> unit
It is required that Nn_db.init was called before.