Commit 2d3e1244 authored by gerd's avatar gerd

support rank scripts


git-svn-id: https://gps.dynxs.de/private/svn/app-plasma/trunk@226 55289a75-7b90-4627-9e07-ffb4263930b2
parent ccfd6a47
......@@ -80,6 +80,7 @@ OCAMLPACKS[] =
rpc
netplex
netsys
shell
if $(not $(OCAMLFIND_EXISTS))
eprintln(This project requires ocamlfind, but is was not found.)
......
......@@ -8,7 +8,7 @@ object
method nn_node_timeout : float
method nn_node_alive_min : int
method nn_node_alive_min_startup : int
method nn_rank : int
method nn_rank : string
method nn_elect_timeout : float
method nn_inodecaches : string list
method nn_replication : int
......@@ -79,10 +79,25 @@ let extract_node_config (cf:Netplex_types.config_file) =
let rank =
try
let p = cf#resolve_parameter nn "rank" in
cf#int_param p
( try string_of_int (cf#int_param p)
with _ ->
cf # string_param p
)
with
| Not_found ->
failwith "missing namenodes.rank' parameter" in
( try
let p = cf#resolve_parameter nn "rank_script" in
let script = cf#string_param p in
let b = Buffer.create 80 in
Shell.call
~stdout:(Shell.to_buffer b)
[ Shell.cmd "/bin/sh" [ "-c"; script ]];
Buffer.contents b
with
| Not_found ->
failwith "missing 'namenodes.rank' or \
'namenodes.rank_script' parameters"
) in
let hostname =
try
let p = cf#resolve_parameter nn "hostname" in
......
......@@ -18,10 +18,11 @@ object
(** How many name nodes need to be alive to continue with operations *)
method nn_node_alive_min_startup : int
(** How many name nodes need to be alive at cluster startup *)
method nn_rank : int
method nn_rank : string
(** The rank of this node compared to other nodes. At startup time,
the node with the lowest rank number is chosen as coordinator.
Each node must have a distinct rank.
the node with the lowest rank is chosen as coordinator.
Each node must have a distinct rank. Ranks are compared as in
[String.compare].
*)
method nn_elect_timeout : float
(** For how many seconds to wait for neighbor namenodes *)
......
requires = "unix,netplex"
requires = "unix,netplex,shell"
archive(byte) = "plasmasupport.cma"
archive(native) = "plasmasupport.cmxa"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment