hosts()

Description:

Search the main processes to get nodes containing specified data zones.

Syntax:

hosts(h,n)

Note:

The function gets a sequence of available nodes whose corresponding memory data zone numbers are 1,,n from the node list h. For a missing node, execute intiation (init.dfx)) through corresponding missing value on a node whose memory data zone number is 0. Return null if no enough nodes are found.

Return a sequence of available nodes if data zone number is 0, where the unavailable node(s) is represented by null(s).

 

Parameters:

h

The sequence of nodes

n

Data zone number

Return value:

A sequence

Example:

hosts("192.168.0.116:8281",2)

hosts(["192.168.0.116:8281","192.168.0.116:8282"],0)

Parameter n is 0 and the function returns the available nodes

hosts(["192.168.0.116:8281","192.168.0.116:8282","192.168.0.129:8281"],3)

=hosts(["192.168.0.106:8281","192.168.0.106:8282","192.168.0.106:8283"],0)

Return null since 192.168.0.106:8283 node cannot be found

=hosts(["192.168.0.106:8281","192.168.0.106:8282"],2)

Execute initiation (init.dfx) using the corresponding missing value since the memory data zone number for node 192.168.0.106:8282 is null