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)
Constructor for Processor
source code
 
_ExecLU(self, lu)
Logical Unit execution sequence.
source code
 
_LockAndExecLU(self, lu, level)
Execute a Logical Unit, with the needed locks.
source code
 
ExecOpCode(self, op, feedback_fn, run_notifier)
Execute an opcode.
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

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

Class Variables [hide private]
  DISPATCH_TABLE = {opcodes.OpDestroyCluster: cmdlib.LUDestroyCl...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, context)
(Constructor)

source code 

Constructor for Processor

Args:

  • feedback_fn: the feedback function (taking one string) to be run when interesting events are happening
Overrides: object.__init__

_LockAndExecLU(self, lu, level)

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, feedback_fn, run_notifier)

source code 

Execute an opcode.

Parameters:
  • op (an OpCode instance) - the opcode to be executed
  • feedback_fn (a function that takes a single argument) - this function will be used as feedback from the LU code to the end-user
  • run_notifier (callable (no arguments) or None) - this function (if callable) will be called when we are about to call the lu's Exec() method, that is, after we have acquired all locks

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.


Class Variable Details [hide private]

DISPATCH_TABLE

Value:
{opcodes.OpDestroyCluster: cmdlib.LUDestroyCluster, opcodes.OpQueryClu\
sterInfo: cmdlib.LUQueryClusterInfo, opcodes.OpVerifyCluster: cmdlib.L\
UVerifyCluster, opcodes.OpQueryConfigValues: cmdlib.LUQueryConfigValue\
s, opcodes.OpRenameCluster: cmdlib.LURenameCluster, opcodes.OpVerifyDi\
sks: cmdlib.LUVerifyDisks, opcodes.OpSetClusterParams: cmdlib.LUSetClu\
sterParams, opcodes.OpRedistributeConfig: cmdlib.LURedistributeConfig,\
 opcodes.OpRepairDiskSizes: cmdlib.LURepairDiskSizes, opcodes.OpAddNod\
e: cmdlib.LUAddNode, opcodes.OpQueryNodes: cmdlib.LUQueryNodes, opcode\
...