|
ensembl-hive-python3
2.4
|
This is the counterpart of GuestProcess. More...
Inheritance diagram for eHive.Process.BaseRunnable:Public Member Functions | |
| def | __init__ (self, read_fileno, write_fileno) |
| def | warning (self, message, is_error=False) |
| Store a message in the log_message table with is_error indicating whether the warning is actually an error or not. More... | |
| def | dataflow (self, output_ids, branch_name_or_code=1) |
| Dataflows the output_id(s) on a given branch (default 1). More... | |
| def | worker_temp_directory (self) |
| Returns the full path of the temporary directory created by the worker. More... | |
| def | param_defaults (self) |
| Returns the defaults parameters for this runnable. More... | |
| def | param_required (self, param_name) |
| Returns the value of the parameter "param_name" or raises an exception if anything wrong happens or the value is None. More... | |
| def | param (self, param_name, args) |
| When called as a setter: sets the value of the parameter "param_name". More... | |
| def | param_exists (self, param_name) |
| Returns True if the parameter exists and can be successfully substituted, None if the substitution fails, False if it is missing. More... | |
| def | param_is_defined (self, param_name) |
| Returns True if the parameter exists and can be successfully substituted to a defined value, None if the substitution fails, False if it is missing or evaluates as None. More... | |
Public Attributes | |
| debug | |
| input_job | |
| autoflow | |
Private Member Functions | |
| def | __print_debug (self, args) |
| def | __send_message (self, event, content) |
| seralizes the message in JSON and send it to the parent process More... | |
| def | __send_response (self, response) |
| Sends a response message to the parent process. More... | |
| def | __read_message (self) |
| Read a message from the parent and parse it. More... | |
| def | __send_message_and_wait_for_OK (self, event, content) |
| Send a message and expects a response to be 'OK'. More... | |
| def | __process_life_cycle (self) |
| Simple loop: wait for job parameters, do the job's life-cycle. More... | |
| def | __job_life_cycle (self, config) |
| Job's life-cycle. More... | |
| def | __run_method_if_exists (self, method) |
| method is one of "pre_cleanup", "fetch_input", "run", "write_output", "post_cleanup". More... | |
| def | __traceback (self, skipped_traces) |
| Remove "skipped_traces" lines from the stack trace (the eHive part) More... | |
Private Attributes | |
| __read_pipe | |
| __write_pipe | |
| __pid | |
| __created_worker_temp_directory | |
| __params | |
This is the counterpart of GuestProcess.
Note that most of the methods are private to be hidden in the derived classes.
This class can be used as a base-class for people to redefine fetch_input(), run() and/or write_output() (and/or pre_cleanup(), post_cleanup()). Jobs are supposed to raise CompleteEarlyException in case they complete before reaching. They can also raise JobFailedException to indicate a general failure
Definition at line 51 of file Process.py.
| def eHive.Process.BaseRunnable.__init__ | ( | self, | |
| read_fileno, | |||
| write_fileno | |||
| ) |
Definition at line 56 of file Process.py.
|
private |
Job's life-cycle.
See GuestProcess for a description of the protocol to communicate with the parent
Definition at line 132 of file Process.py.
Here is the call graph for this function:
|
private |
|
private |
Simple loop: wait for job parameters, do the job's life-cycle.
Definition at line 118 of file Process.py.
Here is the call graph for this function:
|
private |
Read a message from the parent and parse it.
Definition at line 96 of file Process.py.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
method is one of "pre_cleanup", "fetch_input", "run", "write_output", "post_cleanup".
We only the call the method if it exists to save a trip to the database.
Definition at line 190 of file Process.py.
Here is the call graph for this function:
|
private |
seralizes the message in JSON and send it to the parent process
Definition at line 72 of file Process.py.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Send a message and expects a response to be 'OK'.
Definition at line 110 of file Process.py.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Sends a response message to the parent process.
Definition at line 86 of file Process.py.
Here is the call graph for this function:
|
private |
Remove "skipped_traces" lines from the stack trace (the eHive part)
Definition at line 197 of file Process.py.
| def eHive.Process.BaseRunnable.dataflow | ( | self, | |
| output_ids, | |||
branch_name_or_code = 1 |
|||
| ) |
Dataflows the output_id(s) on a given branch (default 1).
Returns whatever the Perl side returns
Definition at line 215 of file Process.py.
Here is the caller graph for this function:| def eHive.Process.BaseRunnable.param | ( | self, | |
| param_name, | |||
| args | |||
| ) |
When called as a setter: sets the value of the parameter "param_name".
When called as a getter: returns the value of the parameter "param_name". It does not raise an exception if the parameter (or another one in the substitution stack) is undefined
Definition at line 259 of file Process.py.
Here is the caller graph for this function:| def eHive.Process.BaseRunnable.param_defaults | ( | self | ) |
Returns the defaults parameters for this runnable.
Definition at line 238 of file Process.py.
Here is the caller graph for this function:| def eHive.Process.BaseRunnable.param_exists | ( | self, | |
| param_name | |||
| ) |
Returns True if the parameter exists and can be successfully substituted, None if the substitution fails, False if it is missing.
Definition at line 274 of file Process.py.
Here is the caller graph for this function:| def eHive.Process.BaseRunnable.param_is_defined | ( | self, | |
| param_name | |||
| ) |
Returns True if the parameter exists and can be successfully substituted to a defined value, None if the substitution fails, False if it is missing or evaluates as None.
Definition at line 287 of file Process.py.
Here is the call graph for this function:| def eHive.Process.BaseRunnable.param_required | ( | self, | |
| param_name | |||
| ) |
Returns the value of the parameter "param_name" or raises an exception if anything wrong happens or the value is None.
The exception is marked as non-transient.
Definition at line 245 of file Process.py.
Here is the caller graph for this function:| def eHive.Process.BaseRunnable.warning | ( | self, | |
| message, | |||
is_error = False |
|||
| ) |
Store a message in the log_message table with is_error indicating whether the warning is actually an error or not.
Definition at line 210 of file Process.py.
Here is the call graph for this function:
Here is the caller graph for this function:| def eHive.Process.BaseRunnable.worker_temp_directory | ( | self | ) |
Returns the full path of the temporary directory created by the worker.
Runnables can implement "worker_temp_directory_name()" to return the name they would like to use
Definition at line 226 of file Process.py.
Here is the call graph for this function:
|
private |
Definition at line 121 of file Process.py.
|
private |
Definition at line 136 of file Process.py.
|
private |
Definition at line 60 of file Process.py.
|
private |
Definition at line 58 of file Process.py.
|
private |
Definition at line 59 of file Process.py.
| eHive.Process.BaseRunnable.autoflow |
Definition at line 217 of file Process.py.
| eHive.Process.BaseRunnable.debug |
Definition at line 61 of file Process.py.
| eHive.Process.BaseRunnable.input_job |
Definition at line 139 of file Process.py.