Plasma GitLab Archive
Projects Blog Knowledge

Plasma Project:

Module Nn_monitor

module Nn_monitor: sig .. end
Management of datastores, i.e. which datastores are available on which datanodes

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 list
Returns the list of all datastores
val get : string -> Nn_datastores.datastore
Get the store record by identity string, or raise Not_found
val add : Nn_datastores.datastore -> unit
Add the datastore record as-is (for initializing this module from db).
val update_from_db : ?when_done:(unit -> unit) -> int -> unit
Read the db version of this record, and trigger the update of the module copy of it. The actual update will happen at some point in the future.
val delete : string -> unit
delete identity: Remove this store
val enable : string -> unit
enable identity: Sets enabled to true
val disable : string -> unit
disable identity: Sets enabled to false
val is_alive : string -> bool
is_alive identity: Returns whether the datanode having this store is good as seen by the monitor. Fails if the monitor is not started.
val start_publishing : unit -> unit
Updates on the datastores are published and can be retrieved from any other process using Nn_datastore_news

Stops feeding the news module
val post_add_hook : Netplex_types.socket_service -> Netplex_types.controller -> unit
Needs to be called from the post_add_hook
val receive_message : Pfs_auth.client_auth ->
Netplex_types.container -> string -> string array -> unit
Needs to be called from the receive_message hook in order to arrange notifications about db updates
val post_start_hook : Netplex_types.container ->
Nn_config.nn_node_config -> Pfs_auth.client_auth -> unit
Reads the datastore table from the database, and starts discovering datanodes.

It is required that Nn_db.init was called before.

val shutdown : unit -> unit
To be called at shutdown time
This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml