Package ganeti :: Package rpc :: Module node :: Class _RpcProcessor
[hide private]
[frames] | no frames]

Class _RpcProcessor

source code

Instance Methods [hide private]
 
__init__(self, resolver, port, lock_monitor_cb=None)
Initializes this class.
source code
dictionary
__call__(self, nodes, procedure, body, read_timeout, resolver_opts, _req_process_fn=None)
Makes an RPC request to a number of nodes.
source code
Static Methods [hide private]
 
_PrepareRequests(hosts, port, procedure, body, read_timeout)
Prepares requests by sorting offline hosts into separate list.
source code
 
_CombineResults(results, requests, procedure)
Combines pre-computed results for offline hosts with actual call results.
source code
Method Details [hide private]

__init__(self, resolver, port, lock_monitor_cb=None)
(Constructor)

source code 

Initializes this class.

Parameters:
  • resolver - callable accepting a list of node UUIDs or hostnames, returning a list of tuples containing name, IP address and original name of the resolved node. IP address can be the name or the special value _OFFLINE to mark offline machines.
  • port (int) - TCP port
  • lock_monitor_cb - Callable for registering with lock monitor

_PrepareRequests(hosts, port, procedure, body, read_timeout)
Static Method

source code 

Prepares requests by sorting offline hosts into separate list.

Parameters:
  • body (dict) - a dictionary with per-host body data

__call__(self, nodes, procedure, body, read_timeout, resolver_opts, _req_process_fn=None)
(Call operator)

source code 

Makes an RPC request to a number of nodes.

Parameters:
  • nodes (sequence) - node UUIDs or Hostnames
  • procedure (string) - Request path
  • body (dictionary) - dictionary with request bodies per host
  • read_timeout (int or None) - Read timeout for request
Returns: dictionary
a dictionary mapping host names to rpc.RpcResult objects