Skip to content
Snippets Groups Projects
Commit 0e46916d authored by Iustin Pop's avatar Iustin Pop
Browse files

Rename BaseJO to BaseOpCode

Since we don't have for now a job definition object anymore, we rename
this class to BaseOpCode. It's still useful (and not merged with OpCode)
since it holds all the 'pure' logic (no custom field handling, etc.)
whereas OpCode holds opcode specific data (OP_ID handling, etc).

The patch also fixes the module's docstring.

Reviewed-by: imsnah
parent f0d874fe
No related branches found
No related tags found
No related merge requests found
...@@ -24,11 +24,8 @@ ...@@ -24,11 +24,8 @@
This module implements the data structures which define the cluster This module implements the data structures which define the cluster
operations - the so-called opcodes. operations - the so-called opcodes.
Every operation which modifies the cluster state is expressed via
This module implements the logic for doing operations in the cluster. There opcodes.
are two kinds of classes defined:
- opcodes, which are small classes only holding data for the task at hand
- logical units, which know how to deal with their specific opcode only
""" """
...@@ -37,11 +34,12 @@ are two kinds of classes defined: ...@@ -37,11 +34,12 @@ are two kinds of classes defined:
# pylint: disable-msg=R0903 # pylint: disable-msg=R0903
class BaseJO(object): class BaseOpCode(object):
"""A simple serializable object. """A simple serializable object.
This object serves as a parent class for both OpCode and Job since This object serves as a parent class for OpCode without any custom
they are serialized in the same way. field handling.
""" """
__slots__ = [] __slots__ = []
...@@ -73,7 +71,7 @@ class BaseJO(object): ...@@ -73,7 +71,7 @@ class BaseJO(object):
setattr(self, name, state[name]) setattr(self, name, state[name])
class OpCode(BaseJO): class OpCode(BaseOpCode):
"""Abstract OpCode""" """Abstract OpCode"""
OP_ID = "OP_ABSTRACT" OP_ID = "OP_ABSTRACT"
__slots__ = [] __slots__ = []
...@@ -82,7 +80,7 @@ class OpCode(BaseJO): ...@@ -82,7 +80,7 @@ class OpCode(BaseJO):
"""Specialized getstate for opcodes. """Specialized getstate for opcodes.
""" """
data = BaseJO.__getstate__(self) data = BaseOpCode.__getstate__(self)
data["OP_ID"] = self.OP_ID data["OP_ID"] = self.OP_ID
return data return data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment