module documentation

OpCodes base module

This module implements part of the data structures which define the cluster operations - the so-called opcodes.

Every operation which modifies the cluster state is expressed via opcodes.

Class BaseOpCode A simple serializable object.
Function BuildJobDepCheck Builds check for job dependencies (DEPEND_ATTR).
Function NameToReasonSrc Convert an opcode class name to a source string for the reason trail
Constant COMMENT_ATTR Undocumented
Constant DEPEND_ATTR Undocumented
Constant SUMMARY_PREFIX Undocumented
Variable TNoRelativeJobDependencies Undocumented
Class _AutoOpParamSlots Meta class for opcode definitions.
Function _NameComponents Split an opcode class name into its components
Function _NameToId Convert an opcode class name to an OP_ID.
Constant _OPID_RE Undocumented
def BuildJobDepCheck(relative):

Builds check for job dependencies (DEPEND_ATTR).

Parameters
relative:boolWhether to accept relative job IDs (negative)
Returns
callableUndocumented
def NameToReasonSrc(name, prefix):

Convert an opcode class name to a source string for the reason trail

Parameters
name:stringthe class name, as OpXxxYyy
prefix:stringthe prefix that will be prepended to the opcode name
Returns
stringthe name in the OP_XXXX_YYYY format
COMMENT_ATTR: str =

Undocumented

Value
'comment'
DEPEND_ATTR: str =

Undocumented

Value
'depends'
SUMMARY_PREFIX: dict[str, str] =

Undocumented

Value
{'CLUSTER_': 'C_', 'GROUP_': 'G_', 'NODE_': 'N_', 'INSTANCE_': 'I_'}
TNoRelativeJobDependencies =

Undocumented

def _NameComponents(name):

Split an opcode class name into its components

Parameters
name:stringthe class name, as OpXxxYyy
Returns
array of stringsthe components of the name
def _NameToId(name):

Convert an opcode class name to an OP_ID.

Parameters
name:stringthe class name, as OpXxxYyy
Returns
stringthe name in the OP_XXXX_YYYY format
_OPID_RE =

Undocumented

Value
re.compile(r'([a-z])([A-Z])')