Package ganeti :: Module mcpu :: Class Processor
[hide private]
[frames] | no frames]

Class Processor

source code


Object which runs OpCodes

Instance Methods [hide private]
 
__init__(self, context, ec_id)
Constructor for Processor
source code
 
_AcquireLocks(self, level, names, shared, timeout, priority)
Acquires locks via the Ganeti lock manager.
source code
 
_ProcessResult(self, result)
Examines opcode result.
source code
 
_ExecLU(self, lu)
Logical Unit execution sequence.
source code
 
_LockAndExecLU(self, lu, level, calc_timeout, priority)
Execute a Logical Unit, with the needed locks.
source code
 
ExecOpCode(self, op, cbs, timeout=None, priority=None)
Execute an opcode.
source code
 
Log(self, *args)
Forward call to feedback callback function.
source code
 
LogStep(self, current, total, message)
Log a change in LU execution progress.
source code
 
LogWarning(self, message, *args, **kwargs)
Log a warning to the logs and the user.
source code
 
LogInfo(self, message, *args)
Log an informational message to the logs and the user.
source code
 
GetECId(self)
Returns the current execution context ID.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  DISPATCH_TABLE = _ComputeDispatchTable()
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, context, ec_id)
(Constructor)

source code 

Constructor for Processor

Parameters:
  • context (GanetiContext) - global Ganeti context
  • ec_id (string) - execution context identifier
Overrides: object.__init__

_AcquireLocks(self, level, names, shared, timeout, priority)

source code 

Acquires locks via the Ganeti lock manager.

Parameters:
  • level (int) - Lock level
  • names (list or string) - Lock names
  • shared (bool) - Whether the locks should be acquired in shared mode
  • timeout (None or float) - Timeout for acquiring the locks
Raises:

_ProcessResult(self, result)

source code 

Examines opcode result.

If necessary, additional processing on the result is done.

_LockAndExecLU(self, lu, level, calc_timeout, priority)

source code 

Execute a Logical Unit, with the needed locks.

This is a recursive function that starts locking the given level, and proceeds up, till there are no more locks to acquire. Then it executes the given LU and its opcodes.

ExecOpCode(self, op, cbs, timeout=None, priority=None)

source code 

Execute an opcode.

Parameters:
  • op (an OpCode instance) - the opcode to be executed
  • cbs (OpExecCbBase) - Runtime callbacks
  • timeout (float or None) - Maximum time to acquire all locks, None for no timeout
  • priority (number or None) - Priority for acquiring lock(s)
Raises:

LogWarning(self, message, *args, **kwargs)

source code 

Log a warning to the logs and the user.

The optional keyword argument is 'hint' and can be used to show a hint to the user (presumably related to the warning). If the message is empty, it will not be printed at all, allowing one to show only a hint.