hosts()

Description:

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

Syntax:

hosts(h,n)

Note:

The function gets the nodes containing data zones from 1 to n from the sequence of main processes h and returns them by data zone numbers. When parameter n is 0, return all available nodes in h.

It performs the searching by node computing ability in descending order. For example, after finding the node containing data zone 1, the function assumes that the number of subtasks running on it is less than the preferred task number and re-assests the computing abilities of the other nodes to find the node holding data zone 2.

Parameters:

h

The sequence of main processes

n

Data zone number

Options:

@i

Find data zones numbered from 1 to n from the main processes and return them as a sequence. Use default hosts method to find if one or more data zones cannot be found; return null if the second searching fails.

@0

Find available nodes specified by parameter n without referencing the data zones; use this option at the second searching when it works with @i option.

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)