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)
Acquires locks via the Ganeti lock manager.
source code
 
_ExecLU(self, lu)
Logical Unit execution sequence.
source code
 
_LockAndExecLU(self, lu, level, calc_timeout)
Execute a Logical Unit, with the needed locks.
source code
 
ExecOpCode(self, op, cbs)
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) 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.OpPostInitCluster: cmdlib.LUPostInit...
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)

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

_LockAndExecLU(self, lu, level, calc_timeout)

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)

source code 

Execute an opcode.

Parameters:
  • op (an OpCode instance) - the opcode to be executed
  • cbs (OpExecCbBase) - Runtime callbacks

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.OpPostInitCluster: cmdlib.LUPostInitCluster, opcodes.OpDestro\
yCluster: cmdlib.LUDestroyCluster, opcodes.OpQueryClusterInfo: cmdlib.\
LUQueryClusterInfo, opcodes.OpVerifyCluster: cmdlib.LUVerifyCluster, o\
pcodes.OpQueryConfigValues: cmdlib.LUQueryConfigValues, opcodes.OpRena\
meCluster: cmdlib.LURenameCluster, opcodes.OpVerifyDisks: cmdlib.LUVer\
ifyDisks, opcodes.OpSetClusterParams: cmdlib.LUSetClusterParams, opcod\
es.OpRedistributeConfig: cmdlib.LURedistributeConfig, opcodes.OpRepair\
DiskSizes: cmdlib.LURepairDiskSizes, opcodes.OpAddNode: cmdlib.LUAddNo\
...